rawgraphs / rawgraphs-app

A web interface to create custom vector-based visualizations on top of RAWGraphs core
https://rawgraphs.io
Apache License 2.0
8.68k stars 1.84k forks source link

SVG and PNG files won't validate in Illustrator and InDesign respectively #95

Closed margyavery closed 8 years ago

margyavery commented 8 years ago

Hi, this is an amazing tool and I'm excited to use it. I'd like to be able to modify the output however Illustrator and InDesign won't open the files citing validation issues. W3C markup validator suggests there's no character encoding declared at the document level. Help? thank you!

mikima commented 8 years ago

Can you please share the SVG? thanks!

margyavery commented 8 years ago

Apologies - just seeing this now. will upload asap.

On Feb 4, 2016, at 4:11 AM, mikima notifications@github.com wrote:

Can you please share the SVG? thanks!

— Reply to this email directly or view it on GitHub https://github.com/densitydesign/raw/issues/95#issuecomment-179722852.

margyavery commented 8 years ago

Hi, I cannot attach the .svg file but here's the PNG. I'm most interested in opening the .svg file in InDesign - let me know the best way to get you this file? thank you! ssrn-aarn

adrianbj commented 8 years ago

I have no problem "placing" the PNG into InDesign. Remember that InDesign won't directly open PNG files.

You should be able to post the SVG if you change the file extension to "txt" or archive to a zip first.

mikima commented 8 years ago

Yes, i suggerst you to upload a zip file containing the svg, like one i'm attaching as example. bump_chart.zip

margyavery commented 8 years ago

Thank you for your assistance on this more remedial stuff. I'm sure it's clear I'm more of a text person. Trying to visualize text. SSRN-aarn.txt.zip

adrianbj commented 8 years ago

It's an entity encoding issue. If you do a find and replace on: & with & the file will open just fine in Illustrator.

Here's a working version:

SSRN-aarn.svg.zip

mikima commented 8 years ago

@adrianbj thanks, that's the problem. If you use as label a string containing "&" it will create a broken SVG. To solve it, use @adrianbj solution (find and replace & with &)

e3krisztian commented 8 years ago

Does closing the issue mean this trivial looking bug will not be fixed?

I do not know enough javascript to fix it myself without burning away an uncomfortable amount of time, but searching through the code the fix should probably go here: https://github.com/densitydesign/raw/blob/e2e49992c576999380986c6858ceb29a274bcf71/js/directives.js#L511

adrianbj commented 8 years ago

I agree with @krisztianfekete - my "fix" was only meant to be a quick way for @margyavery to able to open the SVG.

margyavery commented 8 years ago

I actually don't know how to do complete the process you suggested without spending a good hour on it, unfortunately. Do i do this with code validator?

adrianbj commented 8 years ago

You can make the change by opening the SVG file in a simple text editor (not a Word Processor), and do a search/find and replace. You will find a button like "Replace All" or something similar which will replace all instances of & with & instantly, so will take you no time at all.

This is something that Raw needs to fix properly, so this is just meant to be a stopgap measure so you can open the files.

margyavery commented 8 years ago

Thank you for this information @adrianbj - much appreciated. :) This is an amazing tool!