Closed thomastay closed 7 months ago
Incredible! I've been after something like this for so long. Would it be possible to support Sankey chart options and configs too?
@GoodnessJSON whatever is in the settings in the downloaded file is in the URL too, the compressor just takes that file and compresses it down. It should have all the settings for the chart. If not, please make another PR
@thomastay @GoodnessJSON whatever is in the settings in the downloaded file is in the URL too, the compressor just takes that file and compresses it down. It should have all the settings for the chart. If not, please make another PR
Amazing. I don't think I'm up to the level of doing this, but just want to appreciate what you've done. Hope this gets merged in as it would be incredibly handy.
My only other consideration would be if it was user readable parameters then perhaps the diagram could be artificially constructed externally. But I understand that's likely a limitation of the library trying to compress it all down.
Cool, thanks @thomastay. I should be able to review & incorporate this in the next 7 days.
I've had a chance to look this over. It's good so far. There are a few things I'm working on adding/modifying before I merge:
Making progress. All 3 of the topics I mentioned above are addressed now. I should be ready to promote the feature to the site in the next 2 days.
This is the current state of the popup I'm preparing for when the user clicks 'Get a link...':
Looks good, i like the popup actually. I personally have not thought about the privacy aspect and am glad you decided to highlight this.
As discussed in #18, created a first-cut implementation using LZString. I think LZString is smaller bundle size than pako, which is a full-fledged implementation of zlib. Didn't benchmark, though. I didn't have time to optimize the CSS so would appreciate help there.
Features:
input
URLSearchParam is there, it loads the existing diagram.Screenshot:![image](https://github.com/nowthis/sankeymatic/assets/7616132/4c65d962-9c03-4960-a1d7-3b4bda94f59d)
The URL would look like this:
http://sankeymatic.com/build/?input=PTAEGUEMDsGsFMCeBZAggFQJIGFQBMBLSAcwCdIBbUA6ABwFcAXAZ1AFoJIA3ePALlABGACzBBg4ACYADJIDMAGlAB2PpICsfdYNC0KAKBCgAFo0a1mfEMxgJEFSIwIBjAHTOA9hWAAjegQAbPGB9QzAAXkjQADkPPHhWGDxQADEAjwB3Vkjw0Oj4Rk4AhNAAbUlxSQBdUAAleB5oenh9AHUPUlgaYlBsSFoCRkgAsoAOUZr6xub9ABF4WlJ4ZyInD2gy4QBOSYb4JpbkAmZnMuVd6ZbwRg9nWFBUDMhSPFZSuQv9mf0pr-gywTqYTCGrY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