Skip to content

Commit

Permalink
feat: remove interactive-graph latex logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Kim716 committed Jun 26, 2024
1 parent 9db2c61 commit 30a3b4b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
2 changes: 1 addition & 1 deletion packages/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@junyiacademy/perseus-core",
"version": "1.0.36",
"version": "1.0.37",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"license": "MIT",
Expand Down
25 changes: 15 additions & 10 deletions packages/perseus/src/util/graphie.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1303,16 +1303,17 @@ GraphUtils.createGraphie = function (el: any) {
unityLabels = [unityLabels, unityLabels];
}

if (smartLabelPositioning) {
const minusIgnorer = function (lf: any) {
return function (a) {
return (lf(a) + "").replace(/-(\d)/g, "\\llap{-}$1");
};
};

xLabelFormat = minusIgnorer(xLabelFormat);
yLabelFormat = minusIgnorer(yLabelFormat);
}
// comment for 讓座標軸上的數字可以不用以 latex 呈現
// if (smartLabelPositioning) {
// const minusIgnorer = function (lf: any) {
// return function (a) {
// return (lf(a) + "").replace(/-(\d)/g, "\\llap{-}$1");
// };
// };

// xLabelFormat = minusIgnorer(xLabelFormat);
// yLabelFormat = minusIgnorer(yLabelFormat);
// }

this.init({
range: realRange,
Expand Down Expand Up @@ -1550,6 +1551,7 @@ GraphUtils.createGraphie = function (el: any) {
[x, axisCenter[1]],
xLabelFormat(x),
xAxisPosition,
false,
);
}
}
Expand All @@ -1566,6 +1568,7 @@ GraphUtils.createGraphie = function (el: any) {
[x, axisCenter[1]],
xLabelFormat(x),
xAxisPosition,
false,
);
}
}
Expand All @@ -1586,6 +1589,7 @@ GraphUtils.createGraphie = function (el: any) {
[axisCenter[0], y],
yLabelFormat(y),
yAxisPosition,
false,
);
}
}
Expand All @@ -1602,6 +1606,7 @@ GraphUtils.createGraphie = function (el: any) {
[axisCenter[0], y],
yLabelFormat(y),
yAxisPosition,
false,
);
}
}
Expand Down

0 comments on commit 30a3b4b

Please sign in to comment.