mysticsymbolic.github.io/lib
Atul Varma 6aba6b665f
Add mouseover tooltips with debugging information (#35)
This adds a bit of debugging information on mouseover.

For example, a tooltip with the text `bird@tail.arm[0]` can be interpreted as "a bird symbol attached to the tail symbol's first arm attachment point."

The implementation is a bit funky: we basically annotate the SVG DOM with various `data` attributes, and on mouseover we traverse the DOM from the element the mouse is over all the way up to the SVG root element, picking out relevant `data` attributes and building a tooltip out of it.  This ended up being easier than e.g. passing a bunch of props down the whole tree in React.
2021-02-27 13:28:44 -05:00
..
__snapshots__
pages Add mouseover tooltips with debugging information (#35) 2021-02-27 13:28:44 -05:00
attach.test.tsx
attach.tsx
auto-sizing-svg.tsx
bounding-box.test.ts
bounding-box.ts
browser-main.tsx
colors.ts
creature-symbol.tsx Add mouseover tooltips with debugging information (#35) 2021-02-27 13:28:44 -05:00
export-svg.tsx Factor out export-svg.tsx. 2021-02-27 08:43:31 -05:00
hover-debug-helper.tsx Add mouseover tooltips with debugging information (#35) 2021-02-27 13:28:44 -05:00
path.ts
point.test.tsx
point.ts
random.test.ts
random.ts
specs.ts Add mouseover tooltips with debugging information (#35) 2021-02-27 13:28:44 -05:00
svg-symbol-metadata.test.ts
svg-symbol-metadata.ts
svg-symbol.tsx Add mouseover tooltips with debugging information (#35) 2021-02-27 13:28:44 -05:00
svg-vocabulary.ts
symbol-context-widget.tsx
util.test.tsx
util.ts
visible-specs.tsx Add mouseover tooltips with debugging information (#35) 2021-02-27 13:28:44 -05:00
vocabulary-builder.test.ts
vocabulary-builder.ts