{"id":21971572,"url":"https://github.com/mandarancio/charter","last_synced_at":"2025-04-28T12:03:09.503Z","repository":{"id":49977134,"uuid":"116962846","full_name":"Mandarancio/charter","owner":"Mandarancio","description":"DSL and C Library to generate SVG Plot ","archived":false,"fork":false,"pushed_at":"2023-10-04T05:41:44.000Z","size":221,"stargazers_count":43,"open_issues_count":1,"forks_count":8,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-28T12:02:58.795Z","etag":null,"topics":["c","dsl","hoedown","html","latex","markdown","marker","pgfplots","plot","plotting","plotting-scripts","script","svg"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Mandarancio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-01-10T13:42:08.000Z","updated_at":"2025-04-13T07:54:02.000Z","dependencies_parsed_at":"2024-11-29T22:16:37.104Z","dependency_job_id":null,"html_url":"https://github.com/Mandarancio/charter","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mandarancio%2Fcharter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mandarancio%2Fcharter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mandarancio%2Fcharter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mandarancio%2Fcharter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Mandarancio","download_url":"https://codeload.github.com/Mandarancio/charter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251311333,"owners_count":21569009,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c","dsl","hoedown","html","latex","markdown","marker","pgfplots","plot","plotting","plotting-scripts","script","svg"],"created_at":"2024-11-29T14:52:03.299Z","updated_at":"2025-04-28T12:03:09.487Z","avatar_url":"https://github.com/Mandarancio.png","language":"C","readme":"# CHARTER\nA simple markdown **DSL** and **C Library** to generate *svg* and *pgfplot* (*LaTeX*)  plot from a minimal syntax.\n\n\n\n## Example\n\nFew examples are available in the [gallery](https://github.com/Mandarancio/charter/wiki/Gallery) page of the wiki.\n\nSimple syntax example:\n\n```\ntitle: reconstruction error vs compression\nx-axis:\n\tlabel: compression\n\tmode: log\ny-axis:\n\tlabel: mse\nplot:\n\tx: 1 10    100\n\ty: 0 0.01  0.05\n\tlabel: f_avg\n \tmarker: s\n \tls: --\n```\n\nResutls in:\n\n![result](test/test.svg)\n\n**Note:** as the image is an svg the rendering of it is browser dependent.\n\n## DSL Syntax\n\n| syntax | description |\n| :----- | :------  |\n|```plot```| create a new line plot|\n|```scatter```| create a new scatter plot|\n|```bar```| create a new bar plot  |\n|```x-axis```| parameters for the x axis |\n|```y-axis```| parameters for the y axis |\n|```label``` | label for axis or plot |\n|```x```| x values of a plot |\n|```y```| y values of a plot | \n|```color```| colour of a plot |  \n|```line-width``` or ```lw```| plot line width |\n|```line-style``` or ```ls```| plot line style ('--' or 'dashed', '-' or 'normal', ':' or dotted, '/' or 'none')|\n|```bar-width``` or ```bw``` | bar plot width|\n|```line-color```| bar plot line color |\n|```marker```| marker style of a plot ('o', 'x', '+', 's', ' ')|\n|```range```| min and max value for an axis |\n|```mode``` | axis mode ('linear' or 'log') |\n|```title```| plot title |\n|```width```| plot width |\n|```height```| plot height |\n|```csv://file_path#tag```| load a csv and use column ```tag``` as values |\n|```range: min max nstep```| linear range to use as values |\n|```logrange: min max nstep```| log range to use as values |\n|```math: f(x)```| math expression based on x to use as y value |\n\n**commas** and **spaces** are valid separator for arrays and the sytax in general.\nFor the definitions **spaces**, **tabs** and **:** are equivalents. So ```x: 1 2 3``` is equal to ```x 1,2,3```.\n\n## Use as a library\nif you want to include charter as a library here a simple example\n\n```c\n#include \"charter/parser.h\"\n#include \"charter/renderer.h\"\n\n\\***\n * YOUR CODE\n ***\\\n chart * parsed = parse_chart(string_to_parse);\n /* chart is the structure you can also create it programmatically in your code\n    and render it to svg using chart_to_svg */\n char * svg = chart_to_svg(parsed);\n chart_free(parsed);\n\\***\\\n```\n\n## Use as SVG generator\n\nThe build process generate as well an executable: ```charter```. It is capable of generate an svg plot from a charter dsl file:\n\n```\ncharter your_dsl_file \u003e output.svg\n```\n\n## Build and install\n\nUse ```meson``` and ```ninja```:\n\n```bash\nmkdir build\ncd build\nmeson ..\nninja \nsudo ninja install\n```\n## Future improvements\n\nIn the next future I will improve the svg quality, the memory performance, and the look and feel of the output plus the following features:\n \n - more options on grid\n - more styling options\n - better typesettings\n\n## Marker integration\nAt the moment _charter_ is integrated in [Marker](https://github.com/fabiocolacio/Marker/)!\n\n![marker and charter](marker_charter_support.png)\n\n## Credits\n\n - [csv_parser](https://github.com/JamesRamm/csv_parserhttps://github.com/JamesRamm/csv_parser) \n - [tinyexpr](https://github.com/codeplea/tinyexpr)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmandarancio%2Fcharter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmandarancio%2Fcharter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmandarancio%2Fcharter/lists"}