質問

I want to draw some tokens (small circle) in the circle via jointjs, how can I do it ?

This code draw a circle with the text "token" and I want to replace "token" by a circle.

var place = 
new joint.shapes.basic.Circle({
    id:'place1',
    position: {x:100, y: 180},
    attrs: {circle: {fill: '#FFFFFF'}, text: {text:'TOKEN', fill:'#000000'}} 
        });
役に立ちましたか?

解決

This looks like a good candidate for the JointJS Petri Net shapes plugin (joint.shapes.pn.js). See a demo at: http://jointjs.com/demos/pn. You can download the plugin from here: http://jointjs.com/download. Then use:

var place = new joint.shapes.pn.Place({
    position: { x: 140, y: 50 },
    tokens: 1
});
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top