UNPKG

@macrostrat/column-components

Version:

React rendering primitives for stratigraphic columns

71 lines (70 loc) 1.68 kB
"use strict"; const h = require("@macrostrat/hyper"); const _interopDefault = (e) => e && e.__esModule ? e : { default: e }; const h__default = /* @__PURE__ */ _interopDefault(h); const ArrowMarker = function({ id, orient, size: sz, fill }) { if (fill == null) { fill = "black"; } if (sz == null) { sz = 4; } return h__default.default( "marker", { id, orient, markerHeight: sz, markerWidth: sz, markerUnits: "strokeWidth", refX: "0", refY: "0", viewBox: `-${sz} -${sz} ${sz * 2} ${sz * 2}` }, [ h__default.default("path", { d: `M 0,0 m -${sz},-${sz} L ${sz},0 L -${sz},${sz} Z`, fill }) ] ); }; const EndpointTick = function({ id, fill, size: sz }) { if (fill == null) { fill = "black"; } if (sz == null) { sz = 4; } return h__default.default( "marker", { id, markerHeight: 2, markerWidth: sz * 2, markerUnits: "strokeWidth", refX: 0, refY: 0, viewBox: `-${sz} -1 ${sz * 2} 1` }, [ h__default.default("path", { d: `M -${sz},0 L ${sz},0`, fill: "transparent", stroke: fill }) ] ); }; const NoteDefs = function({ fill, prefix, size }) { if (prefix == null) { prefix = ""; } return h__default.default("defs", [ h__default.default(ArrowMarker, { id: prefix + "arrow_start", orient: 270, fill, size }), h__default.default(ArrowMarker, { id: prefix + "arrow_end", orient: 90, fill, size }), h__default.default(EndpointTick, { id: prefix + "tick", fill, size }) ]); }; module.exports = NoteDefs; //# sourceMappingURL=defs.cjs.map