@doenet/doenetml 0.7.25-dev.507 → 0.7.25-dev.508
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{AnswerResponseButton-CtqKA20c.js → AnswerResponseButton-cEdq4RZO.js} +2 -2
- package/{Description-DfuIwBpF.js → Description-9xkiCcAk.js} +1 -1
- package/{DynamicMath-MXYV2Z9s.js → DynamicMath-Bmg5p72t.js} +1 -1
- package/{EditorViewer-CgJ46gDZ.js → EditorViewer-BUzTzRpa.js} +6 -6
- package/{GraphFrame-B_WIM5Fa.js → GraphFrame-BBe_OHun.js} +2 -2
- package/{JSXGraphRenderer-D6iPo1FB.js → JSXGraphRenderer-D-h7eH-Q.js} +1 -1
- package/{NonInlineMediaWrapper-Ddzb1tjn.js → NonInlineMediaWrapper-DqF3Wxsr.js} +1 -1
- package/Viewer/renderers/legend.d.ts.map +1 -1
- package/{_error-DJ8idE9P.js → _error-xoPS4ylR.js} +2 -2
- package/{alert-Dg_JJZaI.js → alert-Bd-rOjK5.js} +3 -3
- package/{angle-BBttztM-.js → angle-ByHQbkot.js} +7 -7
- package/{answer-Dr2sqqfc.js → answer-C7iWerJU.js} +6 -6
- package/{asList-CGpwUZ9I.js → asList-D5Rmgn6J.js} +2 -2
- package/{blockQuote-LOCNH0lp.js → blockQuote-DytO_fho.js} +3 -3
- package/{boolean-D8I4O_iy.js → boolean-CHkxx77b.js} +2 -2
- package/{booleanInput-C5IVX59c.js → booleanInput-C7X8yxsi.js} +6 -6
- package/{br-BVVK8kVv.js → br-BAqzBJXy.js} +2 -2
- package/{button-DF_UHrT2.js → button-Bx5TNS-p.js} +4 -4
- package/{c-RBY7uyc3.js → c-8yJmTtwG.js} +3 -3
- package/{cell-C0bjjzLU.js → cell-CfF5x6ah.js} +3 -3
- package/{choiceInput-CHRv9fJO.js → choiceInput-CP_MrBMk.js} +4 -4
- package/{circle-DXj8GT6s.js → circle-DuJCg1NM.js} +6 -6
- package/{cobwebPolyline-Bbvw_Prm.js → cobwebPolyline-C_8dB69b.js} +4 -4
- package/{codeEditor-Dda818hM.js → codeEditor-BOlD1E56.js} +2 -2
- package/{composites-B7gjrcIm.js → composites-CSSw1VLF.js} +1 -1
- package/{containerBlock-DkAni0TI.js → containerBlock-BcrzJRO5.js} +4 -4
- package/{containerInline-DlAWnUee.js → containerInline-B2CNSZKZ.js} +4 -4
- package/{curve-HYrKNUaq.js → curve-DhoP5Bw3.js} +4 -4
- package/{doenetml-u1YndSm7.js → doenetml-D-MlvjpX.js} +3 -3
- package/doenetml-external-worker.js +2 -2
- package/doenetml-inline-worker.js +4 -4
- package/doenetml-worker/index.esm.js +1 -1
- package/doenetml-worker/index.js +1 -1
- package/doenetml-worker/lib_doenetml_worker_bg.wasm +0 -0
- package/{ellipsis-CGWbjf4O.js → ellipsis-BLIkiXMS.js} +2 -2
- package/{em-0urWJrEp.js → em-DRpem1-2.js} +3 -3
- package/{embed-Dh_KMrqC.js → embed-rqTRzFAq.js} +2 -2
- package/{feedback-lbIB9yRs.js → feedback-Cllga3c8.js} +4 -4
- package/{figure-DURZ6MUy.js → figure-g0KPrh2g.js} +3 -3
- package/{fillPatterns-CiqcTsVU.js → fillPatterns-Bkcc1kgf.js} +1 -1
- package/{footnote-B7xEbVoh.js → footnote-NbaFHPVN.js} +3 -3
- package/{fractionInput-CcM3yQ6H.js → fractionInput-CDrDh9Fv.js} +4 -4
- package/{graph-8Ybpt4il.js → graph-DEJxLN7s.js} +6 -6
- package/{hint-dTCFBf4b.js → hint-DrALFzMS.js} +4 -4
- package/{hovercard-store-BGkBLOUR.js → hovercard-store-C6w9Xi6E.js} +1 -1
- package/{hr-KjzPCylH.js → hr-D60yVJF8.js} +2 -2
- package/{image-BY2kWQDS.js → image-D2AAKAkE.js} +7 -7
- package/{index-DTp6nKt2.js → index-jxUM0uwb.js} +1 -1
- package/{index.es-CVZDHLHO.js → index.es-BZY0c1t3.js} +1 -1
- package/index.js +1 -1
- package/{label-BtGqQYDT.js → label-C9mDUeLa.js} +7 -7
- package/{labelWithLatex-D3pZxBkq.js → labelWithLatex-BVYdTe81.js} +2 -2
- package/legend-C6fv77U1.js +437 -0
- package/{line-B-8MvE7D.js → line-D70Ga1ZR.js} +7 -7
- package/{lineFamilyDragHandlers-Bq8re2Ed.js → lineFamilyDragHandlers-Bcg80hj8.js} +1 -1
- package/{lineSegment-DJD3nVc9.js → lineSegment-CY56NKgL.js} +5 -5
- package/{list-Db6KRvBk.js → list-ByHyqkne.js} +4 -4
- package/{lq-B4KrrgWc.js → lq-BsjmRGG-.js} +2 -2
- package/{lsq-BeihCm4v.js → lsq-Coc4hkoA.js} +2 -2
- package/{markupRenderer-7jFjXtsT.js → markupRenderer-DACpRdKz.js} +1 -1
- package/{math-x6xu20vw.js → math-BuIKoKOy.js} +7 -7
- package/{mathInput-CdpOR3tk.js → mathInput-qYk3ZYyj.js} +7 -7
- package/{matrixInput-WxwT7tYN.js → matrixInput-BN8rvPJ1.js} +4 -4
- package/{mdash-LMwfFv_m.js → mdash-DY8x56Gi.js} +2 -2
- package/{nbsp-B0-mrSk5.js → nbsp-CXbufv9K.js} +2 -2
- package/{ndash-Cfw6anMG.js → ndash-fuyshFxl.js} +2 -2
- package/{number-7lcbkhYE.js → number-Eb5VzM_3.js} +7 -7
- package/{orbitalDiagram-DWKurxgW.js → orbitalDiagram-DH3M6stA.js} +2 -2
- package/{orbitalDiagramInput-B014S41N.js → orbitalDiagramInput-Dp9_SsaS.js} +2 -2
- package/{p-B14UxMHP.js → p-C-ElLn48.js} +4 -4
- package/package.json +1 -1
- package/{paginatorControls-Qrptmean.js → paginatorControls-CsvOFtmD.js} +2 -2
- package/{pegboard-D9dk47VA.js → pegboard-DykTEm7O.js} +4 -4
- package/{point-ByStthGH.js → point-B2E2eTId.js} +7 -7
- package/{polygon-qGW-bKQw.js → polygon-CMbtwfIV.js} +6 -6
- package/{polyline-s5TCnP7t.js → polyline-C3B4nNLP.js} +5 -5
- package/{pre-vKUqNf3r.js → pre-Bz1ObVxi.js} +3 -3
- package/{prefigure-5X9DVBfV.js → prefigure-CjSd_o5R.js} +1 -1
- package/{pretzel-BOxrLmzQ.js → pretzel-CUqywVnZ.js} +4 -4
- package/{q-DeY9kaHW.js → q-CfaZ9Q4M.js} +3 -3
- package/{ray-DbYRpWOe.js → ray-BHE803z-.js} +5 -5
- package/{ref-DrK-Ea1E.js → ref-XzKSEd_P.js} +2 -2
- package/{regionBetweenCurveXAxis-BFuIu9WS.js → regionBetweenCurveXAxis-Cene1PWc.js} +5 -5
- package/{regionBetweenCurves-BDSV5pAv.js → regionBetweenCurves-UUj2tPjD.js} +5 -5
- package/{row-BLHRD33U.js → row-AdEMsZm3.js} +2 -2
- package/{rq-CrBdSxfp.js → rq-DpsoAxFh.js} +2 -2
- package/{rsq-7g2LSCpC.js → rsq-BUIvQK49.js} +2 -2
- package/{section-jYCdH-Aa.js → section-DFB_LR6S.js} +5 -5
- package/{sha256-DT5xJ2Hv-aw2L9wQT.js → sha256-DT5xJ2Hv-CQavxI1o.js} +1 -1
- package/{sideBySide-CnztT9JG.js → sideBySide-BpVt_Czj.js} +2 -2
- package/{slider-BpDumYmt.js → slider-H18xbWk7.js} +3 -3
- package/{slopeField-BIi2Gqgu.js → slopeField-CKdArhAk.js} +2 -2
- package/{solution-B1vv-4wl.js → solution-Du-CeIET.js} +4 -4
- package/{spreadsheet-DVGxaJ12.js → spreadsheet-CMoTjyKf.js} +2 -2
- package/{sq-CjiGjXUE.js → sq-CVP4ayps.js} +3 -3
- package/{subsetOfRealsInput-DlDQbv1v.js → subsetOfRealsInput-cxMNVNKR.js} +2 -2
- package/{summaryStatistics-CnJBRB-2.js → summaryStatistics-C3s88_nN.js} +2 -2
- package/{table-BzSa1HfY.js → table-C_FNmcaC.js} +2 -2
- package/{tabular-BgoXaZGa.js → tabular-Bx24zu-e.js} +2 -2
- package/{tag-01PSjwFf.js → tag-DaUHHQR-.js} +2 -2
- package/{text-BxPZX-K3.js → text-Bwv6foAp.js} +6 -6
- package/{textInput-sJQiLyIq.js → textInput-ngbf4QtZ.js} +6 -6
- package/{tooltip-provider-DGFLtEVi.js → tooltip-provider-srILFzBI.js} +2 -2
- package/{useAnchoredGraphDragHandler-BFxdkMVn.js → useAnchoredGraphDragHandler-DxzKZzL0.js} +1 -1
- package/useDoenetRenderer-UyWCNuKB.js +114 -0
- package/{useFieldCurve-D2aEaoKQ.js → useFieldCurve-BeALHbXl.js} +2 -2
- package/{useSubmitActionWithDelay-DUYvY61i.js → useSubmitActionWithDelay-Dlm36ClP.js} +2 -2
- package/{vector-pTEAgwh0.js → vector-DWL6PO2D.js} +7 -7
- package/{vectorField-Cs8RmjI1.js → vectorField-DgzpZYlm.js} +2 -2
- package/{video-BX46joJU.js → video-OMWIgpoH.js} +4 -4
- package/legend-D_nZziIf.js +0 -347
- package/useDoenetRenderer-CUfcSgne.js +0 -114
|
Binary file
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { q as jsxRuntimeExports } from "./doenetml-
|
|
1
|
+
import { q as jsxRuntimeExports } from "./doenetml-D-MlvjpX.js";
|
|
2
2
|
import React__default from "react";
|
|
3
|
-
import { u as useDoenetRenderer } from "./useDoenetRenderer-
|
|
3
|
+
import { u as useDoenetRenderer } from "./useDoenetRenderer-UyWCNuKB.js";
|
|
4
4
|
const ellipsis = React__default.memo(function Ellipsis(props) {
|
|
5
5
|
let { id, SVs } = useDoenetRenderer(props);
|
|
6
6
|
if (SVs.hidden) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { q as jsxRuntimeExports } from "./doenetml-
|
|
1
|
+
import { q as jsxRuntimeExports } from "./doenetml-D-MlvjpX.js";
|
|
2
2
|
import React__default from "react";
|
|
3
|
-
import { u as useDoenetRenderer } from "./useDoenetRenderer-
|
|
4
|
-
import { r as renderMarkupBody } from "./markupRenderer-
|
|
3
|
+
import { u as useDoenetRenderer } from "./useDoenetRenderer-UyWCNuKB.js";
|
|
4
|
+
import { r as renderMarkupBody } from "./markupRenderer-DACpRdKz.js";
|
|
5
5
|
const em = React__default.memo(function Em(props) {
|
|
6
6
|
const { id, SVs, children } = useDoenetRenderer(props);
|
|
7
7
|
const body = renderMarkupBody({ SVs, children });
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { G as useRecordVisibilityChanges, q as jsxRuntimeExports } from "./doenetml-
|
|
1
|
+
import { G as useRecordVisibilityChanges, q as jsxRuntimeExports } from "./doenetml-D-MlvjpX.js";
|
|
2
2
|
import React__default, { useRef, useEffect } from "react";
|
|
3
|
-
import { u as useDoenetRenderer } from "./useDoenetRenderer-
|
|
3
|
+
import { u as useDoenetRenderer } from "./useDoenetRenderer-UyWCNuKB.js";
|
|
4
4
|
import { s as sizeToCSS } from "./css-BJLDLYRJ.js";
|
|
5
5
|
const embed = React__default.memo(function Embed(props) {
|
|
6
6
|
let { id, SVs, actions, callAction } = useDoenetRenderer(props);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { u as useT, v as useChromeLangDir, G as useRecordVisibilityChanges, q as jsxRuntimeExports } from "./doenetml-
|
|
1
|
+
import { u as useT, v as useChromeLangDir, G as useRecordVisibilityChanges, q as jsxRuntimeExports } from "./doenetml-D-MlvjpX.js";
|
|
2
2
|
import React__default, { useRef } from "react";
|
|
3
|
-
import { u as useDoenetRenderer } from "./useDoenetRenderer-
|
|
4
|
-
import { F as FontAwesomeIcon } from "./index.es-
|
|
3
|
+
import { u as useDoenetRenderer } from "./useDoenetRenderer-UyWCNuKB.js";
|
|
4
|
+
import { F as FontAwesomeIcon } from "./index.es-BZY0c1t3.js";
|
|
5
5
|
import { f as faComment } from "./index-CwWLcRpc.js";
|
|
6
|
-
import { a as addCommasForCompositeRanges } from "./composites-
|
|
6
|
+
import { a as addCommasForCompositeRanges } from "./composites-CSSw1VLF.js";
|
|
7
7
|
const feedback = React__default.memo(function Feedback(props) {
|
|
8
8
|
let { id, SVs, children, actions, callAction } = useDoenetRenderer(props);
|
|
9
9
|
const t = useT();
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { G as useRecordVisibilityChanges, q as jsxRuntimeExports } from "./doenetml-
|
|
1
|
+
import { G as useRecordVisibilityChanges, q as jsxRuntimeExports } from "./doenetml-D-MlvjpX.js";
|
|
2
2
|
import React__default, { createElement, Component, useRef, useState } from "react";
|
|
3
|
-
import { u as useDoenetRenderer } from "./useDoenetRenderer-
|
|
3
|
+
import { u as useDoenetRenderer } from "./useDoenetRenderer-UyWCNuKB.js";
|
|
4
4
|
import { _ as _setPrototypeOf, a as _objectWithoutPropertiesLoose, b as _extends } from "./setPrototypeOf-C-47lAIH.js";
|
|
5
|
-
import { P as PropTypes } from "./index-
|
|
5
|
+
import { P as PropTypes } from "./index-jxUM0uwb.js";
|
|
6
6
|
import { a as getBlockMarginWithOptionalTopSuppression } from "./nonInlineMediaLayout-CkXHaqzo.js";
|
|
7
7
|
function _inheritsLoose(t, o) {
|
|
8
8
|
t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { E as encodeFillPatternColorToken } from "./doenetml-
|
|
1
|
+
import { E as encodeFillPatternColorToken } from "./doenetml-D-MlvjpX.js";
|
|
2
2
|
const warnedUnsupportedFillStyles = /* @__PURE__ */ new Set();
|
|
3
3
|
function warnUnsupportedFillStyle(fillStyle) {
|
|
4
4
|
if (warnedUnsupportedFillStyles.has(fillStyle)) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { u as useT, q as jsxRuntimeExports, L as Button } from "./doenetml-
|
|
1
|
+
import { u as useT, q as jsxRuntimeExports, L as Button } from "./doenetml-D-MlvjpX.js";
|
|
2
2
|
import React__default, { useState } from "react";
|
|
3
|
-
import { u as useDoenetRenderer } from "./useDoenetRenderer-
|
|
4
|
-
import { T as TooltipProvider, a as TooltipAnchor, b as Tooltip } from "./tooltip-provider-
|
|
3
|
+
import { u as useDoenetRenderer } from "./useDoenetRenderer-UyWCNuKB.js";
|
|
4
|
+
import { T as TooltipProvider, a as TooltipAnchor, b as Tooltip } from "./tooltip-provider-srILFzBI.js";
|
|
5
5
|
const footnote = React__default.memo(function Footnote(props) {
|
|
6
6
|
let { id, SVs } = useDoenetRenderer(props, false);
|
|
7
7
|
let [isVisible, setIsVisible] = useState(false);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { F as useContentT, q as jsxRuntimeExports, T as MathJax } from "./doenetml-
|
|
1
|
+
import { F as useContentT, q as jsxRuntimeExports, T as MathJax } from "./doenetml-D-MlvjpX.js";
|
|
2
2
|
import React__default, { useRef } from "react";
|
|
3
|
-
import { u as useDoenetRenderer } from "./useDoenetRenderer-
|
|
3
|
+
import { u as useDoenetRenderer } from "./useDoenetRenderer-UyWCNuKB.js";
|
|
4
4
|
/* empty css */
|
|
5
|
-
import { c as calculateValidationState, u as useSubmitActionWithDelay, a as createCheckWorkComponent } from "./useSubmitActionWithDelay-
|
|
5
|
+
import { c as calculateValidationState, u as useSubmitActionWithDelay, a as createCheckWorkComponent } from "./useSubmitActionWithDelay-Dlm36ClP.js";
|
|
6
6
|
import { a as addValidationStateToShortDescription } from "./validationState-DI_lxk1a.js";
|
|
7
|
-
import { D as DescriptionPopover } from "./Description-
|
|
7
|
+
import { D as DescriptionPopover } from "./Description-9xkiCcAk.js";
|
|
8
8
|
const fractionInput = React__default.memo(function FractionInput(props) {
|
|
9
9
|
let { id, SVs, actions, children, callAction } = useDoenetRenderer(props);
|
|
10
10
|
const tContent = useContentT();
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { q as jsxRuntimeExports, aM as roundForDisplay, H as Context, G as useRecordVisibilityChanges } from "./doenetml-
|
|
1
|
+
import { q as jsxRuntimeExports, aM as roundForDisplay, H as Context, G as useRecordVisibilityChanges } from "./doenetml-D-MlvjpX.js";
|
|
2
2
|
import React__default, { useState, useRef, useEffect, useMemo, createContext } from "react";
|
|
3
|
-
import { u as useDoenetRenderer } from "./useDoenetRenderer-
|
|
4
|
-
import Prefigure from "./prefigure-
|
|
5
|
-
import { a as accessibleLabelText, r as renderLabelWithLatex } from "./labelWithLatex-
|
|
6
|
-
import GraphFrame from "./GraphFrame-
|
|
7
|
-
import { J as JSXGraphRenderer } from "./JSXGraphRenderer-
|
|
3
|
+
import { u as useDoenetRenderer } from "./useDoenetRenderer-UyWCNuKB.js";
|
|
4
|
+
import Prefigure from "./prefigure-CjSd_o5R.js";
|
|
5
|
+
import { a as accessibleLabelText, r as renderLabelWithLatex } from "./labelWithLatex-BVYdTe81.js";
|
|
6
|
+
import GraphFrame from "./GraphFrame-BBe_OHun.js";
|
|
7
|
+
import { J as JSXGraphRenderer } from "./JSXGraphRenderer-D-h7eH-Q.js";
|
|
8
8
|
const GRAPH_CONTROL_CARD_STYLE = {
|
|
9
9
|
width: "100%",
|
|
10
10
|
boxSizing: "border-box",
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { u as useT, G as useRecordVisibilityChanges, v as useChromeLangDir, q as jsxRuntimeExports } from "./doenetml-
|
|
1
|
+
import { u as useT, G as useRecordVisibilityChanges, v as useChromeLangDir, q as jsxRuntimeExports } from "./doenetml-D-MlvjpX.js";
|
|
2
2
|
import React__default, { useRef } from "react";
|
|
3
|
-
import { u as useDoenetRenderer } from "./useDoenetRenderer-
|
|
4
|
-
import { F as FontAwesomeIcon } from "./index.es-
|
|
3
|
+
import { u as useDoenetRenderer } from "./useDoenetRenderer-UyWCNuKB.js";
|
|
4
|
+
import { F as FontAwesomeIcon } from "./index.es-BZY0c1t3.js";
|
|
5
5
|
import { b as faLightbulb } from "./index-BDlitCgu.js";
|
|
6
6
|
import { a as faLightbulb$1 } from "./index-CwWLcRpc.js";
|
|
7
|
-
import { a as addCommasForCompositeRanges } from "./composites-
|
|
7
|
+
import { a as addCommasForCompositeRanges } from "./composites-CSSw1VLF.js";
|
|
8
8
|
import { c as clickToToggleLabel } from "./disclosure-axyZa36E.js";
|
|
9
9
|
const hint = React__default.memo(function Hint(props) {
|
|
10
10
|
let { id, SVs, children, actions, callAction } = useDoenetRenderer(props);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ae as createStoreContext, aq as PopoverScopedContextProvider, ar as PopoverContextProvider, $ as createHook, a1 as invariant, as as usePortalRef, at as useIsMouseMoving, au as useBooleanEvent, a2 as useStoreState, ak as chain, av as addGlobalEventListener, aw as useLiveRef, a7 as useSafeLayoutEffect, ag as useWrapElement, q as jsxRuntimeExports, a5 as useMergeRefs, ax as usePopover, ah as isFalsyBooleanCallback, al as useEvent, aj as sync, ay as hasFocusWithin, af as createDialogComponent, Y as forwardRef, Z as createElement, az as disabledFromProps, aA as useFocusable, aB as createPopoverStore, an as defaultValue, am as createStore, ap as useStoreProps, aC as usePopoverStoreProps } from "./doenetml-
|
|
1
|
+
import { ae as createStoreContext, aq as PopoverScopedContextProvider, ar as PopoverContextProvider, $ as createHook, a1 as invariant, as as usePortalRef, at as useIsMouseMoving, au as useBooleanEvent, a2 as useStoreState, ak as chain, av as addGlobalEventListener, aw as useLiveRef, a7 as useSafeLayoutEffect, ag as useWrapElement, q as jsxRuntimeExports, a5 as useMergeRefs, ax as usePopover, ah as isFalsyBooleanCallback, al as useEvent, aj as sync, ay as hasFocusWithin, af as createDialogComponent, Y as forwardRef, Z as createElement, az as disabledFromProps, aA as useFocusable, aB as createPopoverStore, an as defaultValue, am as createStore, ap as useStoreProps, aC as usePopoverStoreProps } from "./doenetml-D-MlvjpX.js";
|
|
2
2
|
import { useRef, useCallback, useEffect, useContext, createContext, useState } from "react";
|
|
3
3
|
const ctx = createStoreContext([PopoverContextProvider], [PopoverScopedContextProvider]);
|
|
4
4
|
const useHovercardProviderContext = ctx.useProviderContext;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { q as jsxRuntimeExports } from "./doenetml-
|
|
1
|
+
import { q as jsxRuntimeExports } from "./doenetml-D-MlvjpX.js";
|
|
2
2
|
import React__default from "react";
|
|
3
|
-
import { u as useDoenetRenderer } from "./useDoenetRenderer-
|
|
3
|
+
import { u as useDoenetRenderer } from "./useDoenetRenderer-UyWCNuKB.js";
|
|
4
4
|
const hr = React__default.memo(function Hr(props) {
|
|
5
5
|
let { id, SVs } = useDoenetRenderer(props);
|
|
6
6
|
if (SVs.hidden) {
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { A as DocContext, G as useRecordVisibilityChanges, H as Context, q as jsxRuntimeExports, g as getMediaLicenseDisplay } from "./doenetml-
|
|
1
|
+
import { A as DocContext, G as useRecordVisibilityChanges, H as Context, q as jsxRuntimeExports, g as getMediaLicenseDisplay } from "./doenetml-D-MlvjpX.js";
|
|
2
2
|
import React__default, { useContext, useRef, useMemo } from "react";
|
|
3
|
-
import { j as jxg } from "./JSXGraphRenderer-
|
|
4
|
-
import { BoardContext, IMAGE_LAYER_OFFSET } from "./graph-
|
|
5
|
-
import { u as useDoenetRenderer } from "./useDoenetRenderer-
|
|
3
|
+
import { j as jxg } from "./JSXGraphRenderer-D-h7eH-Q.js";
|
|
4
|
+
import { BoardContext, IMAGE_LAYER_OFFSET } from "./graph-DEJxLN7s.js";
|
|
5
|
+
import { u as useDoenetRenderer } from "./useDoenetRenderer-UyWCNuKB.js";
|
|
6
6
|
import { s as sizeToCSS } from "./css-BJLDLYRJ.js";
|
|
7
|
-
import { D as DescriptionPopover, a as DescriptionAsDetails } from "./Description-
|
|
7
|
+
import { D as DescriptionPopover, a as DescriptionAsDetails } from "./Description-9xkiCcAk.js";
|
|
8
8
|
import { g as getNonInlineMediaLayoutStyles } from "./nonInlineMediaLayout-CkXHaqzo.js";
|
|
9
|
-
import { N as NonInlineMediaWrapper } from "./NonInlineMediaWrapper-
|
|
9
|
+
import { N as NonInlineMediaWrapper } from "./NonInlineMediaWrapper-DqF3Wxsr.js";
|
|
10
10
|
import { u as usePointerDragState, a as useBoardPointerTracking } from "./useBoardPointerTracking-DV6a8Wvg.js";
|
|
11
11
|
import { u as useDraggableRefs } from "./useDraggableRefs-QaTfkVuD.js";
|
|
12
|
-
import { d as detachAnchoredGraphElement, a as attachAnchoredGraphDragHandlers } from "./useAnchoredGraphDragHandler-
|
|
12
|
+
import { d as detachAnchoredGraphElement, a as attachAnchoredGraphDragHandlers } from "./useAnchoredGraphDragHandler-DxzKZzL0.js";
|
|
13
13
|
import { u as useJSXGraphCleanup } from "./useJSXGraphCleanup-BNk4sn6x.js";
|
|
14
14
|
const image = React__default.memo(function Image(props) {
|
|
15
15
|
let { componentIdx, id, SVs, children, actions, callAction } = useDoenetRenderer(props, false);
|
package/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { A as DocContext, H as Context, q as jsxRuntimeExports, B as textRendererStyle } from "./doenetml-
|
|
1
|
+
import { A as DocContext, H as Context, q as jsxRuntimeExports, B as textRendererStyle } from "./doenetml-D-MlvjpX.js";
|
|
2
2
|
import React__default, { useRef, useContext } from "react";
|
|
3
|
-
import { j as jxg, c as computeLabelMaskCssStyle } from "./JSXGraphRenderer-
|
|
4
|
-
import { BoardContext, TEXT_LAYER_OFFSET } from "./graph-
|
|
5
|
-
import { u as useDoenetRenderer } from "./useDoenetRenderer-
|
|
6
|
-
import { D as DynamicMath } from "./DynamicMath-
|
|
3
|
+
import { j as jxg, c as computeLabelMaskCssStyle } from "./JSXGraphRenderer-D-h7eH-Q.js";
|
|
4
|
+
import { BoardContext, TEXT_LAYER_OFFSET } from "./graph-DEJxLN7s.js";
|
|
5
|
+
import { u as useDoenetRenderer } from "./useDoenetRenderer-UyWCNuKB.js";
|
|
6
|
+
import { D as DynamicMath } from "./DynamicMath-Bmg5p72t.js";
|
|
7
7
|
import { g as getPositionFromAnchorByCoordinate } from "./graph-W6vrFcBu.js";
|
|
8
|
-
import { ChoiceInputInlineContext } from "./choiceInput-
|
|
8
|
+
import { ChoiceInputInlineContext } from "./choiceInput-CP_MrBMk.js";
|
|
9
9
|
import { u as usePointerDragState, a as useBoardPointerTracking } from "./useBoardPointerTracking-DV6a8Wvg.js";
|
|
10
10
|
import { u as useDraggableRefs } from "./useDraggableRefs-QaTfkVuD.js";
|
|
11
|
-
import { d as detachAnchoredGraphElement, a as attachAnchoredGraphDragHandlers } from "./useAnchoredGraphDragHandler-
|
|
11
|
+
import { d as detachAnchoredGraphElement, a as attachAnchoredGraphDragHandlers } from "./useAnchoredGraphDragHandler-DxzKZzL0.js";
|
|
12
12
|
import { u as useJSXGraphCleanup } from "./useJSXGraphCleanup-BNk4sn6x.js";
|
|
13
13
|
const label = React__default.memo(function Label(props) {
|
|
14
14
|
let { componentIdx, id, SVs, actions, callAction } = useDoenetRenderer(props);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { q as jsxRuntimeExports } from "./doenetml-
|
|
2
|
-
import { D as DynamicMath } from "./DynamicMath-
|
|
1
|
+
import { q as jsxRuntimeExports } from "./doenetml-D-MlvjpX.js";
|
|
2
|
+
import { D as DynamicMath } from "./DynamicMath-Bmg5p72t.js";
|
|
3
3
|
function renderLabelWithLatex({
|
|
4
4
|
label,
|
|
5
5
|
labelHasLatex
|
|
@@ -0,0 +1,437 @@
|
|
|
1
|
+
import { A as DocContext, M as deepCompare, q as jsxRuntimeExports, C as loadMathJax } from "./doenetml-D-MlvjpX.js";
|
|
2
|
+
import React__default, { useContext, useRef, useEffect } from "react";
|
|
3
|
+
import { j as jxg } from "./JSXGraphRenderer-D-h7eH-Q.js";
|
|
4
|
+
import { u as useDoenetRenderer } from "./useDoenetRenderer-UyWCNuKB.js";
|
|
5
|
+
import { BoardContext, BASE_LAYER_OFFSET, LINE_LAYER_OFFSET, POINT_LAYER_OFFSET, TEXT_LAYER_OFFSET } from "./graph-DEJxLN7s.js";
|
|
6
|
+
import { s as styleToDash } from "./styleToDash-DWb71gbd.js";
|
|
7
|
+
import { e as resolveBackgroundColor, b as resolveCanvasColor, f as resolveTextColor, g as resolvePanelBorderColor } from "./styleColors-CKo0M7P-.js";
|
|
8
|
+
const ORIGIN = [0, 0];
|
|
9
|
+
const legend = React__default.memo(function Legend(props) {
|
|
10
|
+
let { id, SVs } = useDoenetRenderer(props);
|
|
11
|
+
const board = useContext(BoardContext);
|
|
12
|
+
const { darkMode } = useContext(DocContext) || {};
|
|
13
|
+
const entries = useRef([]);
|
|
14
|
+
const box = useRef(null);
|
|
15
|
+
const previousDependencies = useRef(null);
|
|
16
|
+
const layoutGeneration = useRef(0);
|
|
17
|
+
const boxFillColor = resolveBackgroundColor(SVs.selectedStyle, darkMode) || resolveCanvasColor(darkMode);
|
|
18
|
+
const boxBorderColor = resolvePanelBorderColor(darkMode);
|
|
19
|
+
const labelTextColor = resolveTextColor(SVs.selectedStyle, darkMode);
|
|
20
|
+
const boxLayer = 10 * SVs.layer + BASE_LAYER_OFFSET;
|
|
21
|
+
const lineSwatchLayer = 10 * SVs.layer + LINE_LAYER_OFFSET;
|
|
22
|
+
const markerSwatchLayer = 10 * SVs.layer + POINT_LAYER_OFFSET;
|
|
23
|
+
const labelLayer = 10 * SVs.layer + TEXT_LAYER_OFFSET;
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
return () => {
|
|
26
|
+
deleteLegend();
|
|
27
|
+
};
|
|
28
|
+
}, []);
|
|
29
|
+
function baseGeometry() {
|
|
30
|
+
const { xMin, xMax, yMin, yMax } = SVs.graphLimits;
|
|
31
|
+
const legendDy = (yMax - yMin) * 0.06;
|
|
32
|
+
const legendLineLength = (xMax - xMin) * 0.05;
|
|
33
|
+
const legendDx = (xMax - xMin) * 0.02;
|
|
34
|
+
const baseLegendX = xMin + (xMax - xMin) * 0.05;
|
|
35
|
+
const legendY = SVs.position.slice(0, 5) === "upper" ? yMin + (yMax - yMin) * 0.95 : yMin + (yMax - yMin) * 0.05 + legendDy * SVs.legendElements.length;
|
|
36
|
+
return {
|
|
37
|
+
xMax,
|
|
38
|
+
legendDy,
|
|
39
|
+
legendLineLength,
|
|
40
|
+
legendDx,
|
|
41
|
+
baseLegendX,
|
|
42
|
+
legendY,
|
|
43
|
+
atRight: SVs.position.slice(-5) === "right"
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
function syncEntries() {
|
|
47
|
+
if (board === null) {
|
|
48
|
+
return false;
|
|
49
|
+
}
|
|
50
|
+
let usedMathJax = false;
|
|
51
|
+
for (const [ind, element] of SVs.legendElements.entries()) {
|
|
52
|
+
const previous = entries.current[ind] ?? null;
|
|
53
|
+
const entry = {
|
|
54
|
+
swatch: syncSwatch(board, previous, element),
|
|
55
|
+
swatchType: element.swatchType,
|
|
56
|
+
...syncLabel(board, previous, element)
|
|
57
|
+
};
|
|
58
|
+
usedMathJax ||= entry.labelContent?.hasLatex ?? false;
|
|
59
|
+
entries.current[ind] = entry;
|
|
60
|
+
}
|
|
61
|
+
removeEntries(SVs.legendElements.length);
|
|
62
|
+
return usedMathJax;
|
|
63
|
+
}
|
|
64
|
+
function syncSwatch(board2, previous, element) {
|
|
65
|
+
if (previous) {
|
|
66
|
+
if (previous.swatchType === element.swatchType) {
|
|
67
|
+
applySwatchStyle(previous.swatch, element);
|
|
68
|
+
return previous.swatch;
|
|
69
|
+
}
|
|
70
|
+
board2.removeObject(previous.swatch);
|
|
71
|
+
}
|
|
72
|
+
if (element.swatchType === "marker") {
|
|
73
|
+
return board2.create("point", ORIGIN, {
|
|
74
|
+
...markerAttributes(element),
|
|
75
|
+
strokeColor: "none",
|
|
76
|
+
fixed: true,
|
|
77
|
+
highlight: false,
|
|
78
|
+
withLabel: false,
|
|
79
|
+
showInfoBox: false,
|
|
80
|
+
layer: markerSwatchLayer
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
if (element.swatchType === "rectangle") {
|
|
84
|
+
return board2.create("polygon", [ORIGIN, ORIGIN, ORIGIN, ORIGIN], {
|
|
85
|
+
...fillAttributes(element),
|
|
86
|
+
fixed: true,
|
|
87
|
+
highlight: false,
|
|
88
|
+
layer: lineSwatchLayer,
|
|
89
|
+
vertices: { visible: false },
|
|
90
|
+
borders: {
|
|
91
|
+
...strokeAttributes(element),
|
|
92
|
+
fixed: true,
|
|
93
|
+
highlight: false,
|
|
94
|
+
layer: lineSwatchLayer
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
return board2.create("segment", [ORIGIN, [1, 0]], {
|
|
99
|
+
...strokeAttributes(element),
|
|
100
|
+
fixed: true,
|
|
101
|
+
highlight: false,
|
|
102
|
+
layer: lineSwatchLayer
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
function syncLabel(board2, previous, element) {
|
|
106
|
+
const label = element.label;
|
|
107
|
+
const hasLatex = label?.hasLatex ?? false;
|
|
108
|
+
const shown = previous?.labelContent ?? null;
|
|
109
|
+
let txt = previous?.label ?? null;
|
|
110
|
+
if (txt && (!label || shown?.hasLatex !== hasLatex || previous?.labelLayer !== labelLayer)) {
|
|
111
|
+
board2.removeObject(txt);
|
|
112
|
+
txt = null;
|
|
113
|
+
}
|
|
114
|
+
if (!label) {
|
|
115
|
+
return { label: null, labelContent: null, labelLayer: null };
|
|
116
|
+
}
|
|
117
|
+
if (txt) {
|
|
118
|
+
if (shown?.value !== label.value) {
|
|
119
|
+
txt.setText(label.value);
|
|
120
|
+
}
|
|
121
|
+
txt.setAttribute({
|
|
122
|
+
strokeColor: labelTextColor,
|
|
123
|
+
highlightStrokeColor: labelTextColor
|
|
124
|
+
});
|
|
125
|
+
} else {
|
|
126
|
+
const textAttrs = {
|
|
127
|
+
fixed: true,
|
|
128
|
+
highlight: false,
|
|
129
|
+
layer: labelLayer,
|
|
130
|
+
strokeColor: labelTextColor,
|
|
131
|
+
highlightStrokeColor: labelTextColor,
|
|
132
|
+
// A label is an absolutely positioned div inside the board, so
|
|
133
|
+
// left to itself it is only as wide as the room left between
|
|
134
|
+
// where it sits and the board's right edge, and wraps to fit.
|
|
135
|
+
// Its width is what the legend is laid out from, and it is
|
|
136
|
+
// measured wherever the label happens to be standing at the
|
|
137
|
+
// time, so a label that may wrap measures differently
|
|
138
|
+
// depending on where it is measured. Kept on one line, its
|
|
139
|
+
// width is its own — and it runs past the graph's edge rather
|
|
140
|
+
// than wrapping into the row below it (see #1750).
|
|
141
|
+
cssStyle: "white-space: nowrap"
|
|
142
|
+
};
|
|
143
|
+
if (hasLatex) {
|
|
144
|
+
textAttrs.useMathJax = true;
|
|
145
|
+
textAttrs.parse = false;
|
|
146
|
+
}
|
|
147
|
+
txt = board2.create(
|
|
148
|
+
"text",
|
|
149
|
+
[...ORIGIN, label.value],
|
|
150
|
+
textAttrs
|
|
151
|
+
);
|
|
152
|
+
}
|
|
153
|
+
return {
|
|
154
|
+
label: txt,
|
|
155
|
+
labelContent: { value: label.value, hasLatex },
|
|
156
|
+
labelLayer
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
function applySwatchStyle(swatch, element) {
|
|
160
|
+
if (element.swatchType === "marker") {
|
|
161
|
+
swatch.setAttribute({
|
|
162
|
+
...markerAttributes(element),
|
|
163
|
+
layer: markerSwatchLayer
|
|
164
|
+
});
|
|
165
|
+
} else if (element.swatchType === "rectangle") {
|
|
166
|
+
swatch.setAttribute({
|
|
167
|
+
...fillAttributes(element),
|
|
168
|
+
layer: lineSwatchLayer
|
|
169
|
+
});
|
|
170
|
+
for (const border of swatch.borders) {
|
|
171
|
+
border.setAttribute({
|
|
172
|
+
...strokeAttributes(element),
|
|
173
|
+
layer: lineSwatchLayer
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
} else {
|
|
177
|
+
swatch.setAttribute({
|
|
178
|
+
...strokeAttributes(element),
|
|
179
|
+
layer: lineSwatchLayer
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
function syncBox() {
|
|
184
|
+
if (board === null) {
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
187
|
+
const wanted = SVs.boxed && SVs.legendElements.length > 0;
|
|
188
|
+
if (!wanted) {
|
|
189
|
+
if (box.current) {
|
|
190
|
+
board.removeObject(box.current);
|
|
191
|
+
box.current = null;
|
|
192
|
+
}
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
195
|
+
const boxAttributes = {
|
|
196
|
+
fillColor: boxFillColor,
|
|
197
|
+
fillOpacity: 1,
|
|
198
|
+
layer: boxLayer
|
|
199
|
+
};
|
|
200
|
+
const borderAttributes = {
|
|
201
|
+
strokeColor: boxBorderColor,
|
|
202
|
+
strokeWidth: 1,
|
|
203
|
+
strokeOpacity: 1,
|
|
204
|
+
layer: boxLayer
|
|
205
|
+
};
|
|
206
|
+
if (box.current) {
|
|
207
|
+
box.current.setAttribute(boxAttributes);
|
|
208
|
+
for (const border of box.current.borders) {
|
|
209
|
+
border.setAttribute(borderAttributes);
|
|
210
|
+
}
|
|
211
|
+
return;
|
|
212
|
+
}
|
|
213
|
+
box.current = board.create(
|
|
214
|
+
"polygon",
|
|
215
|
+
[ORIGIN, ORIGIN, ORIGIN, ORIGIN],
|
|
216
|
+
{
|
|
217
|
+
...boxAttributes,
|
|
218
|
+
fixed: true,
|
|
219
|
+
highlight: false,
|
|
220
|
+
vertices: { visible: false },
|
|
221
|
+
borders: {
|
|
222
|
+
...borderAttributes,
|
|
223
|
+
fixed: true,
|
|
224
|
+
highlight: false
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
);
|
|
228
|
+
}
|
|
229
|
+
function positionLegend(geometry) {
|
|
230
|
+
if (board === null) {
|
|
231
|
+
return;
|
|
232
|
+
}
|
|
233
|
+
const {
|
|
234
|
+
xMax,
|
|
235
|
+
legendDx,
|
|
236
|
+
legendDy,
|
|
237
|
+
legendLineLength,
|
|
238
|
+
legendY,
|
|
239
|
+
baseLegendX,
|
|
240
|
+
atRight
|
|
241
|
+
} = geometry;
|
|
242
|
+
let maxTextWidth = 0;
|
|
243
|
+
for (const { label } of entries.current) {
|
|
244
|
+
if (label) {
|
|
245
|
+
maxTextWidth = Math.max(
|
|
246
|
+
maxTextWidth,
|
|
247
|
+
label.rendNode.offsetWidth
|
|
248
|
+
);
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
maxTextWidth /= board.unitX;
|
|
252
|
+
const legendX = atRight ? Math.max(
|
|
253
|
+
baseLegendX,
|
|
254
|
+
xMax - legendLineLength - 3 * legendDx - maxTextWidth
|
|
255
|
+
) : baseLegendX;
|
|
256
|
+
if (box.current) {
|
|
257
|
+
movePolygon(
|
|
258
|
+
box.current,
|
|
259
|
+
boxCorners(
|
|
260
|
+
geometry,
|
|
261
|
+
legendX,
|
|
262
|
+
maxTextWidth,
|
|
263
|
+
entries.current.length
|
|
264
|
+
)
|
|
265
|
+
);
|
|
266
|
+
}
|
|
267
|
+
for (const [ind, entry] of entries.current.entries()) {
|
|
268
|
+
const y = legendY - ind * legendDy;
|
|
269
|
+
if (entry.swatchType === "marker") {
|
|
270
|
+
movePoint(entry.swatch, [
|
|
271
|
+
legendX + legendLineLength / 2,
|
|
272
|
+
y
|
|
273
|
+
]);
|
|
274
|
+
} else if (entry.swatchType === "rectangle") {
|
|
275
|
+
movePolygon(
|
|
276
|
+
entry.swatch,
|
|
277
|
+
rectangleSwatchCorners(geometry, legendX, y)
|
|
278
|
+
);
|
|
279
|
+
} else {
|
|
280
|
+
const line = entry.swatch;
|
|
281
|
+
movePoint(line.point1, [legendX, y]);
|
|
282
|
+
movePoint(line.point2, [legendX + legendLineLength, y]);
|
|
283
|
+
line.needsUpdate = true;
|
|
284
|
+
line.update();
|
|
285
|
+
}
|
|
286
|
+
if (entry.label) {
|
|
287
|
+
movePoint(entry.label, [
|
|
288
|
+
legendX + legendLineLength + legendDx,
|
|
289
|
+
y
|
|
290
|
+
]);
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
function layoutLegend() {
|
|
295
|
+
if (board === null) {
|
|
296
|
+
return;
|
|
297
|
+
}
|
|
298
|
+
const generation = ++layoutGeneration.current;
|
|
299
|
+
const geometry = baseGeometry();
|
|
300
|
+
const usedMathJax = syncEntries();
|
|
301
|
+
syncBox();
|
|
302
|
+
board.updateRenderer();
|
|
303
|
+
positionLegend(geometry);
|
|
304
|
+
board.updateRenderer();
|
|
305
|
+
if (usedMathJax) {
|
|
306
|
+
layOutAfterTypesetting().then(() => {
|
|
307
|
+
if (layoutGeneration.current !== generation) {
|
|
308
|
+
return;
|
|
309
|
+
}
|
|
310
|
+
positionLegend(geometry);
|
|
311
|
+
board.updateRenderer();
|
|
312
|
+
}).catch((e) => {
|
|
313
|
+
console.error(
|
|
314
|
+
"Failed to lay out the legend after typesetting",
|
|
315
|
+
e
|
|
316
|
+
);
|
|
317
|
+
});
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
function removeEntries(length) {
|
|
321
|
+
for (const entry of entries.current.slice(length)) {
|
|
322
|
+
board?.removeObject(entry.swatch);
|
|
323
|
+
if (entry.label) {
|
|
324
|
+
board?.removeObject(entry.label);
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
entries.current.length = length;
|
|
328
|
+
}
|
|
329
|
+
async function layOutAfterTypesetting() {
|
|
330
|
+
const mathJax = await loadMathJax();
|
|
331
|
+
await mathJax.startup?.promise;
|
|
332
|
+
}
|
|
333
|
+
function deleteLegend() {
|
|
334
|
+
layoutGeneration.current++;
|
|
335
|
+
removeEntries(0);
|
|
336
|
+
if (box.current) {
|
|
337
|
+
board?.removeObject(box.current);
|
|
338
|
+
box.current = null;
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
if (board) {
|
|
342
|
+
const dependencies = {
|
|
343
|
+
hidden: SVs.hidden,
|
|
344
|
+
legendElements: [...SVs.legendElements],
|
|
345
|
+
graphLimits: { ...SVs.graphLimits },
|
|
346
|
+
position: SVs.position,
|
|
347
|
+
layer: SVs.layer,
|
|
348
|
+
boxed: SVs.boxed,
|
|
349
|
+
boxFillColor,
|
|
350
|
+
boxBorderColor,
|
|
351
|
+
labelTextColor
|
|
352
|
+
};
|
|
353
|
+
if (!deepCompare(previousDependencies.current, dependencies)) {
|
|
354
|
+
if (SVs.hidden) {
|
|
355
|
+
deleteLegend();
|
|
356
|
+
} else {
|
|
357
|
+
layoutLegend();
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
previousDependencies.current = dependencies;
|
|
361
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { id }) });
|
|
362
|
+
}
|
|
363
|
+
if (SVs.hidden) {
|
|
364
|
+
return null;
|
|
365
|
+
}
|
|
366
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { id }) });
|
|
367
|
+
});
|
|
368
|
+
function markerAttributes(element) {
|
|
369
|
+
return {
|
|
370
|
+
fillColor: element.markerColor,
|
|
371
|
+
fillOpacity: element.lineOpacity,
|
|
372
|
+
size: element.markerSize,
|
|
373
|
+
face: normalizeStyle(element.markerStyle)
|
|
374
|
+
};
|
|
375
|
+
}
|
|
376
|
+
function strokeAttributes(element) {
|
|
377
|
+
return {
|
|
378
|
+
strokeColor: element.lineColor,
|
|
379
|
+
strokeWidth: element.lineWidth,
|
|
380
|
+
strokeOpacity: element.lineOpacity,
|
|
381
|
+
dash: styleToDash(element.lineStyle)
|
|
382
|
+
};
|
|
383
|
+
}
|
|
384
|
+
function fillAttributes(element) {
|
|
385
|
+
return {
|
|
386
|
+
fillColor: element.filled ? element.fillColor : "none",
|
|
387
|
+
fillOpacity: element.fillOpacity
|
|
388
|
+
};
|
|
389
|
+
}
|
|
390
|
+
function rectangleSwatchCorners(geometry, legendX, y) {
|
|
391
|
+
const { legendDy, legendLineLength } = geometry;
|
|
392
|
+
return [
|
|
393
|
+
[legendX, y + legendDy / 4],
|
|
394
|
+
[legendX + legendLineLength, y + legendDy / 4],
|
|
395
|
+
[legendX + legendLineLength, y - legendDy / 4],
|
|
396
|
+
[legendX, y - legendDy / 4]
|
|
397
|
+
];
|
|
398
|
+
}
|
|
399
|
+
function boxCorners(geometry, legendX, maxTextWidth, rowCount) {
|
|
400
|
+
const { legendDx, legendDy, legendLineLength, legendY } = geometry;
|
|
401
|
+
const padX = legendDx / 2;
|
|
402
|
+
const padY = legendDy / 4;
|
|
403
|
+
const left = legendX - padX;
|
|
404
|
+
const right = legendX + legendLineLength + legendDx + maxTextWidth + padX;
|
|
405
|
+
const top = legendY + legendDy / 2 + padY;
|
|
406
|
+
const bottom = legendY - (rowCount - 1) * legendDy - legendDy / 2 - padY;
|
|
407
|
+
return [
|
|
408
|
+
[left, top],
|
|
409
|
+
[right, top],
|
|
410
|
+
[right, bottom],
|
|
411
|
+
[left, bottom]
|
|
412
|
+
];
|
|
413
|
+
}
|
|
414
|
+
function normalizeStyle(style) {
|
|
415
|
+
if (style === "triangle") {
|
|
416
|
+
return "triangleup";
|
|
417
|
+
} else {
|
|
418
|
+
return style;
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
function movePoint(object, coords) {
|
|
422
|
+
object.coords.setCoordinates(jxg.COORDS_BY_USER, coords);
|
|
423
|
+
object.needsUpdate = true;
|
|
424
|
+
object.update();
|
|
425
|
+
}
|
|
426
|
+
function movePolygon(polygon, corners) {
|
|
427
|
+
for (let i = 0; i < corners.length; i++) {
|
|
428
|
+
movePoint(polygon.vertices[i], corners[i]);
|
|
429
|
+
polygon.borders[i].needsUpdate = true;
|
|
430
|
+
polygon.borders[i].update();
|
|
431
|
+
}
|
|
432
|
+
polygon.needsUpdate = true;
|
|
433
|
+
polygon.update();
|
|
434
|
+
}
|
|
435
|
+
export {
|
|
436
|
+
legend as default
|
|
437
|
+
};
|