-
-
Notifications
You must be signed in to change notification settings - Fork 225
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
Add group labels in SVG for easier manipulation in Figma #3607
Comments
hi @danyx23, thanks for following up on this. currently there are some tasks that we do at first that would be nice if could be automated:
On this, I ran a session two months ago on the current process end-to-end when remixing charts for Instagram. We recorded the session. The first part of the session is invested in this cosmethic changes that are always there. More details on this here |
Hey @lucasrodes, I added labels to Grapher's SVG output that hopefully make it easier to manually edit our charts. Here is a staging site: http://staging-site-improve-for-figma/. Could you check it out and let me know if the labels are helpful?
I made an effort to group elements together that belong together. For example, such that a tick's line and a tick's label is rendered into the same group. Is this helpful?
We compute the dash pattern from the current font size. I played around with it but didn't really find a way to land on a 7-7 pattern for mobile that also looks good on desktop.
We could consider adding an option to the "Export" tab in the chart admin to move the OWID logo to the bottom, but it would be a bit of an effort :) |
hi @sophiamersmann, thanks for addressing this! After trying it out with this chart, I have some additional comments, that I wanted to share. These are not urgent, but just wanted to surface them. It is probably the case that I am missing some edge cases and that there are good reasons to keep things mostly as-are. But just sharing in case it is helpful. Again, these are by no means urgent, and the current implementation is already a nice improvement over previous versions. FooterIn the footer there are typically three elements:
(and optionally, also notes) I understand that moving the logo there is a bit tricky, so no rush in doing that. So that leaves us with just two element in most of the cases (source and origin url) and optionally, an additional one (notes). When looking at the structure I observe that we still have some nesting of folders, and that multi-line texts are broken down into multiple elements (e.g. with the source I think that it would be nicer if we did not have any folders, and just plain elements: the origin url, the note and the source name. HeaderSimilar thing occurs with the header as with the footer, where multi-line texts are broken down into multiple elements and there are still folders with single-elements (I've omitted the logo): I think we only need two text elements: 'title' and 'subtitle'. chart-area(1)
|
Hey @lucasrodes, thanks a lot for your detailed feedback! It's appreciated 🙏🏻
I wrongly assumed that it would be better to group all different elements of a tick or label together (e.g. the line label and the connecting line in one group). I reverted the changes that I made to that effect in the PR, and I created an issue to look into it in the future.
SVG doesn't have a concept of "overflowing content" and thus can't break text into lines automatically. Every SVG element is always absolutely positioned. It's unfortunately impossible to render multi-line text into a single SVG element :(
The groups or elements that you see in Figma that don't seem to have a purpose are often used for interactions (e.g. they have event listeners attached or they're present to catch mouse/touch events). Technically, we could omit these groups and elements when exporting a static version of the chart, but for easier maintainability, I would like the interactive version and the static version to be as similar as possible.
I removed the extra group :) Thanks again! |
When we prepare our charts for sharing them in Instagram or other social media platforms, we export SVG charts and then manually optimize them in Figma. When doing so, the structure of the SVG is often confusing. Adding labels to groups would be a simple measure that would make this much easier.
@lucasrodes are there any additional measures that would save you a lot of time? Some restructurings would probably be difficult to do in Grapher, but if you had a wishlist of bullet points of changes to our SVG structure - what would they be?
The text was updated successfully, but these errors were encountered: