projectstorm / react-diagrams

a super simple, no-nonsense diagramming library written in react that just works
https://projectstorm.cloud/react-diagrams
MIT License
8.71k stars 1.18k forks source link

Custom Link Demo 1 #686

Closed lieyongchang closed 4 years ago

lieyongchang commented 4 years ago

is there a Javascript version for this demo?

renato-bohler commented 4 years ago

Isn't it just the same, but removing type annotations?

lieyongchang commented 4 years ago

Like this (see below) ??

Typescript: path: SVGPathElement; circle: SVGCircleElement;

Javascript let path = new SVGPathElement(); let circle = new SVGCircleElement();

if so, according to the demo, SVGPathElement & SVGCircleElement is not imported. I have a feeling there will be error.

lieyongchang commented 4 years ago

Like this (see below) ??

Typescript: path: SVGPathElement; circle: SVGCircleElement;

Javascript let path = new SVGPathElement(); let circle = new SVGCircleElement();

if so, according to the demo, SVGPathElement & SVGCircleElement is not imported. I have a feeling there will be error.

Just in case for anyone who wants the Javascript version, this is the reference .

renato-bohler commented 4 years ago

Inside the class, you would have to remove path: SVGPathElement and all other class property type declarations. Something like this:

image

lieyongchang commented 4 years ago

Thanks for the clarification! at least now i have some idea.