Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SVG Grid Visualization #12

Open
ssegrubdivad opened this issue May 29, 2023 · 4 comments
Open

SVG Grid Visualization #12

ssegrubdivad opened this issue May 29, 2023 · 4 comments

Comments

@ssegrubdivad
Copy link

ssegrubdivad commented May 29, 2023

What's the problem this feature will solve?

The current grid visualization uses HTML5 Canvas which rasterizes elements. This means that when using visualizations in publications or presentations there are image resolution and quality limits.

Describe the solution you'd like

A grid visualization based in SVG would permit the creation of vector-based visualizations of models.

Additional context

I have created two working files (SVGGridModule.js and SVGGridVisualization.py) that currently perform well on my system, but I would like additional testing and input/recommendations related to functionality. One feature of my work is a simple shift-click download that permits the user to easily access a complete .svg capture of a current state of the model visualization. This .svg file can be easily converted to PDF (using Inkscape or similar applications) for use in high-resolution publications, printing, and presentations without loss due to rasterizing.

@rht
Copy link
Contributor

rht commented May 29, 2023

I'd need to take a look at the SVGGridModule.js implementation to see if this can replace the current implementation in the library.

@ssegrubdivad
Copy link
Author

Understood. I have pushed these within my fork at mesa/visualization/templates/js and mesa/visualization/modules. Any feedback would be greatly appreciated.

@ssegrubdivad
Copy link
Author

Also, to be clear, I don't think that I'm asking for a replacement of the current implementation. Just an additional option.

ssegrubdivad referenced this issue in ssegrubdivad/mesa May 30, 2023
@Corvince
Copy link

Also, to be clear, I don't think that I'm asking for a replacement of the current implementation. Just an additional option.

From your motivation to do this it sounds like I see no reason why this should not replace CanvasGrid. I mean in general, I haven't looked into your code, but I think it wouldn't make sense to have two grid implementations.
SVG can also be styled through css, which is another advantage.

@rht rht transferred this issue from projectmesa/mesa Sep 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants