Giter Club home page Giter Club logo

Comments (7)

StoneCypher avatar StoneCypher commented on June 3, 2024 1

This is now implemented in jssm-viz and the cli is mostly done

The github action is also mostly done

from jssm.

StoneCypher avatar StoneCypher commented on June 3, 2024

the mechanism is dot_to_string in jssm-viz

you can see it in use in graph explorer in the svg button on the top edge of the editor window

i'm sorry it took me so long to notice these, @sunwukonga

from jssm.

StoneCypher avatar StoneCypher commented on June 3, 2024

i haven't actually tried this in node actually

svg_el would need a dom (which you could supplement with jsdom) but dot_to_string(dot( /*graph*/ )) shouldn't

i believe that should Just Work ™

I'll try to get a tutorial together on this this weekend (no promises)

from jssm.

StoneCypher avatar StoneCypher commented on June 3, 2024

hm

it looks like i actually took a stab at this a year ago

at the moment node's just up and dying when you load the bundle

that said the author expects this to work in node, and has examples. i'll see if i can figure out what the difference is

mdaines/viz-js#161

from jssm.

StoneCypher avatar StoneCypher commented on June 3, 2024

Okay.

It's not really ready for prime time, but, there is now a cli that can consume fsl and produce svg on disk.

It only produces them in the same location as the source right now (there's a bunch of command line options to change that but they're not honored yet)

It doesn't do any of the other image formats yet

But it does work

from jssm.

StoneCypher avatar StoneCypher commented on June 3, 2024

I just realized you want the SVG in your app, not as a CLI

That's also implemented in there

const svg_code = await fsl_to_svg_string(fsl_code);

I need to document this but I'm closing the issue because I believe it to be complete

If that's not correct, please re-open it and/or tag me

from jssm.

StoneCypher avatar StoneCypher commented on June 3, 2024

Actually, there's a live instance of jssm-viz bound to window on graph explorer, so you can just open a developer console and try it there

const viz = window.jssm_viz;
await viz.fsl_to_svg_string('this => is -> an ~> example;');

image

works in node too

image

from jssm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.