@doenet/v06-to-v07 0.7.15 → 0.7.16

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.
Files changed (3) hide show
  1. package/index.js +585 -380
  2. package/index.js.map +1 -1
  3. package/package.json +1 -1
package/index.js CHANGED
@@ -29480,6 +29480,16 @@ function normalize_display_negative_fractions_sub(e5, { inside_unary_minus: t2 =
29480
29480
  function normalize_display_negative_fractions(e5) {
29481
29481
  return normalize_display_negative_fractions_sub(e5, { inside_unary_minus: false });
29482
29482
  }
29483
+ function expandScientificNotation(e5) {
29484
+ let t2 = e5.indexOf("e");
29485
+ if (-1 === t2) return e5;
29486
+ let r2 = e5.substring(0, t2), n3 = Number(e5.substring(t2 + 1)), i2 = "";
29487
+ "-" !== r2[0] && "+" !== r2[0] || (i2 = "-" === r2[0] ? "-" : "", r2 = r2.substring(1));
29488
+ let a2 = r2.indexOf(".");
29489
+ -1 === a2 && (a2 = r2.length);
29490
+ let o2 = r2.replace(".", ""), s2 = a2 + n3;
29491
+ return s2 <= 0 ? i2 + "0." + "0".repeat(-s2) + o2 : s2 >= o2.length ? i2 + o2 + "0".repeat(s2 - o2.length) : i2 + o2.substring(0, s2) + "." + o2.substring(s2);
29492
+ }
29483
29493
  const unicode_operators = { "+": function(e5) {
29484
29494
  return e5.join(" ");
29485
29495
  }, "-": function(e5) {
@@ -29718,8 +29728,8 @@ const unicode_operators = { "+": function(e5) {
29718
29728
  return e5[0] + " " + e5[1];
29719
29729
  } }, output_unicodeDefault = true;
29720
29730
  let astToText$2 = class {
29721
- constructor({ output_unicode: e5 = output_unicodeDefault, padToDigits: t2 = null, padToDecimals: r2 = null, showBlanks: n3 = true, explicitMultiplicationSymbols: i2 = false } = {}) {
29722
- this.output_unicode = e5, this.operators = unicode_operators, e5 || (this.operators = nonunicode_operators), this.padToDigits = t2, this.padToDecimals = r2, this.showBlanks = n3, this.explicitMultiplicationSymbols = i2;
29731
+ constructor({ output_unicode: e5 = output_unicodeDefault, padToDigits: t2 = null, padToDecimals: r2 = null, avoidScientificNotation: n3 = false, showBlanks: i2 = true, explicitMultiplicationSymbols: a2 = false } = {}) {
29732
+ this.output_unicode = e5, this.operators = unicode_operators, e5 || (this.operators = nonunicode_operators), this.padToDigits = t2, this.padToDecimals = r2, this.avoidScientificNotation = n3, this.showBlanks = i2, this.explicitMultiplicationSymbols = a2;
29723
29733
  }
29724
29734
  convert(e5) {
29725
29735
  return this.statement(normalize_display_negative_fractions(e5));
@@ -29790,7 +29800,7 @@ let astToText$2 = class {
29790
29800
  }
29791
29801
  simple_factor_or_function_or_parens(e5) {
29792
29802
  let t2 = this.factor(e5);
29793
- return !!(t2.length <= 1 || "string" == typeof e5 && e5.match(/^\w+$/) || Array.isArray(e5) && "apply" === e5[0] || t2.match(/^\(.*\)$/) || t2.match(/^⟨.*⟩$/)) || "number" == typeof e5 && (e5 >= 0 && !e5.toString().includes("e"));
29803
+ return !!(t2.length <= 1 || "string" == typeof e5 && e5.match(/^\w+$/) || Array.isArray(e5) && "apply" === e5[0] || t2.match(/^\(.*\)$/) || t2.match(/^⟨.*⟩$/)) || "number" == typeof e5 && !(!(e5 >= 0) || !this.avoidScientificNotation && e5.toString().includes("e"));
29794
29804
  }
29795
29805
  factor(e5) {
29796
29806
  if ("string" == typeof e5) return this.symbolConvert(e5);
@@ -29800,7 +29810,7 @@ let astToText$2 = class {
29800
29810
  if (Number.isNaN(e5)) return "NaN";
29801
29811
  {
29802
29812
  let t3 = e5.toString(), r3 = t3.indexOf("e");
29803
- if (-1 === r3) return null === this.padToDigits && null === this.padToDecimals || (t3 = padNumberStringToDigitsAndDecimals(t3, this.padToDigits, this.padToDecimals)), t3;
29813
+ if (-1 === r3 || this.avoidScientificNotation) return -1 !== r3 && this.avoidScientificNotation && (t3 = expandScientificNotation(t3)), null === this.padToDigits && null === this.padToDecimals || (t3 = padNumberStringToDigitsAndDecimals(t3, this.padToDigits, this.padToDecimals)), t3;
29804
29814
  let n3 = t3.substring(0, r3), i2 = t3.substring(r3 + 1);
29805
29815
  if (null !== this.padToDigits || null !== this.padToDecimals) {
29806
29816
  let r4 = Number(i2);
@@ -33892,8 +33902,8 @@ const operators$1 = { "+": function(e5) {
33892
33902
  return "\\circ" === e5[1] ? e5[0] + "^{\\circ}" : e5[0] + " " + e5[1];
33893
33903
  } }, allowedLatexSymbolsDefault$1 = ["alpha", "beta", "gamma", "Gamma", "delta", "Delta", "epsilon", "zeta", "eta", "theta", "Theta", "iota", "kappa", "lambda", "Lambda", "mu", "nu", "xi", "Xi", "pi", "Pi", "rho", "sigma", "Sigma", "tau", "Tau", "upsilon", "Upsilon", "phi", "Phi", "chi", "psi", "Psi", "omega", "Omega", "partial", "abs", "exp", "log", "ln", "log10", "sign", "sqrt", "erf", "cos", "cosh", "cot", "coth", "csc", "csch", "sec", "sech", "sin", "sinh", "tan", "tanh", "arcsin", "arccos", "arctan", "arccsc", "arcsec", "arccot", "arg", "Re", "Im", "det", "angle", "perp", "circ", "%", "$", "int", "varnothing"], convertLatexSymbolsDefault = { acos: "arccos", acosh: "arccosh", acot: "arccot", acoth: "arccoth", acsc: "arccsc", acsch: "arccsch", asec: "arcsec", asech: "arcsech", asin: "arcsin", asinh: "arcsinh", atan: "arctan", atanh: "arctanh", deg: "circ", emptyset: "varnothing" }, matrixEnvironmentDefault = "bmatrix";
33894
33904
  let astToLatex$1 = class {
33895
- constructor({ allowedLatexSymbols: e5 = allowedLatexSymbolsDefault$1, convertLatexSymbols: t2 = convertLatexSymbolsDefault, matrixEnvironment: r2 = matrixEnvironmentDefault, padToDigits: n3 = null, padToDecimals: i2 = null, showBlanks: a2 = true } = {}) {
33896
- this.allowedLatexSymbols = e5, this.convertLatexSymbols = t2, this.matrixEnvironment = r2, this.padToDigits = n3, this.padToDecimals = i2, this.showBlanks = a2;
33905
+ constructor({ allowedLatexSymbols: e5 = allowedLatexSymbolsDefault$1, convertLatexSymbols: t2 = convertLatexSymbolsDefault, matrixEnvironment: r2 = matrixEnvironmentDefault, padToDigits: n3 = null, padToDecimals: i2 = null, avoidScientificNotation: a2 = false, showBlanks: o2 = true } = {}) {
33906
+ this.allowedLatexSymbols = e5, this.convertLatexSymbols = t2, this.matrixEnvironment = r2, this.padToDigits = n3, this.padToDecimals = i2, this.avoidScientificNotation = a2, this.showBlanks = o2;
33897
33907
  }
33898
33908
  convert(e5) {
33899
33909
  return this.statement(normalize_display_negative_fractions(e5));
@@ -33951,7 +33961,7 @@ let astToLatex$1 = class {
33951
33961
  }
33952
33962
  simple_factor_or_function_or_parens(e5) {
33953
33963
  var t2 = this.factor(e5);
33954
- return !!(t2.length <= 1 || "string" == typeof e5 && e5.match(/^\w+$/) || Array.isArray(e5) && "apply" === e5[0] && !["sqrt", "cbrt", "nthroot"].includes(e5[1]) || t2.match(/^\\left\(.*\\right\)$/) || t2.match(/^\\left\\langle.*\\right\\rangle$/)) || "number" == typeof e5 && (e5 >= 0 && !e5.toString().includes("e"));
33964
+ return !!(t2.length <= 1 || "string" == typeof e5 && e5.match(/^\w+$/) || Array.isArray(e5) && "apply" === e5[0] && !["sqrt", "cbrt", "nthroot"].includes(e5[1]) || t2.match(/^\\left\(.*\\right\)$/) || t2.match(/^\\left\\langle.*\\right\\rangle$/)) || "number" == typeof e5 && !(!(e5 >= 0) || !this.avoidScientificNotation && e5.toString().includes("e"));
33955
33965
  }
33956
33966
  stringConvert(e5) {
33957
33967
  return e5.length > 1 ? (this.convertLatexSymbols[e5] && (e5 = this.convertLatexSymbols[e5]), this.allowedLatexSymbols.includes(e5) ? "\\" + e5 : "\\operatorname{" + e5 + "}") : this.allowedLatexSymbols.includes(e5) ? "\\" + e5 : "_" !== e5 || this.showBlanks ? e5 : "";
@@ -33964,7 +33974,7 @@ let astToLatex$1 = class {
33964
33974
  if (Number.isNaN(e5)) return "NaN";
33965
33975
  {
33966
33976
  let t3 = e5.toString(), r3 = t3.indexOf("e");
33967
- if (-1 === r3) return null === this.padToDigits && null === this.padToDecimals || (t3 = padNumberStringToDigitsAndDecimals(t3, this.padToDigits, this.padToDecimals)), t3;
33977
+ if (-1 === r3 || this.avoidScientificNotation) return -1 !== r3 && this.avoidScientificNotation && (t3 = expandScientificNotation(t3)), null === this.padToDigits && null === this.padToDecimals || (t3 = padNumberStringToDigitsAndDecimals(t3, this.padToDigits, this.padToDecimals)), t3;
33968
33978
  let n3 = t3.substring(0, r3), i2 = t3.substring(r3 + 1);
33969
33979
  if ("+" === i2[0] && (i2 = i2.slice(1)), null !== this.padToDigits || null !== this.padToDecimals) {
33970
33980
  let r4 = Number(i2);
@@ -66739,7 +66749,7 @@ class TextOrInline extends InlineComponent {
66739
66749
  class BlockComponent extends BaseComponent {
66740
66750
  static componentType = "_block";
66741
66751
  }
66742
- function returnRoundingStateVariableDefinitions({
66752
+ function returnNumberDisplayStateVariableDefinitions({
66743
66753
  childGroupsIfSingleMatch = [],
66744
66754
  childGroupsToStopSingleMatch = [],
66745
66755
  additionalAttributeComponent = null,
@@ -66754,14 +66764,14 @@ function returnRoundingStateVariableDefinitions({
66754
66764
  },
66755
66765
  hasEssential: true,
66756
66766
  defaultValue: displayDigitsDefault,
66757
- returnDependencies: roundingDependencies({
66767
+ returnDependencies: numberDisplayDependencies({
66758
66768
  stateVariable: "displayDigits",
66759
66769
  childGroupsIfSingleMatch,
66760
66770
  childGroupsToStopSingleMatch,
66761
66771
  ignoreShadowsIfHaveAttribute: "displayDecimals",
66762
66772
  additionalAttributeComponent
66763
66773
  }),
66764
- definition: roundingDefinition({
66774
+ definition: numberDisplayDefinition({
66765
66775
  stateVariable: "displayDigits",
66766
66776
  valueIfIgnore: 0
66767
66777
  })
@@ -66773,14 +66783,14 @@ function returnRoundingStateVariableDefinitions({
66773
66783
  },
66774
66784
  hasEssential: true,
66775
66785
  defaultValue: 2,
66776
- returnDependencies: roundingDependencies({
66786
+ returnDependencies: numberDisplayDependencies({
66777
66787
  stateVariable: "displayDecimals",
66778
66788
  childGroupsIfSingleMatch,
66779
66789
  childGroupsToStopSingleMatch,
66780
66790
  ignoreShadowsIfHaveAttribute: "displayDigits",
66781
66791
  additionalAttributeComponent
66782
66792
  }),
66783
- definition: roundingDefinition({
66793
+ definition: numberDisplayDefinition({
66784
66794
  stateVariable: "displayDecimals",
66785
66795
  valueIfIgnore: -Infinity
66786
66796
  })
@@ -66792,13 +66802,13 @@ function returnRoundingStateVariableDefinitions({
66792
66802
  },
66793
66803
  hasEssential: true,
66794
66804
  defaultValue: displaySmallAsZeroDefault,
66795
- returnDependencies: roundingDependencies({
66805
+ returnDependencies: numberDisplayDependencies({
66796
66806
  stateVariable: "displaySmallAsZero",
66797
66807
  childGroupsIfSingleMatch,
66798
66808
  childGroupsToStopSingleMatch,
66799
66809
  additionalAttributeComponent
66800
66810
  }),
66801
- definition: roundingDefinition({
66811
+ definition: numberDisplayDefinition({
66802
66812
  stateVariable: "displaySmallAsZero"
66803
66813
  })
66804
66814
  };
@@ -66809,19 +66819,36 @@ function returnRoundingStateVariableDefinitions({
66809
66819
  },
66810
66820
  hasEssential: true,
66811
66821
  defaultValue: false,
66812
- returnDependencies: roundingDependencies({
66822
+ returnDependencies: numberDisplayDependencies({
66813
66823
  stateVariable: "padZeros",
66814
66824
  childGroupsIfSingleMatch,
66815
66825
  childGroupsToStopSingleMatch,
66816
66826
  additionalAttributeComponent
66817
66827
  }),
66818
- definition: roundingDefinition({
66828
+ definition: numberDisplayDefinition({
66819
66829
  stateVariable: "padZeros"
66820
66830
  })
66821
66831
  };
66832
+ stateVariableDefinitions.avoidScientificNotation = {
66833
+ public: true,
66834
+ shadowingInstructions: {
66835
+ createComponentOfType: "boolean"
66836
+ },
66837
+ hasEssential: true,
66838
+ defaultValue: false,
66839
+ returnDependencies: numberDisplayDependencies({
66840
+ stateVariable: "avoidScientificNotation",
66841
+ childGroupsIfSingleMatch,
66842
+ childGroupsToStopSingleMatch,
66843
+ additionalAttributeComponent
66844
+ }),
66845
+ definition: numberDisplayDefinition({
66846
+ stateVariable: "avoidScientificNotation"
66847
+ })
66848
+ };
66822
66849
  return stateVariableDefinitions;
66823
66850
  }
66824
- function roundingDependencies({
66851
+ function numberDisplayDependencies({
66825
66852
  stateVariable,
66826
66853
  childGroupsIfSingleMatch,
66827
66854
  childGroupsToStopSingleMatch,
@@ -66865,7 +66892,7 @@ function roundingDependencies({
66865
66892
  return dependencies2;
66866
66893
  };
66867
66894
  }
66868
- function roundingDefinition({ stateVariable, valueIfIgnore = null }) {
66895
+ function numberDisplayDefinition({ stateVariable, valueIfIgnore = null }) {
66869
66896
  return function({ dependencyValues, usedDefault }) {
66870
66897
  let foundDefaultValue = false;
66871
66898
  let theDefaultValueFound;
@@ -66926,7 +66953,7 @@ function roundingDefinition({ stateVariable, valueIfIgnore = null }) {
66926
66953
  }
66927
66954
  };
66928
66955
  }
66929
- function returnRoundingAttributes() {
66956
+ function returnNumberDisplayAttributes() {
66930
66957
  return {
66931
66958
  displayDigits: {
66932
66959
  createComponentOfType: "integer"
@@ -66941,12 +66968,15 @@ function returnRoundingAttributes() {
66941
66968
  },
66942
66969
  padZeros: {
66943
66970
  createComponentOfType: "boolean"
66971
+ },
66972
+ avoidScientificNotation: {
66973
+ createComponentOfType: "boolean"
66944
66974
  }
66945
66975
  };
66946
66976
  }
66947
- function returnRoundingAttributeComponentShadowing() {
66977
+ function returnNumberDisplayAttributeComponentShadowing() {
66948
66978
  let shadowing = {};
66949
- for (let stateVariable in returnRoundingStateVariableDefinitions()) {
66979
+ for (let stateVariable in returnNumberDisplayStateVariableDefinitions()) {
66950
66980
  shadowing[stateVariable] = {
66951
66981
  stateVariableToShadow: stateVariable,
66952
66982
  // if used in an array state variable that has wrapping components
@@ -66957,11 +66987,31 @@ function returnRoundingAttributeComponentShadowing() {
66957
66987
  }
66958
66988
  return shadowing;
66959
66989
  }
66960
- function gatherRawRoundingFixedResponseAttributes(component, components) {
66990
+ function buildNumberDisplayParameters({
66991
+ padZeros,
66992
+ displayDigits,
66993
+ displayDecimals,
66994
+ avoidScientificNotation
66995
+ } = {}) {
66996
+ let params = {};
66997
+ if (padZeros) {
66998
+ if (Number.isFinite(displayDecimals)) {
66999
+ params.padToDecimals = displayDecimals;
67000
+ }
67001
+ if (displayDigits >= 1) {
67002
+ params.padToDigits = displayDigits;
67003
+ }
67004
+ }
67005
+ if (avoidScientificNotation) {
67006
+ params.avoidScientificNotation = true;
67007
+ }
67008
+ return params;
67009
+ }
67010
+ function gatherRawNumberDisplayFixedResponseAttributes(component, components) {
66961
67011
  const rawAttrNames = [
66962
67012
  "fixed",
66963
67013
  "isResponse",
66964
- ...Object.keys(returnRoundingAttributes())
67014
+ ...Object.keys(returnNumberDisplayAttributes())
66965
67015
  ];
66966
67016
  let componentForRawAttributes = component;
66967
67017
  let attributesToConvert = {};
@@ -67006,7 +67056,7 @@ function gatherRawRoundingFixedResponseAttributes(component, components) {
67006
67056
  }
67007
67057
  return attributesToConvert;
67008
67058
  }
67009
- function addShadowRoundingAttributes({
67059
+ function addShadowNumberDisplayAttributes({
67010
67060
  nComponents,
67011
67061
  stateIdInfo,
67012
67062
  source,
@@ -67018,19 +67068,19 @@ function addShadowRoundingAttributes({
67018
67068
  if (!sourceSVs) {
67019
67069
  return nComponents;
67020
67070
  }
67021
- const roundingAttributes = returnRoundingAttributes();
67071
+ const numberDisplayAttrs = returnNumberDisplayAttributes();
67022
67072
  const origAttrNames = Object.keys(attributes);
67023
- for (const attrName in roundingAttributes) {
67073
+ for (const attrName in numberDisplayAttrs) {
67024
67074
  if (origAttrNames.includes(attrName)) {
67025
67075
  continue;
67026
67076
  }
67027
67077
  if (attrName === "displayDigits" && origAttrNames.includes("displayDecimals") || attrName === "displayDecimals" && origAttrNames.includes("displayDigits")) {
67028
67078
  continue;
67029
67079
  }
67030
- if (sourceSVs[attrName]?.createComponentOfType === roundingAttributes[attrName].createComponentOfType) {
67080
+ if (sourceSVs[attrName]?.createComponentOfType === numberDisplayAttrs[attrName].createComponentOfType) {
67031
67081
  const shadowComponent = {
67032
67082
  type: "serialized",
67033
- componentType: roundingAttributes[attrName].createComponentOfType,
67083
+ componentType: numberDisplayAttrs[attrName].createComponentOfType,
67034
67084
  componentIdx: nComponents++,
67035
67085
  stateId: stateIdInfo ? `${stateIdInfo.prefix}${stateIdInfo.num++}` : void 0,
67036
67086
  attributes: {},
@@ -67365,7 +67415,7 @@ function returnMathVectorMatrixStateVariableDefinitions() {
67365
67415
  public: true,
67366
67416
  shadowingInstructions: {
67367
67417
  createComponentOfType: "math",
67368
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing(),
67418
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing(),
67369
67419
  returnWrappingComponents(prefix) {
67370
67420
  if (prefix === "x") {
67371
67421
  return [];
@@ -67549,7 +67599,7 @@ function returnMathVectorMatrixStateVariableDefinitions() {
67549
67599
  public: true,
67550
67600
  shadowingInstructions: {
67551
67601
  createComponentOfType: "math",
67552
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing()
67602
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing()
67553
67603
  },
67554
67604
  isArray: true,
67555
67605
  entryPrefixes: ["listItem"],
@@ -67661,7 +67711,7 @@ function returnMathVectorMatrixStateVariableDefinitions() {
67661
67711
  public: true,
67662
67712
  shadowingInstructions: {
67663
67713
  createComponentOfType: "math",
67664
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing(),
67714
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing(),
67665
67715
  returnWrappingComponents(prefix) {
67666
67716
  if (prefix === "matrixEntry") {
67667
67717
  return [];
@@ -67976,7 +68026,7 @@ class MathComponent extends InlineComponent {
67976
68026
  defaultValue: false,
67977
68027
  public: true
67978
68028
  };
67979
- Object.assign(attributes, returnRoundingAttributes());
68029
+ Object.assign(attributes, returnNumberDisplayAttributes());
67980
68030
  attributes.renderMode = {
67981
68031
  createComponentOfType: "text",
67982
68032
  createStateVariable: "renderMode",
@@ -68079,7 +68129,7 @@ class MathComponent extends InlineComponent {
68079
68129
  Object.assign(stateVariableDefinitions, styleDescriptionDefinitions);
68080
68130
  let anchorDefinition = returnAnchorStateVariableDefinition();
68081
68131
  Object.assign(stateVariableDefinitions, anchorDefinition);
68082
- let roundingDefinitions = returnRoundingStateVariableDefinitions({
68132
+ let roundingDefinitions = returnNumberDisplayStateVariableDefinitions({
68083
68133
  childGroupsIfSingleMatch: ["maths"],
68084
68134
  childGroupsToStopSingleMatch: ["strings"]
68085
68135
  });
@@ -68418,7 +68468,7 @@ class MathComponent extends InlineComponent {
68418
68468
  fixed: {
68419
68469
  stateVariableToShadow: "fixed"
68420
68470
  },
68421
- ...returnRoundingAttributeComponentShadowing()
68471
+ ...returnNumberDisplayAttributeComponentShadowing()
68422
68472
  }
68423
68473
  },
68424
68474
  returnDependencies: () => ({
@@ -68482,7 +68532,7 @@ class MathComponent extends InlineComponent {
68482
68532
  public: true,
68483
68533
  shadowingInstructions: {
68484
68534
  createComponentOfType: "number",
68485
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing()
68535
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing()
68486
68536
  },
68487
68537
  returnDependencies: () => ({
68488
68538
  value: {
@@ -68616,6 +68666,10 @@ class MathComponent extends InlineComponent {
68616
68666
  dependencyType: "stateVariable",
68617
68667
  variableName: "padZeros"
68618
68668
  },
68669
+ avoidScientificNotation: {
68670
+ dependencyType: "stateVariable",
68671
+ variableName: "avoidScientificNotation"
68672
+ },
68619
68673
  displayDigits: {
68620
68674
  dependencyType: "stateVariable",
68621
68675
  variableName: "displayDigits"
@@ -68631,15 +68685,12 @@ class MathComponent extends InlineComponent {
68631
68685
  }),
68632
68686
  definition: function({ dependencyValues }) {
68633
68687
  let latex;
68634
- let params = {};
68635
- if (dependencyValues.padZeros) {
68636
- if (Number.isFinite(dependencyValues.displayDecimals)) {
68637
- params.padToDecimals = dependencyValues.displayDecimals;
68638
- }
68639
- if (dependencyValues.displayDigits >= 1) {
68640
- params.padToDigits = dependencyValues.displayDigits;
68641
- }
68642
- }
68688
+ let params = buildNumberDisplayParameters({
68689
+ padZeros: dependencyValues.padZeros,
68690
+ displayDigits: dependencyValues.displayDigits,
68691
+ displayDecimals: dependencyValues.displayDecimals,
68692
+ avoidScientificNotation: dependencyValues.avoidScientificNotation
68693
+ });
68643
68694
  if (!dependencyValues.displayBlanks) {
68644
68695
  params.showBlanks = false;
68645
68696
  }
@@ -68686,6 +68737,10 @@ class MathComponent extends InlineComponent {
68686
68737
  dependencyType: "stateVariable",
68687
68738
  variableName: "padZeros"
68688
68739
  },
68740
+ avoidScientificNotation: {
68741
+ dependencyType: "stateVariable",
68742
+ variableName: "avoidScientificNotation"
68743
+ },
68689
68744
  displayDigits: {
68690
68745
  dependencyType: "stateVariable",
68691
68746
  variableName: "displayDigits"
@@ -68706,15 +68761,12 @@ class MathComponent extends InlineComponent {
68706
68761
  }),
68707
68762
  definition: function({ dependencyValues }) {
68708
68763
  let text;
68709
- let params = {};
68710
- if (dependencyValues.padZeros) {
68711
- if (Number.isFinite(dependencyValues.displayDecimals)) {
68712
- params.padToDecimals = dependencyValues.displayDecimals;
68713
- }
68714
- if (dependencyValues.displayDigits >= 1) {
68715
- params.padToDigits = dependencyValues.displayDigits;
68716
- }
68717
- }
68764
+ let params = buildNumberDisplayParameters({
68765
+ padZeros: dependencyValues.padZeros,
68766
+ displayDigits: dependencyValues.displayDigits,
68767
+ displayDecimals: dependencyValues.displayDecimals,
68768
+ avoidScientificNotation: dependencyValues.avoidScientificNotation
68769
+ });
68718
68770
  if (!dependencyValues.displayBlanks) {
68719
68771
  params.showBlanks = false;
68720
68772
  }
@@ -68729,7 +68781,7 @@ class MathComponent extends InlineComponent {
68729
68781
  }
68730
68782
  return {
68731
68783
  setValue: {
68732
- text: superSubscriptsToUnicode(text.toString())
68784
+ text: superSubscriptsToUnicode(text)
68733
68785
  }
68734
68786
  };
68735
68787
  },
@@ -68882,7 +68934,7 @@ class MathComponent extends InlineComponent {
68882
68934
  {
68883
68935
  stateVariable: "number",
68884
68936
  stateVariablesToShadow: Object.keys(
68885
- returnRoundingStateVariableDefinitions()
68937
+ returnNumberDisplayStateVariableDefinitions()
68886
68938
  )
68887
68939
  },
68888
68940
  "text",
@@ -68897,7 +68949,7 @@ class MathComponent extends InlineComponent {
68897
68949
  stateVariable: "value",
68898
68950
  componentType: "_directionComponent",
68899
68951
  stateVariablesToShadow: Object.keys(
68900
- returnRoundingStateVariableDefinitions()
68952
+ returnNumberDisplayStateVariableDefinitions()
68901
68953
  )
68902
68954
  }
68903
68955
  ];
@@ -70656,7 +70708,7 @@ class MathList extends CompositeComponent {
70656
70708
  createStateVariable: "asList",
70657
70709
  defaultValue: true
70658
70710
  };
70659
- for (let attrName in returnRoundingAttributes()) {
70711
+ for (let attrName in returnNumberDisplayAttributes()) {
70660
70712
  attributes[attrName] = {
70661
70713
  leaveRaw: true
70662
70714
  };
@@ -71072,7 +71124,7 @@ class MathList extends CompositeComponent {
71072
71124
  let diagnostics = [];
71073
71125
  let replacements = [];
71074
71126
  let componentsCopied = [];
71075
- let attributesToConvert = gatherRawRoundingFixedResponseAttributes(
71127
+ let attributesToConvert = gatherRawNumberDisplayFixedResponseAttributes(
71076
71128
  component,
71077
71129
  components
71078
71130
  );
@@ -71103,7 +71155,7 @@ class MathList extends CompositeComponent {
71103
71155
  nComponents = res.nComponents;
71104
71156
  }
71105
71157
  if (copyChildSource) {
71106
- nComponents = addShadowRoundingAttributes({
71158
+ nComponents = addShadowNumberDisplayAttributes({
71107
71159
  nComponents,
71108
71160
  stateIdInfo,
71109
71161
  source: copyChildSource,
@@ -76817,7 +76869,7 @@ class MathOperator extends MathComponent {
76817
76869
  }
76818
76870
  static returnStateVariableDefinitions() {
76819
76871
  let stateVariableDefinitions = super.returnStateVariableDefinitions();
76820
- let roundingDefinitions = returnRoundingStateVariableDefinitions({
76872
+ let roundingDefinitions = returnNumberDisplayStateVariableDefinitions({
76821
76873
  childGroupsIfSingleMatch: ["maths", "numbers"]
76822
76874
  });
76823
76875
  Object.assign(stateVariableDefinitions, roundingDefinitions);
@@ -77461,7 +77513,7 @@ class Round extends MathOperatorOneInput {
77461
77513
  }
77462
77514
  static returnStateVariableDefinitions() {
77463
77515
  let stateVariableDefinitions = super.returnStateVariableDefinitions();
77464
- let roundingDefinitions = returnRoundingStateVariableDefinitions({
77516
+ let roundingDefinitions = returnNumberDisplayStateVariableDefinitions({
77465
77517
  displayDigitsDefault: 14
77466
77518
  });
77467
77519
  Object.assign(stateVariableDefinitions, roundingDefinitions);
@@ -79924,7 +79976,7 @@ let Function$1 = class Function2 extends InlineComponent {
79924
79976
  attributes.symbolic = {
79925
79977
  createComponentOfType: "boolean"
79926
79978
  };
79927
- Object.assign(attributes, returnRoundingAttributes());
79979
+ Object.assign(attributes, returnNumberDisplayAttributes());
79928
79980
  attributes.nearestPointAsCurve = {
79929
79981
  createComponentOfType: "boolean",
79930
79982
  createStateVariable: "nearestPointAsCurve",
@@ -80014,7 +80066,7 @@ let Function$1 = class Function2 extends InlineComponent {
80014
80066
  return { setValue: { styleDescriptionWithNoun } };
80015
80067
  }
80016
80068
  };
80017
- let roundingDefinitions = returnRoundingStateVariableDefinitions({
80069
+ let roundingDefinitions = returnNumberDisplayStateVariableDefinitions({
80018
80070
  childGroupsIfSingleMatch: ["functions"]
80019
80071
  });
80020
80072
  Object.assign(stateVariableDefinitions, roundingDefinitions);
@@ -80713,7 +80765,7 @@ let Function$1 = class Function2 extends InlineComponent {
80713
80765
  public: true,
80714
80766
  shadowingInstructions: {
80715
80767
  createComponentOfType: "math",
80716
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing()
80768
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing()
80717
80769
  },
80718
80770
  defaultValue: Context.fromAst(0),
80719
80771
  hasEssential: true,
@@ -82033,6 +82085,10 @@ let Function$1 = class Function2 extends InlineComponent {
82033
82085
  padZeros: {
82034
82086
  dependencyType: "stateVariable",
82035
82087
  variableName: "padZeros"
82088
+ },
82089
+ avoidScientificNotation: {
82090
+ dependencyType: "stateVariable",
82091
+ variableName: "avoidScientificNotation"
82036
82092
  }
82037
82093
  }),
82038
82094
  definition: function({ dependencyValues }) {
@@ -82043,15 +82099,12 @@ let Function$1 = class Function2 extends InlineComponent {
82043
82099
  }
82044
82100
  };
82045
82101
  }
82046
- let params = {};
82047
- if (dependencyValues.padZeros) {
82048
- if (Number.isFinite(dependencyValues.displayDecimals)) {
82049
- params.padToDecimals = dependencyValues.displayDecimals;
82050
- }
82051
- if (dependencyValues.displayDigits >= 1) {
82052
- params.padToDigits = dependencyValues.displayDigits;
82053
- }
82054
- }
82102
+ let params = buildNumberDisplayParameters({
82103
+ padZeros: dependencyValues.padZeros,
82104
+ displayDigits: dependencyValues.displayDigits,
82105
+ displayDecimals: dependencyValues.displayDecimals,
82106
+ avoidScientificNotation: dependencyValues.avoidScientificNotation
82107
+ });
82055
82108
  let latex = roundForDisplay({
82056
82109
  value: dependencyValues.formula,
82057
82110
  dependencyValues
@@ -82089,6 +82142,10 @@ let Function$1 = class Function2 extends InlineComponent {
82089
82142
  padZeros: {
82090
82143
  dependencyType: "stateVariable",
82091
82144
  variableName: "padZeros"
82145
+ },
82146
+ avoidScientificNotation: {
82147
+ dependencyType: "stateVariable",
82148
+ variableName: "avoidScientificNotation"
82092
82149
  }
82093
82150
  }),
82094
82151
  definition: function({ dependencyValues }) {
@@ -82099,15 +82156,12 @@ let Function$1 = class Function2 extends InlineComponent {
82099
82156
  }
82100
82157
  };
82101
82158
  }
82102
- let params = {};
82103
- if (dependencyValues.padZeros) {
82104
- if (Number.isFinite(dependencyValues.displayDecimals)) {
82105
- params.padToDecimals = dependencyValues.displayDecimals;
82106
- }
82107
- if (dependencyValues.displayDigits >= 1) {
82108
- params.padToDigits = dependencyValues.displayDigits;
82109
- }
82110
- }
82159
+ let params = buildNumberDisplayParameters({
82160
+ padZeros: dependencyValues.padZeros,
82161
+ displayDigits: dependencyValues.displayDigits,
82162
+ displayDecimals: dependencyValues.displayDecimals,
82163
+ avoidScientificNotation: dependencyValues.avoidScientificNotation
82164
+ });
82111
82165
  let text = roundForDisplay({
82112
82166
  value: dependencyValues.formula,
82113
82167
  dependencyValues
@@ -82264,7 +82318,7 @@ let Function$1 = class Function2 extends InlineComponent {
82264
82318
  shadowingInstructions: {
82265
82319
  createComponentOfType: "number",
82266
82320
  attributesToShadow: ["styleNumber"],
82267
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing(),
82321
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing(),
82268
82322
  returnWrappingComponents(prefix) {
82269
82323
  if (prefix === "minimum" || prefix === void 0) {
82270
82324
  return [
@@ -82421,7 +82475,7 @@ let Function$1 = class Function2 extends InlineComponent {
82421
82475
  shadowingInstructions: {
82422
82476
  createComponentOfType: "number",
82423
82477
  attributesToShadow: ["styleNumber"],
82424
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing(),
82478
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing(),
82425
82479
  returnWrappingComponents(prefix) {
82426
82480
  if (prefix === void 0) {
82427
82481
  return [
@@ -82506,7 +82560,7 @@ let Function$1 = class Function2 extends InlineComponent {
82506
82560
  shadowingInstructions: {
82507
82561
  createComponentOfType: "number",
82508
82562
  attributesToShadow: ["styleNumber"],
82509
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing(),
82563
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing(),
82510
82564
  returnWrappingComponents(prefix) {
82511
82565
  if (prefix === void 0) {
82512
82566
  return [
@@ -82704,7 +82758,7 @@ let Function$1 = class Function2 extends InlineComponent {
82704
82758
  shadowingInstructions: {
82705
82759
  createComponentOfType: "number",
82706
82760
  attributesToShadow: ["styleNumber"],
82707
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing(),
82761
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing(),
82708
82762
  returnWrappingComponents(prefix) {
82709
82763
  if (prefix === "maximum" || prefix === void 0) {
82710
82764
  return [
@@ -82861,7 +82915,7 @@ let Function$1 = class Function2 extends InlineComponent {
82861
82915
  shadowingInstructions: {
82862
82916
  createComponentOfType: "number",
82863
82917
  attributesToShadow: ["styleNumber"],
82864
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing(),
82918
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing(),
82865
82919
  returnWrappingComponents(prefix) {
82866
82920
  if (prefix === void 0) {
82867
82921
  return [
@@ -82946,7 +83000,7 @@ let Function$1 = class Function2 extends InlineComponent {
82946
83000
  shadowingInstructions: {
82947
83001
  createComponentOfType: "number",
82948
83002
  attributesToShadow: ["styleNumber"],
82949
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing(),
83003
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing(),
82950
83004
  returnWrappingComponents(prefix) {
82951
83005
  if (prefix === void 0) {
82952
83006
  return [
@@ -83074,7 +83128,7 @@ let Function$1 = class Function2 extends InlineComponent {
83074
83128
  shadowingInstructions: {
83075
83129
  createComponentOfType: "number",
83076
83130
  attributesToShadow: ["styleNumber"],
83077
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing(),
83131
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing(),
83078
83132
  returnWrappingComponents(prefix) {
83079
83133
  if (prefix === "extremum" || prefix === void 0) {
83080
83134
  return [
@@ -83456,7 +83510,7 @@ let Function$1 = class Function2 extends InlineComponent {
83456
83510
  stateVariable: "formula",
83457
83511
  componentType: "math",
83458
83512
  stateVariablesToShadow: Object.keys(
83459
- returnRoundingStateVariableDefinitions()
83513
+ returnNumberDisplayStateVariableDefinitions()
83460
83514
  )
83461
83515
  }
83462
83516
  ];
@@ -84439,7 +84493,7 @@ class FunctionOperator extends Function$1 {
84439
84493
  public: true,
84440
84494
  shadowingInstructions: {
84441
84495
  createComponentOfType: "math",
84442
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing()
84496
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing()
84443
84497
  },
84444
84498
  additionalStateVariablesDefined: ["operatorBasedOnFormula"],
84445
84499
  // stateVariablesDeterminingDependencies: ["operatorBasedOnFormulaIfAvailable"],
@@ -88187,7 +88241,7 @@ class ODESystem extends InlineComponent {
88187
88241
  defaultValue: Context.fromAst(0),
88188
88242
  public: true
88189
88243
  };
88190
- Object.assign(attributes, returnRoundingAttributes());
88244
+ Object.assign(attributes, returnNumberDisplayAttributes());
88191
88245
  attributes.renderMode = {
88192
88246
  createComponentOfType: "text",
88193
88247
  createStateVariable: "renderMode",
@@ -88245,7 +88299,7 @@ class ODESystem extends InlineComponent {
88245
88299
  let stateVariableDefinitions = super.returnStateVariableDefinitions();
88246
88300
  Object.assign(
88247
88301
  stateVariableDefinitions,
88248
- returnRoundingStateVariableDefinitions()
88302
+ returnNumberDisplayStateVariableDefinitions()
88249
88303
  );
88250
88304
  let selectedStyleDefinition = returnSelectedStyleStateVariableDefinition();
88251
88305
  Object.assign(stateVariableDefinitions, selectedStyleDefinition);
@@ -88367,7 +88421,7 @@ class ODESystem extends InlineComponent {
88367
88421
  public: true,
88368
88422
  shadowingInstructions: {
88369
88423
  createComponentOfType: "math",
88370
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing()
88424
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing()
88371
88425
  },
88372
88426
  entryPrefixes: ["rhs", "righthandside"],
88373
88427
  returnArraySizeDependencies: () => ({
@@ -88421,7 +88475,7 @@ class ODESystem extends InlineComponent {
88421
88475
  hasEssential: true,
88422
88476
  shadowingInstructions: {
88423
88477
  createComponentOfType: "math",
88424
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing()
88478
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing()
88425
88479
  },
88426
88480
  entryPrefixes: ["initialCondition"],
88427
88481
  defaultValueByArrayKey: () => Context.fromAst(0),
@@ -88555,6 +88609,10 @@ class ODESystem extends InlineComponent {
88555
88609
  dependencyType: "stateVariable",
88556
88610
  variableName: "padZeros"
88557
88611
  },
88612
+ avoidScientificNotation: {
88613
+ dependencyType: "stateVariable",
88614
+ variableName: "avoidScientificNotation"
88615
+ },
88558
88616
  independentVariable: {
88559
88617
  dependencyType: "stateVariable",
88560
88618
  variableName: "independentVariable"
@@ -88578,15 +88636,12 @@ class ODESystem extends InlineComponent {
88578
88636
  };
88579
88637
  },
88580
88638
  definition({ dependencyValues }) {
88581
- let params = {};
88582
- if (dependencyValues.padZeros) {
88583
- if (Number.isFinite(dependencyValues.displayDecimals)) {
88584
- params.padToDecimals = dependencyValues.displayDecimals;
88585
- }
88586
- if (dependencyValues.displayDigits >= 1) {
88587
- params.padToDigits = dependencyValues.displayDigits;
88588
- }
88589
- }
88639
+ let params = buildNumberDisplayParameters({
88640
+ padZeros: dependencyValues.padZeros,
88641
+ displayDigits: dependencyValues.displayDigits,
88642
+ displayDecimals: dependencyValues.displayDecimals,
88643
+ avoidScientificNotation: dependencyValues.avoidScientificNotation
88644
+ });
88590
88645
  let systemDisplay = [];
88591
88646
  let indVar = dependencyValues.independentVariable.toLatex();
88592
88647
  for (let dim = 0; dim < dependencyValues.numDimensions; dim++) {
@@ -88754,7 +88809,7 @@ class ODESystem extends InlineComponent {
88754
88809
  stateVariableToShadow: "numericalSolutionFDefinitions"
88755
88810
  }
88756
88811
  },
88757
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing()
88812
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing()
88758
88813
  },
88759
88814
  createWorkspace: true,
88760
88815
  returnArraySizeDependencies: () => ({
@@ -89809,7 +89864,7 @@ class Polyline extends GraphicalComponent {
89809
89864
  defaultValue: true,
89810
89865
  public: true
89811
89866
  };
89812
- Object.assign(attributes, returnRoundingAttributes());
89867
+ Object.assign(attributes, returnNumberDisplayAttributes());
89813
89868
  return attributes;
89814
89869
  }
89815
89870
  static returnChildGroups() {
@@ -89820,7 +89875,7 @@ class Polyline extends GraphicalComponent {
89820
89875
  let stateVariableDefinitions = super.returnStateVariableDefinitions();
89821
89876
  Object.assign(
89822
89877
  stateVariableDefinitions,
89823
- returnRoundingStateVariableDefinitions()
89878
+ returnNumberDisplayStateVariableDefinitions()
89824
89879
  );
89825
89880
  Object.assign(stateVariableDefinitions, returnStickyGroupDefinitions());
89826
89881
  stateVariableDefinitions.styleDescription = {
@@ -90395,7 +90450,7 @@ class Polyline extends GraphicalComponent {
90395
90450
  isLocation: true,
90396
90451
  shadowingInstructions: {
90397
90452
  createComponentOfType: "math",
90398
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing(),
90453
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing(),
90399
90454
  returnWrappingComponents(prefix) {
90400
90455
  if (prefix === "vertexX") {
90401
90456
  return [];
@@ -91077,7 +91132,7 @@ class Polyline extends GraphicalComponent {
91077
91132
  public: true,
91078
91133
  shadowingInstructions: {
91079
91134
  createComponentOfType: "number",
91080
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing()
91135
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing()
91081
91136
  },
91082
91137
  returnDependencies: () => ({
91083
91138
  numericalVertices: {
@@ -91105,7 +91160,7 @@ class Polyline extends GraphicalComponent {
91105
91160
  entryPrefixes: ["centerX"],
91106
91161
  shadowingInstructions: {
91107
91162
  createComponentOfType: "math",
91108
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing(),
91163
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing(),
91109
91164
  returnWrappingComponents(prefix) {
91110
91165
  if (prefix === "centerX") {
91111
91166
  return [];
@@ -91639,14 +91694,14 @@ class CobwebPolyline extends Polyline {
91639
91694
  attributes.defaultPoint = {
91640
91695
  createComponentOfType: "point"
91641
91696
  };
91642
- Object.assign(attributes, returnRoundingAttributes());
91697
+ Object.assign(attributes, returnNumberDisplayAttributes());
91643
91698
  return attributes;
91644
91699
  }
91645
91700
  static returnStateVariableDefinitions() {
91646
91701
  let stateVariableDefinitions = super.returnStateVariableDefinitions();
91647
91702
  Object.assign(
91648
91703
  stateVariableDefinitions,
91649
- returnRoundingStateVariableDefinitions()
91704
+ returnNumberDisplayStateVariableDefinitions()
91650
91705
  );
91651
91706
  stateVariableDefinitions.numDimensions.returnDependencies = () => ({});
91652
91707
  stateVariableDefinitions.numDimensions.definition = () => ({
@@ -91657,7 +91712,7 @@ class CobwebPolyline extends Polyline {
91657
91712
  public: true,
91658
91713
  shadowingInstructions: {
91659
91714
  createComponentOfType: "math",
91660
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing(),
91715
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing(),
91661
91716
  returnWrappingComponents(prefix) {
91662
91717
  if (prefix === "initialPointX") {
91663
91718
  return [];
@@ -92142,7 +92197,7 @@ class CobwebPolyline extends Polyline {
92142
92197
  public: true,
92143
92198
  shadowingInstructions: {
92144
92199
  createComponentOfType: "number",
92145
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing()
92200
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing()
92146
92201
  },
92147
92202
  additionalStateVariablesDefined: [
92148
92203
  {
@@ -92193,7 +92248,7 @@ class CobwebPolyline extends Polyline {
92193
92248
  public: true,
92194
92249
  shadowingInstructions: {
92195
92250
  createComponentOfType: "number",
92196
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing()
92251
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing()
92197
92252
  },
92198
92253
  additionalStateVariablesDefined: [
92199
92254
  {
@@ -92265,7 +92320,7 @@ class CobwebPolyline extends Polyline {
92265
92320
  public: true,
92266
92321
  shadowingInstructions: {
92267
92322
  createComponentOfType: "math",
92268
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing()
92323
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing()
92269
92324
  },
92270
92325
  entryPrefixes: ["iterateValue"],
92271
92326
  returnArraySizeDependencies: () => ({
@@ -92355,7 +92410,7 @@ class Point extends GraphicalComponent {
92355
92410
  attributes.coords = {
92356
92411
  createComponentOfType: "coords"
92357
92412
  };
92358
- Object.assign(attributes, returnRoundingAttributes());
92413
+ Object.assign(attributes, returnNumberDisplayAttributes());
92359
92414
  attributes.labelPosition = {
92360
92415
  createComponentOfType: "text",
92361
92416
  createStateVariable: "labelPosition",
@@ -92569,7 +92624,7 @@ class Point extends GraphicalComponent {
92569
92624
  let stateVariableDefinitions = super.returnStateVariableDefinitions();
92570
92625
  Object.assign(
92571
92626
  stateVariableDefinitions,
92572
- returnRoundingStateVariableDefinitions()
92627
+ returnNumberDisplayStateVariableDefinitions()
92573
92628
  );
92574
92629
  Object.assign(
92575
92630
  stateVariableDefinitions,
@@ -93055,7 +93110,7 @@ class Point extends GraphicalComponent {
93055
93110
  isLocation: true,
93056
93111
  shadowingInstructions: {
93057
93112
  createComponentOfType: "math",
93058
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing()
93113
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing()
93059
93114
  },
93060
93115
  isArray: true,
93061
93116
  entryPrefixes: ["x"],
@@ -93162,7 +93217,7 @@ class Point extends GraphicalComponent {
93162
93217
  isLocation: true,
93163
93218
  shadowingInstructions: {
93164
93219
  createComponentOfType: "coords",
93165
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing()
93220
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing()
93166
93221
  },
93167
93222
  returnDependencies: () => ({
93168
93223
  xs: {
@@ -93245,18 +93300,19 @@ class Point extends GraphicalComponent {
93245
93300
  padZeros: {
93246
93301
  dependencyType: "stateVariable",
93247
93302
  variableName: "padZeros"
93303
+ },
93304
+ avoidScientificNotation: {
93305
+ dependencyType: "stateVariable",
93306
+ variableName: "avoidScientificNotation"
93248
93307
  }
93249
93308
  }),
93250
93309
  definition: function({ dependencyValues }) {
93251
- let params = {};
93252
- if (dependencyValues.padZeros) {
93253
- if (Number.isFinite(dependencyValues.displayDecimals)) {
93254
- params.padToDecimals = dependencyValues.displayDecimals;
93255
- }
93256
- if (dependencyValues.displayDigits >= 1) {
93257
- params.padToDigits = dependencyValues.displayDigits;
93258
- }
93259
- }
93310
+ let params = buildNumberDisplayParameters({
93311
+ padZeros: dependencyValues.padZeros,
93312
+ displayDigits: dependencyValues.displayDigits,
93313
+ displayDecimals: dependencyValues.displayDecimals,
93314
+ avoidScientificNotation: dependencyValues.avoidScientificNotation
93315
+ });
93260
93316
  let latex = roundForDisplay({
93261
93317
  value: dependencyValues.coords,
93262
93318
  dependencyValues
@@ -93365,7 +93421,7 @@ class Point extends GraphicalComponent {
93365
93421
  {
93366
93422
  stateVariable: "coords",
93367
93423
  stateVariablesToShadow: [
93368
- ...Object.keys(returnRoundingStateVariableDefinitions()),
93424
+ ...Object.keys(returnNumberDisplayStateVariableDefinitions()),
93369
93425
  "inUnorderedList"
93370
93426
  ]
93371
93427
  }
@@ -93621,7 +93677,7 @@ class Line extends GraphicalComponent {
93621
93677
  attributes.variables = {
93622
93678
  createComponentOfType: "_variableNameList"
93623
93679
  };
93624
- Object.assign(attributes, returnRoundingAttributes());
93680
+ Object.assign(attributes, returnNumberDisplayAttributes());
93625
93681
  attributes.labelPosition = returnLineFamilyLabelPositionAttribute();
93626
93682
  return attributes;
93627
93683
  }
@@ -93641,7 +93697,7 @@ class Line extends GraphicalComponent {
93641
93697
  let stateVariableDefinitions = super.returnStateVariableDefinitions();
93642
93698
  Object.assign(
93643
93699
  stateVariableDefinitions,
93644
- returnRoundingStateVariableDefinitions()
93700
+ returnNumberDisplayStateVariableDefinitions()
93645
93701
  );
93646
93702
  let styleDescriptionDefinitions = returnTextStyleDescriptionDefinitions();
93647
93703
  Object.assign(stateVariableDefinitions, styleDescriptionDefinitions);
@@ -94037,7 +94093,7 @@ class Line extends GraphicalComponent {
94037
94093
  isLocation: true,
94038
94094
  shadowingInstructions: {
94039
94095
  createComponentOfType: "math",
94040
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing(),
94096
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing(),
94041
94097
  returnWrappingComponents(prefix) {
94042
94098
  if (prefix === "pointX") {
94043
94099
  return [];
@@ -94562,7 +94618,7 @@ class Line extends GraphicalComponent {
94562
94618
  isLocation: true,
94563
94619
  shadowingInstructions: {
94564
94620
  createComponentOfType: "math",
94565
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing()
94621
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing()
94566
94622
  },
94567
94623
  stateVariablesDeterminingDependencies: ["equationIdentity"],
94568
94624
  additionalStateVariablesDefined: [
@@ -94571,7 +94627,7 @@ class Line extends GraphicalComponent {
94571
94627
  public: true,
94572
94628
  shadowingInstructions: {
94573
94629
  createComponentOfType: "math",
94574
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing()
94630
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing()
94575
94631
  }
94576
94632
  },
94577
94633
  {
@@ -94579,7 +94635,7 @@ class Line extends GraphicalComponent {
94579
94635
  public: true,
94580
94636
  shadowingInstructions: {
94581
94637
  createComponentOfType: "math",
94582
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing()
94638
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing()
94583
94639
  }
94584
94640
  },
94585
94641
  {
@@ -94587,7 +94643,7 @@ class Line extends GraphicalComponent {
94587
94643
  public: true,
94588
94644
  shadowingInstructions: {
94589
94645
  createComponentOfType: "math",
94590
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing()
94646
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing()
94591
94647
  }
94592
94648
  }
94593
94649
  ],
@@ -94937,7 +94993,7 @@ class Line extends GraphicalComponent {
94937
94993
  isLocation: true,
94938
94994
  shadowingInstructions: {
94939
94995
  createComponentOfType: "math",
94940
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing()
94996
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing()
94941
94997
  },
94942
94998
  returnDependencies: () => ({
94943
94999
  coeffvar1: {
@@ -94962,7 +95018,7 @@ class Line extends GraphicalComponent {
94962
95018
  isLocation: true,
94963
95019
  shadowingInstructions: {
94964
95020
  createComponentOfType: "math",
94965
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing()
95021
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing()
94966
95022
  },
94967
95023
  returnDependencies: () => ({
94968
95024
  coeff0: {
@@ -94988,7 +95044,7 @@ class Line extends GraphicalComponent {
94988
95044
  isLocation: true,
94989
95045
  shadowingInstructions: {
94990
95046
  createComponentOfType: "math",
94991
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing()
95047
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing()
94992
95048
  },
94993
95049
  returnDependencies: () => ({
94994
95050
  coeff0: {
@@ -95054,18 +95110,19 @@ class Line extends GraphicalComponent {
95054
95110
  padZeros: {
95055
95111
  dependencyType: "stateVariable",
95056
95112
  variableName: "padZeros"
95113
+ },
95114
+ avoidScientificNotation: {
95115
+ dependencyType: "stateVariable",
95116
+ variableName: "avoidScientificNotation"
95057
95117
  }
95058
95118
  }),
95059
95119
  definition: function({ dependencyValues }) {
95060
- let params = {};
95061
- if (dependencyValues.padZeros) {
95062
- if (Number.isFinite(dependencyValues.displayDecimals)) {
95063
- params.padToDecimals = dependencyValues.displayDecimals;
95064
- }
95065
- if (dependencyValues.displayDigits >= 1) {
95066
- params.padToDigits = dependencyValues.displayDigits;
95067
- }
95068
- }
95120
+ let params = buildNumberDisplayParameters({
95121
+ padZeros: dependencyValues.padZeros,
95122
+ displayDigits: dependencyValues.displayDigits,
95123
+ displayDecimals: dependencyValues.displayDecimals,
95124
+ avoidScientificNotation: dependencyValues.avoidScientificNotation
95125
+ });
95069
95126
  let latex = roundForDisplay({
95070
95127
  value: dependencyValues.equation,
95071
95128
  dependencyValues
@@ -95098,18 +95155,19 @@ class Line extends GraphicalComponent {
95098
95155
  padZeros: {
95099
95156
  dependencyType: "stateVariable",
95100
95157
  variableName: "padZeros"
95158
+ },
95159
+ avoidScientificNotation: {
95160
+ dependencyType: "stateVariable",
95161
+ variableName: "avoidScientificNotation"
95101
95162
  }
95102
95163
  }),
95103
95164
  definition: function({ dependencyValues }) {
95104
- let params = {};
95105
- if (dependencyValues.padZeros) {
95106
- if (Number.isFinite(dependencyValues.displayDecimals)) {
95107
- params.padToDecimals = dependencyValues.displayDecimals;
95108
- }
95109
- if (dependencyValues.displayDigits >= 1) {
95110
- params.padToDigits = dependencyValues.displayDigits;
95111
- }
95112
- }
95165
+ let params = buildNumberDisplayParameters({
95166
+ padZeros: dependencyValues.padZeros,
95167
+ displayDigits: dependencyValues.displayDigits,
95168
+ displayDecimals: dependencyValues.displayDecimals,
95169
+ avoidScientificNotation: dependencyValues.avoidScientificNotation
95170
+ });
95113
95171
  let text = roundForDisplay({
95114
95172
  value: dependencyValues.equation,
95115
95173
  dependencyValues
@@ -95181,14 +95239,14 @@ class Line extends GraphicalComponent {
95181
95239
  {
95182
95240
  stateVariable: "equation",
95183
95241
  stateVariablesToShadow: Object.keys(
95184
- returnRoundingStateVariableDefinitions()
95242
+ returnNumberDisplayStateVariableDefinitions()
95185
95243
  )
95186
95244
  },
95187
95245
  {
95188
95246
  stateVariable: "parallelCoords",
95189
95247
  componentType: "_directionComponent",
95190
95248
  stateVariablesToShadow: Object.keys(
95191
- returnRoundingStateVariableDefinitions()
95249
+ returnNumberDisplayStateVariableDefinitions()
95192
95250
  )
95193
95251
  }
95194
95252
  ];
@@ -95731,7 +95789,7 @@ class Curve extends GraphicalComponent {
95731
95789
  createStateVariable: "nearestPointAsCurvePrelim",
95732
95790
  defaultValue: false
95733
95791
  };
95734
- Object.assign(attributes, returnRoundingAttributes());
95792
+ Object.assign(attributes, returnNumberDisplayAttributes());
95735
95793
  return attributes;
95736
95794
  }
95737
95795
  // Include children that can be added due to sugar
@@ -95815,7 +95873,7 @@ class Curve extends GraphicalComponent {
95815
95873
  );
95816
95874
  Object.assign(
95817
95875
  stateVariableDefinitions,
95818
- returnRoundingStateVariableDefinitions()
95876
+ returnNumberDisplayStateVariableDefinitions()
95819
95877
  );
95820
95878
  stateVariableDefinitions.styleDescription = {
95821
95879
  public: true,
@@ -95979,7 +96037,7 @@ class Curve extends GraphicalComponent {
95979
96037
  isLocation: true,
95980
96038
  shadowingInstructions: {
95981
96039
  createComponentOfType: "number",
95982
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing()
96040
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing()
95983
96041
  },
95984
96042
  forRenderer: true,
95985
96043
  returnDependencies: () => ({
@@ -96083,7 +96141,7 @@ class Curve extends GraphicalComponent {
96083
96141
  public: true,
96084
96142
  shadowingInstructions: {
96085
96143
  createComponentOfType: "number",
96086
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing()
96144
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing()
96087
96145
  },
96088
96146
  returnDependencies: () => ({
96089
96147
  curveType: {
@@ -96249,7 +96307,7 @@ class Curve extends GraphicalComponent {
96249
96307
  isLocation: true,
96250
96308
  shadowingInstructions: {
96251
96309
  createComponentOfType: "math",
96252
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing(),
96310
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing(),
96253
96311
  returnWrappingComponents(prefix) {
96254
96312
  if (prefix === "throughPointX") {
96255
96313
  return [];
@@ -96637,7 +96695,7 @@ class Curve extends GraphicalComponent {
96637
96695
  isLocation: true,
96638
96696
  shadowingInstructions: {
96639
96697
  createComponentOfType: "math",
96640
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing(),
96698
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing(),
96641
96699
  returnWrappingComponents(prefix) {
96642
96700
  if (prefix === "controlVectorX") {
96643
96701
  return [];
@@ -96986,7 +97044,7 @@ class Curve extends GraphicalComponent {
96986
97044
  isLocation: true,
96987
97045
  shadowingInstructions: {
96988
97046
  createComponentOfType: "math",
96989
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing(),
97047
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing(),
96990
97048
  returnWrappingComponents(prefix) {
96991
97049
  if (prefix === "controlPointX") {
96992
97050
  return [];
@@ -97674,7 +97732,7 @@ class Curve extends GraphicalComponent {
97674
97732
  stateVariableToShadow: "domainForFunctions"
97675
97733
  }
97676
97734
  },
97677
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing()
97735
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing()
97678
97736
  },
97679
97737
  returnArraySizeDependencies: () => ({
97680
97738
  functionChildren: {
@@ -97965,7 +98023,7 @@ class Curve extends GraphicalComponent {
97965
98023
  public: true,
97966
98024
  shadowingInstructions: {
97967
98025
  createComponentOfType: "number",
97968
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing(),
98026
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing(),
97969
98027
  returnWrappingComponents(prefix) {
97970
98028
  if (prefix === "xCriticalPointX") {
97971
98029
  return [];
@@ -98172,7 +98230,7 @@ class Curve extends GraphicalComponent {
98172
98230
  public: true,
98173
98231
  shadowingInstructions: {
98174
98232
  createComponentOfType: "number",
98175
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing(),
98233
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing(),
98176
98234
  returnWrappingComponents(prefix) {
98177
98235
  if (prefix === "yCriticalPointX") {
98178
98236
  return [];
@@ -98380,7 +98438,7 @@ class Curve extends GraphicalComponent {
98380
98438
  public: true,
98381
98439
  shadowingInstructions: {
98382
98440
  createComponentOfType: "number",
98383
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing(),
98441
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing(),
98384
98442
  returnWrappingComponents(prefix) {
98385
98443
  if (prefix === "curvatureChangePointX") {
98386
98444
  return [];
@@ -101631,14 +101689,14 @@ class Atom extends InlineComponent {
101631
101689
  attributes.atomicNumber = {
101632
101690
  createComponentOfType: "integer"
101633
101691
  };
101634
- Object.assign(attributes, returnRoundingAttributes());
101692
+ Object.assign(attributes, returnNumberDisplayAttributes());
101635
101693
  return attributes;
101636
101694
  }
101637
101695
  static returnStateVariableDefinitions() {
101638
101696
  let stateVariableDefinitions = super.returnStateVariableDefinitions();
101639
101697
  Object.assign(
101640
101698
  stateVariableDefinitions,
101641
- returnRoundingStateVariableDefinitions()
101699
+ returnNumberDisplayStateVariableDefinitions()
101642
101700
  );
101643
101701
  let selectedStyleDefinition = returnSelectedStyleStateVariableDefinition();
101644
101702
  Object.assign(stateVariableDefinitions, selectedStyleDefinition);
@@ -101786,7 +101844,7 @@ class Atom extends InlineComponent {
101786
101844
  public: true,
101787
101845
  shadowingInstructions: {
101788
101846
  createComponentOfType: "number",
101789
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing()
101847
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing()
101790
101848
  },
101791
101849
  returnDependencies: () => ({
101792
101850
  dataForAtom: {
@@ -101913,7 +101971,7 @@ class Atom extends InlineComponent {
101913
101971
  public: true,
101914
101972
  shadowingInstructions: {
101915
101973
  createComponentOfType: "number",
101916
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing()
101974
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing()
101917
101975
  },
101918
101976
  returnDependencies: () => ({
101919
101977
  dataForAtom: {
@@ -101935,7 +101993,7 @@ class Atom extends InlineComponent {
101935
101993
  public: true,
101936
101994
  shadowingInstructions: {
101937
101995
  createComponentOfType: "number",
101938
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing()
101996
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing()
101939
101997
  },
101940
101998
  returnDependencies: () => ({
101941
101999
  dataForAtom: {
@@ -101957,7 +102015,7 @@ class Atom extends InlineComponent {
101957
102015
  public: true,
101958
102016
  shadowingInstructions: {
101959
102017
  createComponentOfType: "number",
101960
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing()
102018
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing()
101961
102019
  },
101962
102020
  returnDependencies: () => ({
101963
102021
  dataForAtom: {
@@ -102000,7 +102058,7 @@ class Atom extends InlineComponent {
102000
102058
  public: true,
102001
102059
  shadowingInstructions: {
102002
102060
  createComponentOfType: "number",
102003
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing()
102061
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing()
102004
102062
  },
102005
102063
  returnDependencies: () => ({
102006
102064
  dataForAtom: {
@@ -102022,7 +102080,7 @@ class Atom extends InlineComponent {
102022
102080
  public: true,
102023
102081
  shadowingInstructions: {
102024
102082
  createComponentOfType: "number",
102025
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing()
102083
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing()
102026
102084
  },
102027
102085
  returnDependencies: () => ({
102028
102086
  dataForAtom: {
@@ -107583,7 +107641,7 @@ class MatrixInput extends Input {
107583
107641
  defaultValue: false,
107584
107642
  public: true
107585
107643
  };
107586
- Object.assign(attributes, returnRoundingAttributes());
107644
+ Object.assign(attributes, returnNumberDisplayAttributes());
107587
107645
  attributes.bindValueTo = {
107588
107646
  createComponentOfType: "math"
107589
107647
  };
@@ -107661,7 +107719,7 @@ class MatrixInput extends Input {
107661
107719
  let stateVariableDefinitions = super.returnStateVariableDefinitions();
107662
107720
  Object.assign(
107663
107721
  stateVariableDefinitions,
107664
- returnRoundingStateVariableDefinitions({
107722
+ returnNumberDisplayStateVariableDefinitions({
107665
107723
  displayDigitsDefault: 10,
107666
107724
  displaySmallAsZeroDefault: 0
107667
107725
  })
@@ -109032,7 +109090,7 @@ class MatrixInput extends Input {
109032
109090
  public: true,
109033
109091
  shadowingInstructions: {
109034
109092
  createComponentOfType: "math",
109035
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing()
109093
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing()
109036
109094
  },
109037
109095
  returnDependencies: () => ({
109038
109096
  componentValues: {
@@ -109147,7 +109205,7 @@ class MatrixInput extends Input {
109147
109205
  public: true,
109148
109206
  shadowingInstructions: {
109149
109207
  createComponentOfType: "math",
109150
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing()
109208
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing()
109151
109209
  },
109152
109210
  returnDependencies: () => ({
109153
109211
  componentImmediateValues: {
@@ -109259,7 +109317,6 @@ class MatrixInput extends Input {
109259
109317
  }
109260
109318
  };
109261
109319
  stateVariableDefinitions.valueForDisplay = {
109262
- forRenderer: true,
109263
109320
  returnDependencies: () => ({
109264
109321
  value: {
109265
109322
  dependencyType: "stateVariable",
@@ -109297,12 +109354,34 @@ class MatrixInput extends Input {
109297
109354
  valueForDisplay: {
109298
109355
  dependencyType: "stateVariable",
109299
109356
  variableName: "valueForDisplay"
109357
+ },
109358
+ padZeros: {
109359
+ dependencyType: "stateVariable",
109360
+ variableName: "padZeros"
109361
+ },
109362
+ displayDigits: {
109363
+ dependencyType: "stateVariable",
109364
+ variableName: "displayDigits"
109365
+ },
109366
+ displayDecimals: {
109367
+ dependencyType: "stateVariable",
109368
+ variableName: "displayDecimals"
109369
+ },
109370
+ avoidScientificNotation: {
109371
+ dependencyType: "stateVariable",
109372
+ variableName: "avoidScientificNotation"
109300
109373
  }
109301
109374
  }),
109302
109375
  definition: function({ dependencyValues }) {
109376
+ let params = buildNumberDisplayParameters({
109377
+ padZeros: dependencyValues.padZeros,
109378
+ displayDigits: dependencyValues.displayDigits,
109379
+ displayDecimals: dependencyValues.displayDecimals,
109380
+ avoidScientificNotation: dependencyValues.avoidScientificNotation
109381
+ });
109303
109382
  return {
109304
109383
  setValue: {
109305
- text: dependencyValues.valueForDisplay.toString()
109384
+ text: dependencyValues.valueForDisplay.toString(params)
109306
109385
  }
109307
109386
  };
109308
109387
  }
@@ -109311,7 +109390,7 @@ class MatrixInput extends Input {
109311
109390
  public: true,
109312
109391
  shadowingInstructions: {
109313
109392
  createComponentOfType: "math",
109314
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing(),
109393
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing(),
109315
109394
  returnWrappingComponents(prefix) {
109316
109395
  if (prefix === "matrixEntry") {
109317
109396
  return [];
@@ -109694,7 +109773,7 @@ class MatrixInput extends Input {
109694
109773
  {
109695
109774
  stateVariable: "value",
109696
109775
  stateVariablesToShadow: Object.keys(
109697
- returnRoundingStateVariableDefinitions()
109776
+ returnNumberDisplayStateVariableDefinitions()
109698
109777
  )
109699
109778
  }
109700
109779
  ];
@@ -110174,6 +110253,38 @@ class MatrixComponentInput extends BaseComponent {
110174
110253
  };
110175
110254
  }
110176
110255
  };
110256
+ stateVariableDefinitions.padZeros = {
110257
+ returnDependencies: () => ({
110258
+ parentPadZeros: {
110259
+ dependencyType: "parentStateVariable",
110260
+ parentComponentType: "matrixInput",
110261
+ variableName: "padZeros"
110262
+ }
110263
+ }),
110264
+ definition({ dependencyValues }) {
110265
+ return {
110266
+ setValue: {
110267
+ padZeros: dependencyValues.parentPadZeros
110268
+ }
110269
+ };
110270
+ }
110271
+ };
110272
+ stateVariableDefinitions.avoidScientificNotation = {
110273
+ returnDependencies: () => ({
110274
+ parentAvoidScientificNotation: {
110275
+ dependencyType: "parentStateVariable",
110276
+ parentComponentType: "matrixInput",
110277
+ variableName: "avoidScientificNotation"
110278
+ }
110279
+ }),
110280
+ definition({ dependencyValues }) {
110281
+ return {
110282
+ setValue: {
110283
+ avoidScientificNotation: dependencyValues.parentAvoidScientificNotation
110284
+ }
110285
+ };
110286
+ }
110287
+ };
110177
110288
  stateVariableDefinitions.unionFromU = {
110178
110289
  returnDependencies: () => ({
110179
110290
  parentUnionFromU: {
@@ -110270,7 +110381,6 @@ class MatrixComponentInput extends BaseComponent {
110270
110381
  }
110271
110382
  };
110272
110383
  stateVariableDefinitions.valueForDisplay = {
110273
- forRenderer: true,
110274
110384
  returnDependencies: () => ({
110275
110385
  value: {
110276
110386
  dependencyType: "stateVariable",
@@ -110308,12 +110418,34 @@ class MatrixComponentInput extends BaseComponent {
110308
110418
  valueForDisplay: {
110309
110419
  dependencyType: "stateVariable",
110310
110420
  variableName: "valueForDisplay"
110421
+ },
110422
+ padZeros: {
110423
+ dependencyType: "stateVariable",
110424
+ variableName: "padZeros"
110425
+ },
110426
+ displayDigits: {
110427
+ dependencyType: "stateVariable",
110428
+ variableName: "displayDigits"
110429
+ },
110430
+ displayDecimals: {
110431
+ dependencyType: "stateVariable",
110432
+ variableName: "displayDecimals"
110433
+ },
110434
+ avoidScientificNotation: {
110435
+ dependencyType: "stateVariable",
110436
+ variableName: "avoidScientificNotation"
110311
110437
  }
110312
110438
  }),
110313
110439
  definition: function({ dependencyValues }) {
110440
+ let params = buildNumberDisplayParameters({
110441
+ padZeros: dependencyValues.padZeros,
110442
+ displayDigits: dependencyValues.displayDigits,
110443
+ displayDecimals: dependencyValues.displayDecimals,
110444
+ avoidScientificNotation: dependencyValues.avoidScientificNotation
110445
+ });
110314
110446
  return {
110315
110447
  setValue: {
110316
- text: dependencyValues.valueForDisplay.toString()
110448
+ text: dependencyValues.valueForDisplay.toString(params)
110317
110449
  }
110318
110450
  };
110319
110451
  }
@@ -112320,7 +112452,7 @@ class NumberList extends CompositeComponent {
112320
112452
  createStateVariable: "asList",
112321
112453
  defaultValue: true
112322
112454
  };
112323
- for (let attrName in returnRoundingAttributes()) {
112455
+ for (let attrName in returnNumberDisplayAttributes()) {
112324
112456
  attributes[attrName] = {
112325
112457
  leaveRaw: true
112326
112458
  };
@@ -112731,7 +112863,7 @@ class NumberList extends CompositeComponent {
112731
112863
  let diagnostics = [];
112732
112864
  let replacements = [];
112733
112865
  let componentsCopied = [];
112734
- let attributesToConvert = gatherRawRoundingFixedResponseAttributes(
112866
+ let attributesToConvert = gatherRawNumberDisplayFixedResponseAttributes(
112735
112867
  component,
112736
112868
  components
112737
112869
  );
@@ -112762,7 +112894,7 @@ class NumberList extends CompositeComponent {
112762
112894
  nComponents = res.nComponents;
112763
112895
  }
112764
112896
  if (copyChildSource) {
112765
- nComponents = addShadowRoundingAttributes({
112897
+ nComponents = addShadowNumberDisplayAttributes({
112766
112898
  nComponents,
112767
112899
  stateIdInfo,
112768
112900
  source: copyChildSource,
@@ -114154,7 +114286,7 @@ class LineSegment extends GraphicalComponent {
114154
114286
  forRenderer: true
114155
114287
  };
114156
114288
  attributes.labelPosition = returnLineFamilyLabelPositionAttribute();
114157
- Object.assign(attributes, returnRoundingAttributes());
114289
+ Object.assign(attributes, returnNumberDisplayAttributes());
114158
114290
  attributes.controlOrder = returnGraphControlOrderAttribute();
114159
114291
  return attributes;
114160
114292
  }
@@ -114162,7 +114294,7 @@ class LineSegment extends GraphicalComponent {
114162
114294
  let stateVariableDefinitions = super.returnStateVariableDefinitions();
114163
114295
  Object.assign(
114164
114296
  stateVariableDefinitions,
114165
- returnRoundingStateVariableDefinitions()
114297
+ returnNumberDisplayStateVariableDefinitions()
114166
114298
  );
114167
114299
  Object.assign(stateVariableDefinitions, returnStickyGroupDefinitions());
114168
114300
  stateVariableDefinitions.styleDescription = {
@@ -114441,7 +114573,7 @@ class LineSegment extends GraphicalComponent {
114441
114573
  isLocation: true,
114442
114574
  shadowingInstructions: {
114443
114575
  createComponentOfType: "math",
114444
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing(),
114576
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing(),
114445
114577
  returnWrappingComponents(prefix) {
114446
114578
  if (prefix === "endpointX") {
114447
114579
  return [];
@@ -114712,7 +114844,7 @@ class LineSegment extends GraphicalComponent {
114712
114844
  isLocation: true,
114713
114845
  shadowingInstructions: {
114714
114846
  createComponentOfType: "math",
114715
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing()
114847
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing()
114716
114848
  },
114717
114849
  returnDependencies: () => ({
114718
114850
  numDimensions: {
@@ -114972,7 +115104,7 @@ class LineSegment extends GraphicalComponent {
114972
115104
  isLocation: true,
114973
115105
  shadowingInstructions: {
114974
115106
  createComponentOfType: "number",
114975
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing()
115107
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing()
114976
115108
  },
114977
115109
  returnDependencies: () => ({
114978
115110
  numericalEndpoints: {
@@ -115000,7 +115132,7 @@ class LineSegment extends GraphicalComponent {
115000
115132
  stateVariable: "parallelCoords",
115001
115133
  componentType: "_directionComponent",
115002
115134
  stateVariablesToShadow: Object.keys(
115003
- returnRoundingStateVariableDefinitions()
115135
+ returnNumberDisplayStateVariableDefinitions()
115004
115136
  )
115005
115137
  }
115006
115138
  ];
@@ -115244,14 +115376,14 @@ class Ray extends GraphicalComponent {
115244
115376
  createComponentOfType: "vector"
115245
115377
  };
115246
115378
  attributes.labelPosition = returnLineFamilyLabelPositionAttribute();
115247
- Object.assign(attributes, returnRoundingAttributes());
115379
+ Object.assign(attributes, returnNumberDisplayAttributes());
115248
115380
  return attributes;
115249
115381
  }
115250
115382
  static returnStateVariableDefinitions() {
115251
115383
  let stateVariableDefinitions = super.returnStateVariableDefinitions();
115252
115384
  Object.assign(
115253
115385
  stateVariableDefinitions,
115254
- returnRoundingStateVariableDefinitions()
115386
+ returnNumberDisplayStateVariableDefinitions()
115255
115387
  );
115256
115388
  stateVariableDefinitions.styleDescription = {
115257
115389
  public: true,
@@ -115822,7 +115954,7 @@ class Ray extends GraphicalComponent {
115822
115954
  isLocation: true,
115823
115955
  shadowingInstructions: {
115824
115956
  createComponentOfType: "math",
115825
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing(),
115957
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing(),
115826
115958
  returnWrappingComponents(prefix) {
115827
115959
  if (prefix === "directionX") {
115828
115960
  return [];
@@ -116003,7 +116135,7 @@ class Ray extends GraphicalComponent {
116003
116135
  isLocation: true,
116004
116136
  shadowingInstructions: {
116005
116137
  createComponentOfType: "math",
116006
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing(),
116138
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing(),
116007
116139
  returnWrappingComponents(prefix) {
116008
116140
  if (prefix === "throughX") {
116009
116141
  return [];
@@ -116156,7 +116288,7 @@ class Ray extends GraphicalComponent {
116156
116288
  isLocation: true,
116157
116289
  shadowingInstructions: {
116158
116290
  createComponentOfType: "math",
116159
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing(),
116291
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing(),
116160
116292
  returnWrappingComponents(prefix) {
116161
116293
  if (prefix === "endpointX") {
116162
116294
  return [];
@@ -116491,7 +116623,7 @@ class Ray extends GraphicalComponent {
116491
116623
  stateVariable: "directionCoords",
116492
116624
  componentType: "_directionComponent",
116493
116625
  stateVariablesToShadow: Object.keys(
116494
- returnRoundingStateVariableDefinitions()
116626
+ returnNumberDisplayStateVariableDefinitions()
116495
116627
  )
116496
116628
  }
116497
116629
  ];
@@ -116962,7 +117094,7 @@ class Polygon extends Polyline {
116962
117094
  public: true,
116963
117095
  shadowingInstructions: {
116964
117096
  createComponentOfType: "number",
116965
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing()
117097
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing()
116966
117098
  },
116967
117099
  returnDependencies: () => ({
116968
117100
  numericalVertices: {
@@ -116986,7 +117118,7 @@ class Polygon extends Polyline {
116986
117118
  public: true,
116987
117119
  shadowingInstructions: {
116988
117120
  createComponentOfType: "number",
116989
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing()
117121
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing()
116990
117122
  },
116991
117123
  returnDependencies: () => ({
116992
117124
  numericalVertices: {
@@ -117602,7 +117734,7 @@ class Rectangle extends Polygon {
117602
117734
  entryPrefixes: ["centerX"],
117603
117735
  shadowingInstructions: {
117604
117736
  createComponentOfType: "math",
117605
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing(),
117737
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing(),
117606
117738
  returnWrappingComponents(prefix) {
117607
117739
  if (prefix === "centerX") {
117608
117740
  return [];
@@ -117684,7 +117816,7 @@ class Rectangle extends Polygon {
117684
117816
  isLocation: true,
117685
117817
  shadowingInstructions: {
117686
117818
  createComponentOfType: "number",
117687
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing()
117819
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing()
117688
117820
  },
117689
117821
  returnDependencies() {
117690
117822
  return {
@@ -117735,7 +117867,7 @@ class Rectangle extends Polygon {
117735
117867
  isLocation: true,
117736
117868
  shadowingInstructions: {
117737
117869
  createComponentOfType: "number",
117738
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing()
117870
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing()
117739
117871
  },
117740
117872
  returnDependencies() {
117741
117873
  return {
@@ -117786,7 +117918,7 @@ class Rectangle extends Polygon {
117786
117918
  isLocation: true,
117787
117919
  shadowingInstructions: {
117788
117920
  createComponentOfType: "math",
117789
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing(),
117921
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing(),
117790
117922
  returnWrappingComponents(prefix) {
117791
117923
  if (prefix === "vertexX") {
117792
117924
  return [];
@@ -119992,7 +120124,7 @@ class RegularPolygon extends Polygon {
119992
120124
  entryPrefixes: ["centerX"],
119993
120125
  shadowingInstructions: {
119994
120126
  createComponentOfType: "math",
119995
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing(),
120127
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing(),
119996
120128
  returnWrappingComponents(prefix) {
119997
120129
  if (prefix === "centerX") {
119998
120130
  return [];
@@ -120084,7 +120216,7 @@ class RegularPolygon extends Polygon {
120084
120216
  public: true,
120085
120217
  shadowingInstructions: {
120086
120218
  createComponentOfType: "number",
120087
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing()
120219
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing()
120088
120220
  },
120089
120221
  returnDependencies: () => ({
120090
120222
  center: {
@@ -120153,7 +120285,7 @@ class RegularPolygon extends Polygon {
120153
120285
  public: true,
120154
120286
  shadowingInstructions: {
120155
120287
  createComponentOfType: "number",
120156
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing()
120288
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing()
120157
120289
  },
120158
120290
  returnDependencies: () => ({
120159
120291
  circumradius: {
@@ -120198,7 +120330,7 @@ class RegularPolygon extends Polygon {
120198
120330
  public: true,
120199
120331
  shadowingInstructions: {
120200
120332
  createComponentOfType: "number",
120201
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing()
120333
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing()
120202
120334
  },
120203
120335
  returnDependencies: () => ({
120204
120336
  circumradius: {
@@ -120239,7 +120371,7 @@ class RegularPolygon extends Polygon {
120239
120371
  public: true,
120240
120372
  shadowingInstructions: {
120241
120373
  createComponentOfType: "number",
120242
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing()
120374
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing()
120243
120375
  },
120244
120376
  returnDependencies: () => ({
120245
120377
  circumradius: {
@@ -120280,7 +120412,7 @@ class RegularPolygon extends Polygon {
120280
120412
  public: true,
120281
120413
  shadowingInstructions: {
120282
120414
  createComponentOfType: "number",
120283
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing()
120415
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing()
120284
120416
  },
120285
120417
  returnDependencies: () => ({
120286
120418
  circumradius: {
@@ -120729,7 +120861,7 @@ class Circle extends Curve {
120729
120861
  let stateVariableDefinitions = GraphicalComponent.returnStateVariableDefinitions(numerics);
120730
120862
  Object.assign(
120731
120863
  stateVariableDefinitions,
120732
- returnRoundingStateVariableDefinitions()
120864
+ returnNumberDisplayStateVariableDefinitions()
120733
120865
  );
120734
120866
  stateVariableDefinitions.styleDescription = {
120735
120867
  public: true,
@@ -121017,7 +121149,7 @@ class Circle extends Curve {
121017
121149
  isLocation: true,
121018
121150
  shadowingInstructions: {
121019
121151
  createComponentOfType: "math",
121020
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing(),
121152
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing(),
121021
121153
  returnWrappingComponents(prefix) {
121022
121154
  if (prefix === "throughPointX") {
121023
121155
  return [];
@@ -122304,7 +122436,7 @@ class Circle extends Curve {
122304
122436
  isLocation: true,
122305
122437
  shadowingInstructions: {
122306
122438
  createComponentOfType: "math",
122307
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing()
122439
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing()
122308
122440
  },
122309
122441
  stateVariablesDeterminingDependencies: [
122310
122442
  "numThroughPoints",
@@ -122484,7 +122616,7 @@ class Circle extends Curve {
122484
122616
  isLocation: true,
122485
122617
  shadowingInstructions: {
122486
122618
  createComponentOfType: "math",
122487
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing()
122619
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing()
122488
122620
  },
122489
122621
  returnDependencies: () => ({
122490
122622
  radius: {
@@ -122518,7 +122650,7 @@ class Circle extends Curve {
122518
122650
  public: true,
122519
122651
  shadowingInstructions: {
122520
122652
  createComponentOfType: "math",
122521
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing()
122653
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing()
122522
122654
  },
122523
122655
  returnDependencies: () => ({
122524
122656
  radius: {
@@ -122538,7 +122670,7 @@ class Circle extends Curve {
122538
122670
  public: true,
122539
122671
  shadowingInstructions: {
122540
122672
  createComponentOfType: "math",
122541
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing()
122673
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing()
122542
122674
  },
122543
122675
  returnDependencies: () => ({
122544
122676
  radius: {
@@ -122560,7 +122692,7 @@ class Circle extends Curve {
122560
122692
  public: true,
122561
122693
  shadowingInstructions: {
122562
122694
  createComponentOfType: "math",
122563
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing(),
122695
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing(),
122564
122696
  returnWrappingComponents(prefix) {
122565
122697
  if (prefix === "centerX") {
122566
122698
  return [];
@@ -123275,7 +123407,7 @@ class Parabola extends Curve {
123275
123407
  let stateVariableDefinitions = GraphicalComponent.returnStateVariableDefinitions(numerics);
123276
123408
  Object.assign(
123277
123409
  stateVariableDefinitions,
123278
- returnRoundingStateVariableDefinitions()
123410
+ returnNumberDisplayStateVariableDefinitions()
123279
123411
  );
123280
123412
  let curveStateVariableDefinitions = super.returnStateVariableDefinitions(numerics);
123281
123413
  stateVariableDefinitions.graphXmin = curveStateVariableDefinitions.graphXmin;
@@ -123305,7 +123437,7 @@ class Parabola extends Curve {
123305
123437
  public: true,
123306
123438
  shadowingInstructions: {
123307
123439
  createComponentOfType: "number",
123308
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing()
123440
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing()
123309
123441
  },
123310
123442
  forRenderer: true,
123311
123443
  returnDependencies: () => ({}),
@@ -123315,7 +123447,7 @@ class Parabola extends Curve {
123315
123447
  public: true,
123316
123448
  shadowingInstructions: {
123317
123449
  createComponentOfType: "number",
123318
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing()
123450
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing()
123319
123451
  },
123320
123452
  forRenderer: true,
123321
123453
  returnDependencies: () => ({}),
@@ -123370,7 +123502,7 @@ class Parabola extends Curve {
123370
123502
  isLocation: true,
123371
123503
  shadowingInstructions: {
123372
123504
  createComponentOfType: "math",
123373
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing(),
123505
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing(),
123374
123506
  returnWrappingComponents(prefix) {
123375
123507
  if (prefix === "throughPointX") {
123376
123508
  return [];
@@ -123651,7 +123783,7 @@ class Parabola extends Curve {
123651
123783
  isLocation: true,
123652
123784
  shadowingInstructions: {
123653
123785
  createComponentOfType: "number",
123654
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing()
123786
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing()
123655
123787
  },
123656
123788
  additionalStateVariablesDefined: [
123657
123789
  {
@@ -123659,7 +123791,7 @@ class Parabola extends Curve {
123659
123791
  public: true,
123660
123792
  shadowingInstructions: {
123661
123793
  createComponentOfType: "number",
123662
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing()
123794
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing()
123663
123795
  },
123664
123796
  hasEssential: true,
123665
123797
  defaultValue: 0
@@ -123669,7 +123801,7 @@ class Parabola extends Curve {
123669
123801
  public: true,
123670
123802
  shadowingInstructions: {
123671
123803
  createComponentOfType: "number",
123672
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing()
123804
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing()
123673
123805
  },
123674
123806
  hasEssential: true,
123675
123807
  defaultValue: 0
@@ -124279,7 +124411,7 @@ class Parabola extends Curve {
124279
124411
  isLocation: true,
124280
124412
  shadowingInstructions: {
124281
124413
  createComponentOfType: "math",
124282
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing(),
124414
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing(),
124283
124415
  returnWrappingComponents(prefix) {
124284
124416
  if (prefix === "vertexX") {
124285
124417
  return [];
@@ -124389,7 +124521,7 @@ class Parabola extends Curve {
124389
124521
  public: true,
124390
124522
  shadowingInstructions: {
124391
124523
  createComponentOfType: "math",
124392
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing()
124524
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing()
124393
124525
  },
124394
124526
  // TODO: implement additional properties
124395
124527
  additionalProperties: {
@@ -125266,7 +125398,7 @@ class VectorListComponent extends CompositeComponent {
125266
125398
  createStateVariable: "asList",
125267
125399
  defaultValue: true
125268
125400
  };
125269
- for (let attrName in returnRoundingAttributes()) {
125401
+ for (let attrName in returnNumberDisplayAttributes()) {
125270
125402
  attributes[attrName] = {
125271
125403
  leaveRaw: true
125272
125404
  };
@@ -125652,7 +125784,7 @@ class VectorListComponent extends CompositeComponent {
125652
125784
  let diagnostics = [];
125653
125785
  let replacements = [];
125654
125786
  let componentsCopied = [];
125655
- let attributesToConvert = gatherRawRoundingFixedResponseAttributes(
125787
+ let attributesToConvert = gatherRawNumberDisplayFixedResponseAttributes(
125656
125788
  component,
125657
125789
  components
125658
125790
  );
@@ -125684,7 +125816,7 @@ class VectorListComponent extends CompositeComponent {
125684
125816
  nComponents = res.nComponents;
125685
125817
  }
125686
125818
  if (copyChildSource) {
125687
- nComponents = addShadowRoundingAttributes({
125819
+ nComponents = addShadowNumberDisplayAttributes({
125688
125820
  nComponents,
125689
125821
  stateIdInfo,
125690
125822
  source: copyChildSource,
@@ -125881,7 +126013,7 @@ class PointList extends CompositeComponent {
125881
126013
  createStateVariable: "asList",
125882
126014
  defaultValue: true
125883
126015
  };
125884
- for (let attrName in returnRoundingAttributes()) {
126016
+ for (let attrName in returnNumberDisplayAttributes()) {
125885
126017
  attributes[attrName] = {
125886
126018
  leaveRaw: true
125887
126019
  };
@@ -126271,7 +126403,7 @@ class PointList extends CompositeComponent {
126271
126403
  let diagnostics = [];
126272
126404
  let replacements = [];
126273
126405
  let componentsCopied = [];
126274
- let attributesToConvert = gatherRawRoundingFixedResponseAttributes(
126406
+ let attributesToConvert = gatherRawNumberDisplayFixedResponseAttributes(
126275
126407
  component,
126276
126408
  components
126277
126409
  );
@@ -126303,7 +126435,7 @@ class PointList extends CompositeComponent {
126303
126435
  nComponents = res.nComponents;
126304
126436
  }
126305
126437
  if (copyChildSource) {
126306
- nComponents = addShadowRoundingAttributes({
126438
+ nComponents = addShadowNumberDisplayAttributes({
126307
126439
  nComponents,
126308
126440
  stateIdInfo,
126309
126441
  source: copyChildSource,
@@ -126468,7 +126600,7 @@ class IntervalList extends CompositeComponent {
126468
126600
  createStateVariable: "asList",
126469
126601
  defaultValue: true
126470
126602
  };
126471
- for (let attrName in returnRoundingAttributes()) {
126603
+ for (let attrName in returnNumberDisplayAttributes()) {
126472
126604
  attributes[attrName] = {
126473
126605
  leaveRaw: true
126474
126606
  };
@@ -126755,7 +126887,7 @@ class IntervalList extends CompositeComponent {
126755
126887
  let diagnostics = [];
126756
126888
  let replacements = [];
126757
126889
  let componentsCopied = [];
126758
- let attributesToConvert = gatherRawRoundingFixedResponseAttributes(
126890
+ let attributesToConvert = gatherRawNumberDisplayFixedResponseAttributes(
126759
126891
  component,
126760
126892
  components
126761
126893
  );
@@ -126786,7 +126918,7 @@ class IntervalList extends CompositeComponent {
126786
126918
  nComponents = res.nComponents;
126787
126919
  }
126788
126920
  if (copyChildSource) {
126789
- nComponents = addShadowRoundingAttributes({
126921
+ nComponents = addShadowNumberDisplayAttributes({
126790
126922
  nComponents,
126791
126923
  stateIdInfo,
126792
126924
  source: copyChildSource,
@@ -127217,7 +127349,7 @@ class Vector extends GraphicalComponent {
127217
127349
  valueForFalse: "none"
127218
127350
  };
127219
127351
  attributes.labelPosition = returnLineFamilyLabelPositionAttribute();
127220
- Object.assign(attributes, returnRoundingAttributes());
127352
+ Object.assign(attributes, returnNumberDisplayAttributes());
127221
127353
  attributes.displayWithAngleBrackets = {
127222
127354
  createComponentOfType: "boolean",
127223
127355
  createStateVariable: "displayWithAngleBrackets",
@@ -127371,7 +127503,7 @@ class Vector extends GraphicalComponent {
127371
127503
  let stateVariableDefinitions = super.returnStateVariableDefinitions();
127372
127504
  Object.assign(
127373
127505
  stateVariableDefinitions,
127374
- returnRoundingStateVariableDefinitions()
127506
+ returnNumberDisplayStateVariableDefinitions()
127375
127507
  );
127376
127508
  let styleDescriptionDefinitions = returnTextStyleDescriptionDefinitions();
127377
127509
  Object.assign(stateVariableDefinitions, styleDescriptionDefinitions);
@@ -128134,7 +128266,7 @@ class Vector extends GraphicalComponent {
128134
128266
  shadowingInstructions: {
128135
128267
  createComponentOfType: "math",
128136
128268
  attributesToShadow: ["displayWithAngleBrackets"],
128137
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing(),
128269
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing(),
128138
128270
  returnWrappingComponents(prefix) {
128139
128271
  if (prefix === "x") {
128140
128272
  return [];
@@ -128461,7 +128593,7 @@ class Vector extends GraphicalComponent {
128461
128593
  isLocation: true,
128462
128594
  shadowingInstructions: {
128463
128595
  createComponentOfType: "math",
128464
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing(),
128596
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing(),
128465
128597
  returnWrappingComponents(prefix) {
128466
128598
  if (prefix === "headX") {
128467
128599
  return [];
@@ -128612,7 +128744,7 @@ class Vector extends GraphicalComponent {
128612
128744
  isLocation: true,
128613
128745
  shadowingInstructions: {
128614
128746
  createComponentOfType: "math",
128615
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing(),
128747
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing(),
128616
128748
  returnWrappingComponents(prefix) {
128617
128749
  if (prefix === "tailX") {
128618
128750
  return [];
@@ -128790,7 +128922,7 @@ class Vector extends GraphicalComponent {
128790
128922
  isLocation: true,
128791
128923
  shadowingInstructions: {
128792
128924
  createComponentOfType: "math",
128793
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing()
128925
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing()
128794
128926
  },
128795
128927
  returnDependencies: () => ({
128796
128928
  numDimensions: {
@@ -128994,18 +129126,19 @@ class Vector extends GraphicalComponent {
128994
129126
  padZeros: {
128995
129127
  dependencyType: "stateVariable",
128996
129128
  variableName: "padZeros"
129129
+ },
129130
+ avoidScientificNotation: {
129131
+ dependencyType: "stateVariable",
129132
+ variableName: "avoidScientificNotation"
128997
129133
  }
128998
129134
  }),
128999
129135
  definition: function({ dependencyValues }) {
129000
- let params = {};
129001
- if (dependencyValues.padZeros) {
129002
- if (Number.isFinite(dependencyValues.displayDecimals)) {
129003
- params.padToDecimals = dependencyValues.displayDecimals;
129004
- }
129005
- if (dependencyValues.displayDigits >= 1) {
129006
- params.padToDigits = dependencyValues.displayDigits;
129007
- }
129008
- }
129136
+ let params = buildNumberDisplayParameters({
129137
+ padZeros: dependencyValues.padZeros,
129138
+ displayDigits: dependencyValues.displayDigits,
129139
+ displayDecimals: dependencyValues.displayDecimals,
129140
+ avoidScientificNotation: dependencyValues.avoidScientificNotation
129141
+ });
129009
129142
  let latex = roundForDisplay({
129010
129143
  value: dependencyValues.displacementCoords,
129011
129144
  dependencyValues
@@ -129074,14 +129207,14 @@ class Vector extends GraphicalComponent {
129074
129207
  stateVariable: "displacementCoords",
129075
129208
  componentType: "_directionComponent",
129076
129209
  stateVariablesToShadow: Object.keys(
129077
- returnRoundingStateVariableDefinitions()
129210
+ returnNumberDisplayStateVariableDefinitions()
129078
129211
  )
129079
129212
  },
129080
129213
  {
129081
129214
  stateVariable: "displacementCoords",
129082
129215
  componentType: "coords",
129083
129216
  stateVariablesToShadow: [
129084
- ...Object.keys(returnRoundingStateVariableDefinitions()),
129217
+ ...Object.keys(returnNumberDisplayStateVariableDefinitions()),
129085
129218
  "inUnorderedList"
129086
129219
  ]
129087
129220
  },
@@ -129089,7 +129222,7 @@ class Vector extends GraphicalComponent {
129089
129222
  stateVariable: "displacementCoords",
129090
129223
  componentType: "point",
129091
129224
  stateVariablesToShadow: [
129092
- ...Object.keys(returnRoundingStateVariableDefinitions()),
129225
+ ...Object.keys(returnNumberDisplayStateVariableDefinitions()),
129093
129226
  "inUnorderedList"
129094
129227
  ]
129095
129228
  }
@@ -129464,7 +129597,7 @@ class Angle extends GraphicalComponent {
129464
129597
  attributes.betweenLines = {
129465
129598
  createComponentOfType: "_lineListComponent"
129466
129599
  };
129467
- Object.assign(attributes, returnRoundingAttributes());
129600
+ Object.assign(attributes, returnNumberDisplayAttributes());
129468
129601
  attributes.emphasizeRightAngle = {
129469
129602
  createComponentOfType: "boolean",
129470
129603
  createStateVariable: "emphasizeRightAngle",
@@ -129488,7 +129621,7 @@ class Angle extends GraphicalComponent {
129488
129621
  let stateVariableDefinitions = super.returnStateVariableDefinitions();
129489
129622
  Object.assign(
129490
129623
  stateVariableDefinitions,
129491
- returnRoundingStateVariableDefinitions()
129624
+ returnNumberDisplayStateVariableDefinitions()
129492
129625
  );
129493
129626
  stateVariableDefinitions.filled = {
129494
129627
  returnDependencies: () => ({}),
@@ -129824,7 +129957,7 @@ class Angle extends GraphicalComponent {
129824
129957
  public: true,
129825
129958
  shadowingInstructions: {
129826
129959
  createComponentOfType: "math",
129827
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing()
129960
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing()
129828
129961
  },
129829
129962
  additionalStateVariablesDefined: [
129830
129963
  {
@@ -129920,7 +130053,7 @@ class Angle extends GraphicalComponent {
129920
130053
  public: true,
129921
130054
  shadowingInstructions: {
129922
130055
  createComponentOfType: "math",
129923
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing()
130056
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing()
129924
130057
  },
129925
130058
  returnDependencies: () => ({
129926
130059
  radians: {
@@ -129973,18 +130106,19 @@ class Angle extends GraphicalComponent {
129973
130106
  padZeros: {
129974
130107
  dependencyType: "stateVariable",
129975
130108
  variableName: "padZeros"
130109
+ },
130110
+ avoidScientificNotation: {
130111
+ dependencyType: "stateVariable",
130112
+ variableName: "avoidScientificNotation"
129976
130113
  }
129977
130114
  }),
129978
130115
  definition: function({ dependencyValues }) {
129979
- let params = {};
129980
- if (dependencyValues.padZeros) {
129981
- if (Number.isFinite(dependencyValues.displayDecimals)) {
129982
- params.padToDecimals = dependencyValues.displayDecimals;
129983
- }
129984
- if (dependencyValues.displayDigits >= 1) {
129985
- params.padToDigits = dependencyValues.displayDigits;
129986
- }
129987
- }
130116
+ let params = buildNumberDisplayParameters({
130117
+ padZeros: dependencyValues.padZeros,
130118
+ displayDigits: dependencyValues.displayDigits,
130119
+ displayDecimals: dependencyValues.displayDecimals,
130120
+ avoidScientificNotation: dependencyValues.avoidScientificNotation
130121
+ });
129988
130122
  let value = dependencyValues.inDegrees ? dependencyValues.degrees : dependencyValues.radians;
129989
130123
  let latexForRenderer = roundForDisplay({
129990
130124
  value,
@@ -130049,7 +130183,7 @@ class Angle extends GraphicalComponent {
130049
130183
  {
130050
130184
  stateVariable: "radians",
130051
130185
  stateVariablesToShadow: Object.keys(
130052
- returnRoundingStateVariableDefinitions()
130186
+ returnNumberDisplayStateVariableDefinitions()
130053
130187
  )
130054
130188
  }
130055
130189
  ];
@@ -133111,7 +133245,7 @@ class MathInput extends Input {
133111
133245
  public: true,
133112
133246
  fallBackToParentStateVariable: "parseScientificNotation"
133113
133247
  };
133114
- Object.assign(attributes, returnRoundingAttributes());
133248
+ Object.assign(attributes, returnNumberDisplayAttributes());
133115
133249
  attributes.bindValueTo = {
133116
133250
  createComponentOfType: "math"
133117
133251
  };
@@ -133183,7 +133317,7 @@ class MathInput extends Input {
133183
133317
  let stateVariableDefinitions = super.returnStateVariableDefinitions();
133184
133318
  Object.assign(
133185
133319
  stateVariableDefinitions,
133186
- returnRoundingStateVariableDefinitions({
133320
+ returnNumberDisplayStateVariableDefinitions({
133187
133321
  displayDigitsDefault: 10,
133188
133322
  displaySmallAsZeroDefault: 0
133189
133323
  })
@@ -133241,7 +133375,7 @@ class MathInput extends Input {
133241
133375
  public: true,
133242
133376
  shadowingInstructions: {
133243
133377
  createComponentOfType: "math",
133244
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing()
133378
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing()
133245
133379
  },
133246
133380
  hasEssential: true,
133247
133381
  shadowVariable: true,
@@ -133396,7 +133530,7 @@ class MathInput extends Input {
133396
133530
  public: true,
133397
133531
  shadowingInstructions: {
133398
133532
  createComponentOfType: "math",
133399
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing()
133533
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing()
133400
133534
  },
133401
133535
  hasEssential: true,
133402
133536
  shadowVariable: true,
@@ -133485,7 +133619,6 @@ class MathInput extends Input {
133485
133619
  }
133486
133620
  };
133487
133621
  stateVariableDefinitions.valueForDisplay = {
133488
- forRenderer: true,
133489
133622
  returnDependencies: () => ({
133490
133623
  value: {
133491
133624
  dependencyType: "stateVariable",
@@ -133524,12 +133657,34 @@ class MathInput extends Input {
133524
133657
  valueForDisplay: {
133525
133658
  dependencyType: "stateVariable",
133526
133659
  variableName: "valueForDisplay"
133660
+ },
133661
+ padZeros: {
133662
+ dependencyType: "stateVariable",
133663
+ variableName: "padZeros"
133664
+ },
133665
+ displayDigits: {
133666
+ dependencyType: "stateVariable",
133667
+ variableName: "displayDigits"
133668
+ },
133669
+ displayDecimals: {
133670
+ dependencyType: "stateVariable",
133671
+ variableName: "displayDecimals"
133672
+ },
133673
+ avoidScientificNotation: {
133674
+ dependencyType: "stateVariable",
133675
+ variableName: "avoidScientificNotation"
133527
133676
  }
133528
133677
  }),
133529
133678
  definition: function({ dependencyValues }) {
133679
+ let params = buildNumberDisplayParameters({
133680
+ padZeros: dependencyValues.padZeros,
133681
+ displayDigits: dependencyValues.displayDigits,
133682
+ displayDecimals: dependencyValues.displayDecimals,
133683
+ avoidScientificNotation: dependencyValues.avoidScientificNotation
133684
+ });
133530
133685
  return {
133531
133686
  setValue: {
133532
- text: dependencyValues.valueForDisplay.toString()
133687
+ text: dependencyValues.valueForDisplay.toString(params)
133533
133688
  }
133534
133689
  };
133535
133690
  }
@@ -133925,7 +134080,7 @@ class MathInput extends Input {
133925
134080
  {
133926
134081
  stateVariable: "value",
133927
134082
  stateVariablesToShadow: Object.keys(
133928
- returnRoundingStateVariableDefinitions()
134083
+ returnNumberDisplayStateVariableDefinitions()
133929
134084
  )
133930
134085
  }
133931
134086
  ];
@@ -136617,7 +136772,7 @@ class NumberComponent extends InlineComponent {
136617
136772
  static implicitPropReturnsSameType = true;
136618
136773
  static createAttributesObject() {
136619
136774
  let attributes = super.createAttributesObject();
136620
- Object.assign(attributes, returnRoundingAttributes());
136775
+ Object.assign(attributes, returnNumberDisplayAttributes());
136621
136776
  attributes.renderAsMath = {
136622
136777
  createComponentOfType: "boolean",
136623
136778
  createStateVariable: "renderAsMath",
@@ -136712,7 +136867,7 @@ class NumberComponent extends InlineComponent {
136712
136867
  Object.assign(stateVariableDefinitions, styleDescriptionDefinitions);
136713
136868
  let anchorDefinition = returnAnchorStateVariableDefinition();
136714
136869
  Object.assign(stateVariableDefinitions, anchorDefinition);
136715
- let roundingDefinitions = returnRoundingStateVariableDefinitions({
136870
+ let roundingDefinitions = returnNumberDisplayStateVariableDefinitions({
136716
136871
  childGroupsIfSingleMatch: ["maths", "numbers"],
136717
136872
  childGroupsToStopSingleMatch: ["strings", "texts", "booleans"]
136718
136873
  });
@@ -136925,7 +137080,7 @@ class NumberComponent extends InlineComponent {
136925
137080
  fixed: {
136926
137081
  stateVariableToShadow: "fixed"
136927
137082
  },
136928
- ...returnRoundingAttributeComponentShadowing()
137083
+ ...returnNumberDisplayAttributeComponentShadowing()
136929
137084
  }
136930
137085
  },
136931
137086
  hasEssential: true,
@@ -137298,6 +137453,10 @@ class NumberComponent extends InlineComponent {
137298
137453
  dependencyType: "stateVariable",
137299
137454
  variableName: "padZeros"
137300
137455
  },
137456
+ avoidScientificNotation: {
137457
+ dependencyType: "stateVariable",
137458
+ variableName: "avoidScientificNotation"
137459
+ },
137301
137460
  displayDigits: {
137302
137461
  dependencyType: "stateVariable",
137303
137462
  variableName: "displayDigits"
@@ -137313,15 +137472,12 @@ class NumberComponent extends InlineComponent {
137313
137472
  }
137314
137473
  }),
137315
137474
  definition: function({ dependencyValues }) {
137316
- let params = {};
137317
- if (dependencyValues.padZeros) {
137318
- if (Number.isFinite(dependencyValues.displayDecimals)) {
137319
- params.padToDecimals = dependencyValues.displayDecimals;
137320
- }
137321
- if (dependencyValues.displayDigits >= 1) {
137322
- params.padToDigits = dependencyValues.displayDigits;
137323
- }
137324
- }
137475
+ let params = buildNumberDisplayParameters({
137476
+ padZeros: dependencyValues.padZeros,
137477
+ displayDigits: dependencyValues.displayDigits,
137478
+ displayDecimals: dependencyValues.displayDecimals,
137479
+ avoidScientificNotation: dependencyValues.avoidScientificNotation
137480
+ });
137325
137481
  return {
137326
137482
  setValue: {
137327
137483
  text: numberToMathExpression(
@@ -137377,7 +137533,7 @@ class NumberComponent extends InlineComponent {
137377
137533
  mathVariableName: "math",
137378
137534
  isPublic: true
137379
137535
  });
137380
- stateVariableDefinitions.math.shadowingInstructions.addAttributeComponentsShadowingStateVariables = returnRoundingAttributeComponentShadowing();
137536
+ stateVariableDefinitions.math.shadowingInstructions.addAttributeComponentsShadowingStateVariables = returnNumberDisplayAttributeComponentShadowing();
137381
137537
  stateVariableDefinitions.latex = {
137382
137538
  public: true,
137383
137539
  shadowingInstructions: {
@@ -137392,6 +137548,10 @@ class NumberComponent extends InlineComponent {
137392
137548
  dependencyType: "stateVariable",
137393
137549
  variableName: "padZeros"
137394
137550
  },
137551
+ avoidScientificNotation: {
137552
+ dependencyType: "stateVariable",
137553
+ variableName: "avoidScientificNotation"
137554
+ },
137395
137555
  displayDigits: {
137396
137556
  dependencyType: "stateVariable",
137397
137557
  variableName: "displayDigits"
@@ -137402,15 +137562,12 @@ class NumberComponent extends InlineComponent {
137402
137562
  }
137403
137563
  }),
137404
137564
  definition({ dependencyValues }) {
137405
- let params = {};
137406
- if (dependencyValues.padZeros) {
137407
- if (Number.isFinite(dependencyValues.displayDecimals)) {
137408
- params.padToDecimals = dependencyValues.displayDecimals;
137409
- }
137410
- if (dependencyValues.displayDigits >= 1) {
137411
- params.padToDigits = dependencyValues.displayDigits;
137412
- }
137413
- }
137565
+ let params = buildNumberDisplayParameters({
137566
+ padZeros: dependencyValues.padZeros,
137567
+ displayDigits: dependencyValues.displayDigits,
137568
+ displayDecimals: dependencyValues.displayDecimals,
137569
+ avoidScientificNotation: dependencyValues.avoidScientificNotation
137570
+ });
137414
137571
  return {
137415
137572
  setValue: {
137416
137573
  latex: numberToMathExpression(
@@ -137469,7 +137626,7 @@ class NumberComponent extends InlineComponent {
137469
137626
  {
137470
137627
  stateVariable: "math",
137471
137628
  stateVariablesToShadow: Object.keys(
137472
- returnRoundingStateVariableDefinitions()
137629
+ returnNumberDisplayStateVariableDefinitions()
137473
137630
  )
137474
137631
  },
137475
137632
  "text"
@@ -137606,7 +137763,8 @@ function extractControlDisplaySettings(stateValues) {
137606
137763
  displayDigits: stateValues.displayDigits,
137607
137764
  displayDecimals: stateValues.displayDecimals,
137608
137765
  displaySmallAsZero: stateValues.displaySmallAsZero,
137609
- padZeros: stateValues.padZeros
137766
+ padZeros: stateValues.padZeros,
137767
+ avoidScientificNotation: stateValues.avoidScientificNotation
137610
137768
  };
137611
137769
  }
137612
137770
  function hasValid2DNumericalVertices(numericalVertices, minVertexCount) {
@@ -137706,6 +137864,7 @@ const GRAPH_CONTROL_VARIABLE_NAMES = [
137706
137864
  "displayDecimals",
137707
137865
  "displaySmallAsZero",
137708
137866
  "padZeros",
137867
+ "avoidScientificNotation",
137709
137868
  "controlOrder"
137710
137869
  ];
137711
137870
  const GRAPH_CONTROL_DESCENDANT_CONFIGS = [
@@ -141223,7 +141382,7 @@ let Graph$1 = class Graph extends BlockComponent {
141223
141382
  createComponentOfType: "text",
141224
141383
  valueForTrue: "medium"
141225
141384
  };
141226
- Object.assign(attributes, returnRoundingAttributes());
141385
+ Object.assign(attributes, returnNumberDisplayAttributes());
141227
141386
  attributes.showBorder = {
141228
141387
  createComponentOfType: "boolean",
141229
141388
  createStateVariable: "showBorder",
@@ -141305,7 +141464,7 @@ let Graph$1 = class Graph extends BlockComponent {
141305
141464
  let stateVariableDefinitions = super.returnStateVariableDefinitions();
141306
141465
  Object.assign(
141307
141466
  stateVariableDefinitions,
141308
- returnRoundingStateVariableDefinitions()
141467
+ returnNumberDisplayStateVariableDefinitions()
141309
141468
  );
141310
141469
  stateVariableDefinitions.shortDescription = {
141311
141470
  forRenderer: true,
@@ -141964,7 +142123,7 @@ let Graph$1 = class Graph extends BlockComponent {
141964
142123
  public: true,
141965
142124
  shadowingInstructions: {
141966
142125
  createComponentOfType: "number",
141967
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing()
142126
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing()
141968
142127
  },
141969
142128
  forRenderer: true,
141970
142129
  returnDependencies({ stateValues }) {
@@ -142087,7 +142246,7 @@ let Graph$1 = class Graph extends BlockComponent {
142087
142246
  public: true,
142088
142247
  shadowingInstructions: {
142089
142248
  createComponentOfType: "number",
142090
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing()
142249
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing()
142091
142250
  },
142092
142251
  forRenderer: true,
142093
142252
  returnDependencies({ stateValues }) {
@@ -142217,7 +142376,7 @@ let Graph$1 = class Graph extends BlockComponent {
142217
142376
  public: true,
142218
142377
  shadowingInstructions: {
142219
142378
  createComponentOfType: "number",
142220
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing()
142379
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing()
142221
142380
  },
142222
142381
  forRenderer: true,
142223
142382
  returnDependencies({ stateValues }) {
@@ -142340,7 +142499,7 @@ let Graph$1 = class Graph extends BlockComponent {
142340
142499
  public: true,
142341
142500
  shadowingInstructions: {
142342
142501
  createComponentOfType: "number",
142343
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing()
142502
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing()
142344
142503
  },
142345
142504
  forRenderer: true,
142346
142505
  returnDependencies({ stateValues }) {
@@ -142499,7 +142658,7 @@ let Graph$1 = class Graph extends BlockComponent {
142499
142658
  public: true,
142500
142659
  shadowingInstructions: {
142501
142660
  createComponentOfType: "number",
142502
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing()
142661
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing()
142503
142662
  },
142504
142663
  returnDependencies: () => ({
142505
142664
  xMin: {
@@ -142523,7 +142682,7 @@ let Graph$1 = class Graph extends BlockComponent {
142523
142682
  public: true,
142524
142683
  shadowingInstructions: {
142525
142684
  createComponentOfType: "number",
142526
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing()
142685
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing()
142527
142686
  },
142528
142687
  returnDependencies: () => ({
142529
142688
  yMin: {
@@ -142594,7 +142753,7 @@ let Graph$1 = class Graph extends BlockComponent {
142594
142753
  public: true,
142595
142754
  shadowingInstructions: {
142596
142755
  hasVariableComponentType: true,
142597
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing()
142756
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing()
142598
142757
  },
142599
142758
  forRenderer: true,
142600
142759
  stateVariablesDeterminingDependencies: ["gridAttrCompChildren"],
@@ -143171,7 +143330,7 @@ class PiecewiseFunction extends Function$1 {
143171
143330
  public: true,
143172
143331
  shadowingInstructions: {
143173
143332
  createComponentOfType: "math",
143174
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing()
143333
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing()
143175
143334
  },
143176
143335
  returnDependencies: () => ({}),
143177
143336
  definition: () => ({ setValue: { formula: Context.fromAst("_") } })
@@ -143428,19 +143587,20 @@ class PiecewiseFunction extends Function$1 {
143428
143587
  padZeros: {
143429
143588
  dependencyType: "stateVariable",
143430
143589
  variableName: "padZeros"
143590
+ },
143591
+ avoidScientificNotation: {
143592
+ dependencyType: "stateVariable",
143593
+ variableName: "avoidScientificNotation"
143431
143594
  }
143432
143595
  }),
143433
143596
  definition: function({ dependencyValues }) {
143434
143597
  let functionVariable = dependencyValues.variable;
143435
- let toLatexParams = {};
143436
- if (dependencyValues.padZeros) {
143437
- if (Number.isFinite(dependencyValues.displayDecimals)) {
143438
- toLatexParams.padToDecimals = dependencyValues.displayDecimals;
143439
- }
143440
- if (dependencyValues.displayDigits >= 1) {
143441
- toLatexParams.padToDigits = dependencyValues.displayDigits;
143442
- }
143443
- }
143598
+ let toLatexParams = buildNumberDisplayParameters({
143599
+ padZeros: dependencyValues.padZeros,
143600
+ displayDigits: dependencyValues.displayDigits,
143601
+ displayDecimals: dependencyValues.displayDecimals,
143602
+ avoidScientificNotation: dependencyValues.avoidScientificNotation
143603
+ });
143444
143604
  let effectiveDomainsOfChildrenIgnoringDomain = find_effective_domains_piecewise_children({
143445
143605
  numericalDomainsOfChildren: dependencyValues.numericalDomainsOfChildren
143446
143606
  });
@@ -144578,7 +144738,7 @@ class Sequence extends CompositeComponent {
144578
144738
  attributes.fixed = {
144579
144739
  leaveRaw: true
144580
144740
  };
144581
- for (let attrName in returnRoundingAttributes()) {
144741
+ for (let attrName in returnNumberDisplayAttributes()) {
144582
144742
  attributes[attrName] = {
144583
144743
  leaveRaw: true
144584
144744
  };
@@ -144682,7 +144842,7 @@ class Sequence extends CompositeComponent {
144682
144842
  let attributesToConvert = {};
144683
144843
  for (let attr of [
144684
144844
  "fixed",
144685
- ...Object.keys(returnRoundingAttributes())
144845
+ ...Object.keys(returnNumberDisplayAttributes())
144686
144846
  ]) {
144687
144847
  if (attr in component.attributes) {
144688
144848
  attributesToConvert[attr] = component.attributes[attr];
@@ -144846,7 +145006,7 @@ class Sequence extends CompositeComponent {
144846
145006
  let attributesToConvert = {};
144847
145007
  for (let attr of [
144848
145008
  "fixed",
144849
- ...Object.keys(returnRoundingAttributes())
145009
+ ...Object.keys(returnNumberDisplayAttributes())
144850
145010
  ]) {
144851
145011
  if (attr in component.attributes) {
144852
145012
  attributesToConvert[attr] = component.attributes[attr];
@@ -146451,7 +146611,7 @@ class Slider extends BaseComponent {
146451
146611
  forRenderer: true
146452
146612
  };
146453
146613
  Object.assign(attributes, returnLabelAttributes());
146454
- Object.assign(attributes, returnRoundingAttributes());
146614
+ Object.assign(attributes, returnNumberDisplayAttributes());
146455
146615
  attributes.bindValueTo = {
146456
146616
  createComponentOfType: "_componentWithSelectableType"
146457
146617
  };
@@ -146479,7 +146639,7 @@ class Slider extends BaseComponent {
146479
146639
  Object.assign(stateVariableDefinitions, labelDefinitions);
146480
146640
  Object.assign(
146481
146641
  stateVariableDefinitions,
146482
- returnRoundingStateVariableDefinitions()
146642
+ returnNumberDisplayStateVariableDefinitions()
146483
146643
  );
146484
146644
  stateVariableDefinitions.items = {
146485
146645
  forRenderer: true,
@@ -146805,7 +146965,7 @@ class Slider extends BaseComponent {
146805
146965
  public: true,
146806
146966
  shadowingInstructions: {
146807
146967
  hasVariableComponentType: true,
146808
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing()
146968
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing()
146809
146969
  },
146810
146970
  returnDependencies: () => ({
146811
146971
  type: {
@@ -186536,14 +186696,14 @@ class DiscreteSimulationResultList extends BlockComponent {
186536
186696
  createStateVariable: "headerRow",
186537
186697
  defaultValue: null
186538
186698
  };
186539
- Object.assign(attributes, returnRoundingAttributes());
186699
+ Object.assign(attributes, returnNumberDisplayAttributes());
186540
186700
  return attributes;
186541
186701
  }
186542
186702
  static returnStateVariableDefinitions() {
186543
186703
  let stateVariableDefinitions = super.returnStateVariableDefinitions();
186544
186704
  Object.assign(
186545
186705
  stateVariableDefinitions,
186546
- returnRoundingStateVariableDefinitions()
186706
+ returnNumberDisplayStateVariableDefinitions()
186547
186707
  );
186548
186708
  stateVariableDefinitions.cells = {
186549
186709
  forRenderer: true,
@@ -189012,7 +189172,7 @@ class SelectFromSequence extends Sequence {
189012
189172
  let attributesToConvert = {};
189013
189173
  for (let attr of [
189014
189174
  "fixed",
189015
- ...Object.keys(returnRoundingAttributes())
189175
+ ...Object.keys(returnNumberDisplayAttributes())
189016
189176
  ]) {
189017
189177
  if (attr in component.attributes) {
189018
189178
  attributesToConvert[attr] = component.attributes[attr];
@@ -191800,7 +191960,7 @@ class Evaluate extends MathComponent {
191800
191960
  returnDependencies: () => ({}),
191801
191961
  definition: () => ({ setValue: { canBeModified: false } })
191802
191962
  };
191803
- let roundingDefinitions = returnRoundingStateVariableDefinitions({
191963
+ let roundingDefinitions = returnNumberDisplayStateVariableDefinitions({
191804
191964
  additionalAttributeComponent: "function"
191805
191965
  });
191806
191966
  Object.assign(stateVariableDefinitions, roundingDefinitions);
@@ -191882,7 +192042,7 @@ class Evaluate extends MathComponent {
191882
192042
  public: true,
191883
192043
  shadowingInstructions: {
191884
192044
  createComponentOfType: "math",
191885
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing()
192045
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing()
191886
192046
  },
191887
192047
  returnDependencies() {
191888
192048
  return {
@@ -192167,7 +192327,7 @@ class SampleRandomNumbers extends CompositeComponent {
192167
192327
  createStateVariable: "exclude",
192168
192328
  defaultValue: []
192169
192329
  };
192170
- for (let attrName in returnRoundingAttributes()) {
192330
+ for (let attrName in returnNumberDisplayAttributes()) {
192171
192331
  attributes[attrName] = {
192172
192332
  leaveRaw: true
192173
192333
  };
@@ -192646,7 +192806,7 @@ class SampleRandomNumbers extends CompositeComponent {
192646
192806
  };
192647
192807
  let diagnostics = [];
192648
192808
  let attributesToConvert = {};
192649
- for (let attr of Object.keys(returnRoundingAttributes())) {
192809
+ for (let attr of Object.keys(returnNumberDisplayAttributes())) {
192650
192810
  if (attr in component.attributes) {
192651
192811
  attributesToConvert[attr] = component.attributes[attr];
192652
192812
  }
@@ -192971,7 +193131,7 @@ class SelectRandomNumbers extends SampleRandomNumbers {
192971
193131
  };
192972
193132
  let diagnostics = [];
192973
193133
  let attributesToConvert = {};
192974
- for (let attr of Object.keys(returnRoundingAttributes())) {
193134
+ for (let attr of Object.keys(returnNumberDisplayAttributes())) {
192975
193135
  if (attr in component.attributes) {
192976
193136
  attributesToConvert[attr] = component.attributes[attr];
192977
193137
  }
@@ -194029,7 +194189,7 @@ class Substitute extends CompositeComponent {
194029
194189
  "normalizeOrder"
194030
194190
  ]
194031
194191
  };
194032
- Object.assign(attributes, returnRoundingAttributes());
194192
+ Object.assign(attributes, returnNumberDisplayAttributes());
194033
194193
  attributes.matchWholeWord = {
194034
194194
  createComponentOfType: "boolean",
194035
194195
  createStateVariable: "matchWholeWord",
@@ -194094,7 +194254,7 @@ class Substitute extends CompositeComponent {
194094
194254
  }
194095
194255
  static returnStateVariableDefinitions() {
194096
194256
  let stateVariableDefinitions = super.returnStateVariableDefinitions();
194097
- let roundingDefinitions = returnRoundingStateVariableDefinitions({
194257
+ let roundingDefinitions = returnNumberDisplayStateVariableDefinitions({
194098
194258
  childGroupsIfSingleMatch: ["anything"]
194099
194259
  });
194100
194260
  Object.assign(stateVariableDefinitions, roundingDefinitions);
@@ -194375,7 +194535,7 @@ class Substitute extends CompositeComponent {
194375
194535
  if (type === "math") {
194376
194536
  let attributes = {};
194377
194537
  let attributesComponentTypes = {};
194378
- let roundingSVs = returnRoundingStateVariableDefinitions();
194538
+ let roundingSVs = returnNumberDisplayStateVariableDefinitions();
194379
194539
  for (let attrName in roundingSVs) {
194380
194540
  attributesComponentTypes[attrName] = roundingSVs[attrName].shadowingInstructions.createComponentOfType;
194381
194541
  }
@@ -194487,7 +194647,7 @@ class PeriodicSet extends MathComponent {
194487
194647
  delete stateVariableDefinitions.mathChildrenByVectorComponent;
194488
194648
  delete stateVariableDefinitions.mathChildrenWithCanBeModified;
194489
194649
  delete stateVariableDefinitions.unordered;
194490
- let roundingDefinitions = returnRoundingStateVariableDefinitions({});
194650
+ let roundingDefinitions = returnNumberDisplayStateVariableDefinitions({});
194491
194651
  Object.assign(stateVariableDefinitions, roundingDefinitions);
194492
194652
  stateVariableDefinitions.canBeModified = {
194493
194653
  returnDependencies: () => ({}),
@@ -194608,7 +194768,7 @@ class PeriodicSet extends MathComponent {
194608
194768
  public: true,
194609
194769
  shadowingInstructions: {
194610
194770
  createComponentOfType: "mathList",
194611
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing()
194771
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing()
194612
194772
  },
194613
194773
  returnDependencies: () => ({
194614
194774
  uniqueOffsets: {
@@ -201916,14 +202076,14 @@ class FunctionIterates extends InlineComponent {
201916
202076
  attributes.function = {
201917
202077
  createComponentOfType: "function"
201918
202078
  };
201919
- Object.assign(attributes, returnRoundingAttributes());
202079
+ Object.assign(attributes, returnNumberDisplayAttributes());
201920
202080
  return attributes;
201921
202081
  }
201922
202082
  static returnStateVariableDefinitions() {
201923
202083
  let stateVariableDefinitions = super.returnStateVariableDefinitions();
201924
202084
  Object.assign(
201925
202085
  stateVariableDefinitions,
201926
- returnRoundingStateVariableDefinitions()
202086
+ returnNumberDisplayStateVariableDefinitions()
201927
202087
  );
201928
202088
  stateVariableDefinitions.numDimensions = {
201929
202089
  public: true,
@@ -201969,7 +202129,7 @@ class FunctionIterates extends InlineComponent {
201969
202129
  public: true,
201970
202130
  shadowingInstructions: {
201971
202131
  createComponentOfType: "mathList",
201972
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing()
202132
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing()
201973
202133
  },
201974
202134
  returnDependencies: () => ({
201975
202135
  functionAttr: {
@@ -202066,7 +202226,7 @@ class FunctionIterates extends InlineComponent {
202066
202226
  public: true,
202067
202227
  shadowingInstructions: {
202068
202228
  createComponentOfType: "mathList",
202069
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing()
202229
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing()
202070
202230
  },
202071
202231
  returnDependencies: () => ({
202072
202232
  initialValue: {
@@ -202094,7 +202254,7 @@ class FunctionIterates extends InlineComponent {
202094
202254
  public: true,
202095
202255
  shadowingInstructions: {
202096
202256
  createComponentOfType: "math",
202097
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing()
202257
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing()
202098
202258
  },
202099
202259
  entryPrefixes: ["iterate"],
202100
202260
  returnArraySizeDependencies: () => ({
@@ -202127,7 +202287,7 @@ class FunctionIterates extends InlineComponent {
202127
202287
  public: true,
202128
202288
  shadowingInstructions: {
202129
202289
  createComponentOfType: "math",
202130
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing()
202290
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing()
202131
202291
  },
202132
202292
  stateVariablesDeterminingDependencies: ["numIterates"],
202133
202293
  returnDependencies({ stateValues }) {
@@ -202533,6 +202693,7 @@ class Sort extends CompositeComponent {
202533
202693
  componentInfoObjects: componentInfoObjects2,
202534
202694
  nComponents
202535
202695
  }) {
202696
+ const diagnostics = [];
202536
202697
  if (!matchedChildren.every(
202537
202698
  (child) => typeof child === "string" || child.extending && "Ref" in child.extending
202538
202699
  )) {
@@ -202542,11 +202703,21 @@ class Sort extends CompositeComponent {
202542
202703
  if (componentAttributes.type?.value) {
202543
202704
  type = componentAttributes.type.value;
202544
202705
  } else {
202545
- return { success: false };
202706
+ if (matchedChildren.some((child) => typeof child === "string")) {
202707
+ diagnostics.push({
202708
+ type: "warning",
202709
+ message: `For \`<sort>\` to work with string children, a \`type\` attribute must be specified.`
202710
+ });
202711
+ }
202712
+ return { success: false, diagnostics };
202546
202713
  }
202547
202714
  if (!["math", "text", "number", "boolean"].includes(type)) {
202548
202715
  console.warn(`Invalid type ${type}`);
202549
- return { success: false };
202716
+ diagnostics.push({
202717
+ type: "warning",
202718
+ message: `Invalid type ${type} for sort component. Must be one of math, text, number, or boolean. Defaulting to math.`
202719
+ });
202720
+ type = "math";
202550
202721
  }
202551
202722
  let groupIntoComponentTypesSeparatedBySpaces = returnGroupIntoComponentTypeSeparatedBySpacesOutsideParens({
202552
202723
  componentType: type,
@@ -202562,7 +202733,8 @@ class Sort extends CompositeComponent {
202562
202733
  return {
202563
202734
  success: true,
202564
202735
  newChildren,
202565
- nComponents: result2.nComponents
202736
+ nComponents: result2.nComponents,
202737
+ diagnostics
202566
202738
  };
202567
202739
  } else {
202568
202740
  return { success: false };
@@ -202605,7 +202777,15 @@ class Sort extends CompositeComponent {
202605
202777
  }),
202606
202778
  definition({ dependencyValues }) {
202607
202779
  let componentIndicesForValues = [];
202780
+ const diagnostics = [];
202608
202781
  for (let child of dependencyValues.children) {
202782
+ if (typeof child === "string") {
202783
+ diagnostics.push({
202784
+ type: "warning",
202785
+ message: `String "${child}" is not a valid component to sort. Ignoring.`
202786
+ });
202787
+ continue;
202788
+ }
202609
202789
  if (child.stateValues.componentIndicesInList) {
202610
202790
  componentIndicesForValues.push(
202611
202791
  ...child.stateValues.componentIndicesInList
@@ -202614,7 +202794,10 @@ class Sort extends CompositeComponent {
202614
202794
  componentIndicesForValues.push(child.componentIdx);
202615
202795
  }
202616
202796
  }
202617
- return { setValue: { componentIndicesForValues } };
202797
+ return {
202798
+ setValue: { componentIndicesForValues },
202799
+ sendDiagnostics: diagnostics
202800
+ };
202618
202801
  }
202619
202802
  };
202620
202803
  stateVariableDefinitions.sortedValues = {
@@ -202915,6 +203098,7 @@ class Shuffle extends CompositeComponent {
202915
203098
  componentInfoObjects: componentInfoObjects2,
202916
203099
  nComponents
202917
203100
  }) {
203101
+ const diagnostics = [];
202918
203102
  if (!matchedChildren.every(
202919
203103
  (child) => typeof child === "string" || child.extending && "Ref" in child.extending
202920
203104
  )) {
@@ -202924,11 +203108,21 @@ class Shuffle extends CompositeComponent {
202924
203108
  if (componentAttributes.type?.value) {
202925
203109
  type = componentAttributes.type.value;
202926
203110
  } else {
202927
- return { success: false };
203111
+ if (matchedChildren.some((child) => typeof child === "string")) {
203112
+ diagnostics.push({
203113
+ type: "warning",
203114
+ message: `For \`<shuffle>\` to work with string children, a \`type\` attribute must be specified.`
203115
+ });
203116
+ }
203117
+ return { success: false, diagnostics };
202928
203118
  }
202929
203119
  if (!["math", "text", "number", "boolean"].includes(type)) {
202930
203120
  console.warn(`Invalid type ${type}`);
202931
- return { success: false };
203121
+ diagnostics.push({
203122
+ type: "warning",
203123
+ message: `Invalid type ${type} for shuffle component. Must be one of math, text, number, or boolean. Defaulting to math.`
203124
+ });
203125
+ type = "math";
202932
203126
  }
202933
203127
  let groupIntoComponentTypesSeparatedBySpaces = returnGroupIntoComponentTypeSeparatedBySpacesOutsideParens({
202934
203128
  componentType: type,
@@ -202944,7 +203138,8 @@ class Shuffle extends CompositeComponent {
202944
203138
  return {
202945
203139
  success: true,
202946
203140
  newChildren,
202947
- nComponents: result2.nComponents
203141
+ nComponents: result2.nComponents,
203142
+ diagnostics
202948
203143
  };
202949
203144
  } else {
202950
203145
  return { success: false };
@@ -202977,7 +203172,14 @@ class Shuffle extends CompositeComponent {
202977
203172
  }),
202978
203173
  definition({ dependencyValues }) {
202979
203174
  let originalComponentIndices = [];
203175
+ const diagnostics = [];
202980
203176
  for (let child of dependencyValues.children) {
203177
+ if (typeof child === "string") {
203178
+ diagnostics.push({
203179
+ type: "warning",
203180
+ message: `String "${child}" is not a valid component to shuffle. Ignoring.`
203181
+ });
203182
+ }
202981
203183
  if (child.stateValues?.componentIndicesInList) {
202982
203184
  originalComponentIndices.push(
202983
203185
  ...child.stateValues.componentIndicesInList
@@ -202990,7 +203192,8 @@ class Shuffle extends CompositeComponent {
202990
203192
  setValue: {
202991
203193
  originalComponentIndices,
202992
203194
  numComponents: originalComponentIndices.length
202993
- }
203195
+ },
203196
+ sendDiagnostics: diagnostics
202994
203197
  };
202995
203198
  }
202996
203199
  };
@@ -203043,7 +203246,9 @@ class Shuffle extends CompositeComponent {
203043
203246
  } else {
203044
203247
  return {
203045
203248
  setValue: {
203046
- componentOrder: desiredComponentOrder
203249
+ componentOrder: desiredComponentOrder.filter(
203250
+ (x2) => x2 !== void 0
203251
+ )
203047
203252
  }
203048
203253
  };
203049
203254
  }
@@ -205805,7 +206010,7 @@ class BestFitLine extends Line {
205805
206010
  isLocation: true,
205806
206011
  shadowingInstructions: {
205807
206012
  createComponentOfType: "math",
205808
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing(),
206013
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing(),
205809
206014
  returnWrappingComponents(prefix) {
205810
206015
  if (prefix === "datumX") {
205811
206016
  return [];
@@ -207452,14 +207657,14 @@ class SummaryStatistics extends BlockComponent {
207452
207657
  defaultValue: null,
207453
207658
  public: true
207454
207659
  };
207455
- Object.assign(attributes, returnRoundingAttributes());
207660
+ Object.assign(attributes, returnNumberDisplayAttributes());
207456
207661
  return attributes;
207457
207662
  }
207458
207663
  static returnStateVariableDefinitions() {
207459
207664
  let stateVariableDefinitions = super.returnStateVariableDefinitions();
207460
207665
  Object.assign(
207461
207666
  stateVariableDefinitions,
207462
- returnRoundingStateVariableDefinitions()
207667
+ returnNumberDisplayStateVariableDefinitions()
207463
207668
  );
207464
207669
  stateVariableDefinitions.statisticsToDisplay = {
207465
207670
  public: true,
@@ -207602,7 +207807,7 @@ class SummaryStatistics extends BlockComponent {
207602
207807
  public: true,
207603
207808
  shadowingInstructions: {
207604
207809
  createComponentOfType: "number",
207605
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing()
207810
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing()
207606
207811
  },
207607
207812
  returnDependencies: () => ({
207608
207813
  dataColumn: {
@@ -207622,7 +207827,7 @@ class SummaryStatistics extends BlockComponent {
207622
207827
  public: true,
207623
207828
  shadowingInstructions: {
207624
207829
  createComponentOfType: "number",
207625
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing()
207830
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing()
207626
207831
  },
207627
207832
  returnDependencies: () => ({
207628
207833
  dataColumn: {
@@ -207642,7 +207847,7 @@ class SummaryStatistics extends BlockComponent {
207642
207847
  public: true,
207643
207848
  shadowingInstructions: {
207644
207849
  createComponentOfType: "number",
207645
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing()
207850
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing()
207646
207851
  },
207647
207852
  returnDependencies: () => ({
207648
207853
  dataColumn: {
@@ -207662,7 +207867,7 @@ class SummaryStatistics extends BlockComponent {
207662
207867
  public: true,
207663
207868
  shadowingInstructions: {
207664
207869
  createComponentOfType: "number",
207665
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing()
207870
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing()
207666
207871
  },
207667
207872
  returnDependencies: () => ({
207668
207873
  dataColumn: {
@@ -207682,7 +207887,7 @@ class SummaryStatistics extends BlockComponent {
207682
207887
  public: true,
207683
207888
  shadowingInstructions: {
207684
207889
  createComponentOfType: "number",
207685
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing()
207890
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing()
207686
207891
  },
207687
207892
  returnDependencies: () => ({
207688
207893
  stdev: {
@@ -207706,7 +207911,7 @@ class SummaryStatistics extends BlockComponent {
207706
207911
  public: true,
207707
207912
  shadowingInstructions: {
207708
207913
  createComponentOfType: "number",
207709
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing()
207914
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing()
207710
207915
  },
207711
207916
  returnDependencies: () => ({
207712
207917
  dataColumn: {
@@ -207726,7 +207931,7 @@ class SummaryStatistics extends BlockComponent {
207726
207931
  public: true,
207727
207932
  shadowingInstructions: {
207728
207933
  createComponentOfType: "number",
207729
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing()
207934
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing()
207730
207935
  },
207731
207936
  returnDependencies: () => ({
207732
207937
  dataColumn: {
@@ -207746,7 +207951,7 @@ class SummaryStatistics extends BlockComponent {
207746
207951
  public: true,
207747
207952
  shadowingInstructions: {
207748
207953
  createComponentOfType: "number",
207749
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing()
207954
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing()
207750
207955
  },
207751
207956
  returnDependencies: () => ({
207752
207957
  dataColumn: {
@@ -207766,7 +207971,7 @@ class SummaryStatistics extends BlockComponent {
207766
207971
  public: true,
207767
207972
  shadowingInstructions: {
207768
207973
  createComponentOfType: "number",
207769
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing()
207974
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing()
207770
207975
  },
207771
207976
  returnDependencies: () => ({
207772
207977
  dataColumn: {
@@ -207789,7 +207994,7 @@ class SummaryStatistics extends BlockComponent {
207789
207994
  public: true,
207790
207995
  shadowingInstructions: {
207791
207996
  createComponentOfType: "number",
207792
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing()
207997
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing()
207793
207998
  },
207794
207999
  returnDependencies: () => ({
207795
208000
  dataColumn: {
@@ -207812,7 +208017,7 @@ class SummaryStatistics extends BlockComponent {
207812
208017
  public: true,
207813
208018
  shadowingInstructions: {
207814
208019
  createComponentOfType: "number",
207815
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing()
208020
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing()
207816
208021
  },
207817
208022
  returnDependencies: () => ({
207818
208023
  minimum: {
@@ -208726,7 +208931,7 @@ class Matrix extends MathComponent {
208726
208931
  delete stateVariableDefinitions.mathChildrenByVectorComponent;
208727
208932
  Object.assign(
208728
208933
  stateVariableDefinitions,
208729
- returnRoundingStateVariableDefinitions()
208934
+ returnNumberDisplayStateVariableDefinitions()
208730
208935
  );
208731
208936
  stateVariableDefinitions.unordered = {
208732
208937
  public: true,
@@ -209062,7 +209267,7 @@ class EigenDecomposition extends BaseComponent {
209062
209267
  static rendererType = void 0;
209063
209268
  static createAttributesObject() {
209064
209269
  let attributes = super.createAttributesObject();
209065
- Object.assign(attributes, returnRoundingAttributes());
209270
+ Object.assign(attributes, returnNumberDisplayAttributes());
209066
209271
  return attributes;
209067
209272
  }
209068
209273
  static returnChildGroups() {
@@ -209077,7 +209282,7 @@ class EigenDecomposition extends BaseComponent {
209077
209282
  let stateVariableDefinitions = super.returnStateVariableDefinitions();
209078
209283
  Object.assign(
209079
209284
  stateVariableDefinitions,
209080
- returnRoundingStateVariableDefinitions()
209285
+ returnNumberDisplayStateVariableDefinitions()
209081
209286
  );
209082
209287
  stateVariableDefinitions.decomposition = {
209083
209288
  additionalStateVariablesDefined: [
@@ -209176,7 +209381,7 @@ class EigenDecomposition extends BaseComponent {
209176
209381
  public: true,
209177
209382
  shadowingInstructions: {
209178
209383
  createComponentOfType: "number",
209179
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing()
209384
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing()
209180
209385
  },
209181
209386
  entryPrefixes: ["eigenvalue"],
209182
209387
  returnArraySizeDependencies: () => ({
@@ -209220,7 +209425,7 @@ class EigenDecomposition extends BaseComponent {
209220
209425
  numDimensions: 2,
209221
209426
  shadowingInstructions: {
209222
209427
  createComponentOfType: "number",
209223
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing(),
209428
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing(),
209224
209429
  returnWrappingComponents(prefix) {
209225
209430
  if (prefix === "eigenvectorX") {
209226
209431
  return [];
@@ -215683,7 +215888,7 @@ class DirectionComponent extends BaseComponent {
215683
215888
  static additionalSchemaChildren = ["math", "string"];
215684
215889
  static createAttributesObject() {
215685
215890
  let attributes = super.createAttributesObject();
215686
- Object.assign(attributes, returnRoundingAttributeComponentShadowing());
215891
+ Object.assign(attributes, returnNumberDisplayAttributes());
215687
215892
  return attributes;
215688
215893
  }
215689
215894
  static returnSugarInstructions() {
@@ -215737,7 +215942,7 @@ class DirectionComponent extends BaseComponent {
215737
215942
  let stateVariableDefinitions = super.returnStateVariableDefinitions();
215738
215943
  Object.assign(
215739
215944
  stateVariableDefinitions,
215740
- returnRoundingStateVariableDefinitions()
215945
+ returnNumberDisplayStateVariableDefinitions()
215741
215946
  );
215742
215947
  stateVariableDefinitions.directionShadow = {
215743
215948
  defaultValue: Context.fromAst(["vector", 1, 0]),
@@ -215833,7 +216038,7 @@ class DirectionComponent extends BaseComponent {
215833
216038
  public: true,
215834
216039
  shadowingInstructions: {
215835
216040
  createComponentOfType: "math",
215836
- addAttributeComponentsShadowingStateVariables: returnRoundingAttributeComponentShadowing(),
216041
+ addAttributeComponentsShadowingStateVariables: returnNumberDisplayAttributeComponentShadowing(),
215837
216042
  returnWrappingComponents(prefix) {
215838
216043
  if (prefix === "x") {
215839
216044
  return [];