Hiding elements in a diagram

后端 未结 1 408
慢半拍i
慢半拍i 2021-01-23 00:21

I have a read-only diagram to visualize some data. My end users would like to \"filter\" the data such that only a subset of the data may be shown at one time. I realize that

1条回答
  •  清歌不尽
    2021-01-23 01:01

    You can actually do the same with a JointJS diagram elements/links. For example:

    myElement.attr('./display', 'none')
    

    hides the whole SVG group element in which the element is rendered. Note the '.' is a special selector that points to the whole group. If you want to hide only a certain SVG subelement, you can do it similarly, e.g. for the joint.shapes.basic.Rect element, you'd do:

    myRect.attr('rect/display', 'none')
    

    This hides only the rectangle (the SVG element referenced by the tag name rect in the attrs object - that we modify via the attr() method.

    0 讨论(0)
提交回复
热议问题