# grid2fp
A tool to eat grid diagrams and generate its front projections.
## Disclaimer
The tool is lightly tested. I would expect bugs and strange behavior. If you find something make an issue.
## Installation
Install with pip:
```
pip install grid2fp
```
## Usage
### CLI
Doesn't exist.
## Scripting
```python
from grid2fp import grid2fp
import drawsvg as draw
csv_path = "path"
svg_path = "path"
diagram = [["x","","o"],["","",""],["o","","x"]]
# Option 1
g = grid2fp(csv_file=csv_path,draw_crossings=False)
d = g.draw()
d.save_svg(svg_path)
# Option 2
grid2fp(csv_file=csv_path, out_file=svg_path)
# Option 3
g = grid2fp(diagram=diagram)
d = g.draw()
d.save_svg(svg_path)
# Option 4
g = grid2fp(csv_file=csv_path,string_color = "pink", crossing_color="purple")
d = g.draw()
# make some changes to d with drawsvg
d.save_svg(svg_path)
```
## Sample images
|o| | |x| |
|-|-|-|-|-|
| | |x| |o|
| |x| |o| |
|x| |o| | |
| |o| | |x|
<img style="width:400px;height:auto" src="https://raw.githubusercontent.com/Joecstarr/grid2fp/main/test/trefoil.svg"/>
|x| |o|
|-|-|-|
| | | |
|o| |x|
<img style="width:400px;height:auto" src="https://raw.githubusercontent.com/Joecstarr/grid2fp/main/test/un.svg"/>
|| |o| | |x| |
|-|-|-|-|-|-|-|
| | | | |o| |x|
| |x| | | |o| |
|o| |x| | | | |
| | | |x| | |o|
| |o| | |x| | |
|x| | |o| | | |
<img style="width:400px;height:auto" src="https://raw.githubusercontent.com/Joecstarr/grid2fp/main/test/fig1_from_paper.svg"/>
## ToDo
- [ ] CLI interface
- [x] fit canvas to drawing better.(still not perfect)
- [x] set string color
- [ ] ???
Raw data
{
"_id": null,
"home_page": "https://github.com/Joecstarr/grid2fp",
"name": "grid2fp",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3",
"maintainer_email": null,
"keywords": "topology, Legendrian, Grid Diagram, knot",
"author": "Joe Starr",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/b8/ed/2f01744b097ffa2d0ac3888bab5a1d149a7e65e226b02dbb1709acb19806/grid2fp-0.0.10.tar.gz",
"platform": null,
"description": "# grid2fp\n\nA tool to eat grid diagrams and generate its front projections.\n\n## Disclaimer\nThe tool is lightly tested. I would expect bugs and strange behavior. If you find something make an issue.\n\n## Installation\n\nInstall with pip:\n\n```\npip install grid2fp\n```\n\n## Usage\n\n### CLI\nDoesn't exist.\n## Scripting\n\n\n```python\nfrom grid2fp import grid2fp\nimport drawsvg as draw\n\n\n\ncsv_path = \"path\"\nsvg_path = \"path\"\n\ndiagram = [[\"x\",\"\",\"o\"],[\"\",\"\",\"\"],[\"o\",\"\",\"x\"]]\n\n\n# Option 1\n\ng = grid2fp(csv_file=csv_path,draw_crossings=False)\nd = g.draw()\nd.save_svg(svg_path)\n\n# Option 2\ngrid2fp(csv_file=csv_path, out_file=svg_path)\n\n# Option 3\n\ng = grid2fp(diagram=diagram)\nd = g.draw()\nd.save_svg(svg_path)\n\n# Option 4\n\ng = grid2fp(csv_file=csv_path,string_color = \"pink\", crossing_color=\"purple\")\nd = g.draw()\n# make some changes to d with drawsvg\nd.save_svg(svg_path)\n\n```\n## Sample images\n\n\n|o| | |x| |\n|-|-|-|-|-|\n| | |x| |o|\n| |x| |o| |\n|x| |o| | |\n| |o| | |x|\n\n\n<img style=\"width:400px;height:auto\" src=\"https://raw.githubusercontent.com/Joecstarr/grid2fp/main/test/trefoil.svg\"/>\n\n\n|x| |o|\n|-|-|-|\n| | | |\n|o| |x|\n\n<img style=\"width:400px;height:auto\" src=\"https://raw.githubusercontent.com/Joecstarr/grid2fp/main/test/un.svg\"/>\n\n\n|\u200e| |o| | |x| |\n|-|-|-|-|-|-|-|\n| | | | |o| |x|\n| |x| | | |o| |\n|o| |x| | | | |\n| | | |x| | |o|\n| |o| | |x| | |\n|x| | |o| | | |\n\n<img style=\"width:400px;height:auto\" src=\"https://raw.githubusercontent.com/Joecstarr/grid2fp/main/test/fig1_from_paper.svg\"/>\n\n\n\n## ToDo\n- [ ] CLI interface\n- [x] fit canvas to drawing better.(still not perfect)\n- [x] set string color\n- [ ] ???\n",
"bugtrack_url": null,
"license": null,
"summary": "A tool to eat grid diagrams and generate its front projection.",
"version": "0.0.10",
"project_urls": {
"Homepage": "https://github.com/Joecstarr/grid2fp"
},
"split_keywords": [
"topology",
" legendrian",
" grid diagram",
" knot"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "c70ac5605bc00e02f860953628375c4c53668d81d971ff18da41100ea2906715",
"md5": "77f2da69e62a2beeb4322149549b589b",
"sha256": "6fc1fe9b31e89326d658e093ec08244a0cfc8804e17becd35ccc4eb147fa4549"
},
"downloads": -1,
"filename": "grid2fp-0.0.10-py3-none-any.whl",
"has_sig": false,
"md5_digest": "77f2da69e62a2beeb4322149549b589b",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3",
"size": 17097,
"upload_time": "2024-05-31T07:10:25",
"upload_time_iso_8601": "2024-05-31T07:10:25.423600Z",
"url": "https://files.pythonhosted.org/packages/c7/0a/c5605bc00e02f860953628375c4c53668d81d971ff18da41100ea2906715/grid2fp-0.0.10-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "b8ed2f01744b097ffa2d0ac3888bab5a1d149a7e65e226b02dbb1709acb19806",
"md5": "1700ba0eded2b9d90e61a6dd6aafa074",
"sha256": "4109f6173f1883808febf0d090d0f85e21fff5c31939762ed15b9edafa307143"
},
"downloads": -1,
"filename": "grid2fp-0.0.10.tar.gz",
"has_sig": false,
"md5_digest": "1700ba0eded2b9d90e61a6dd6aafa074",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3",
"size": 16418,
"upload_time": "2024-05-31T07:10:26",
"upload_time_iso_8601": "2024-05-31T07:10:26.953597Z",
"url": "https://files.pythonhosted.org/packages/b8/ed/2f01744b097ffa2d0ac3888bab5a1d149a7e65e226b02dbb1709acb19806/grid2fp-0.0.10.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-05-31 07:10:26",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Joecstarr",
"github_project": "grid2fp",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"lcname": "grid2fp"
}