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 24, 2024
1 parent 9db2c61 commit 64e91fe
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
22 changes: 13 additions & 9 deletions packages/perseus/src/util/graphie.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1303,16 +1303,16 @@ 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");
};
};
// if (smartLabelPositioning) {
// const minusIgnorer = function (lf: any) {
// return function (a) {
// return (lf(a) + "").replace(/-(\d)/g, "\\llap{-}$1");
// };
// };

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

this.init({
range: realRange,
Expand Down Expand Up @@ -1550,6 +1550,7 @@ GraphUtils.createGraphie = function (el: any) {
[x, axisCenter[1]],
xLabelFormat(x),
xAxisPosition,
false,
);
}
}
Expand All @@ -1566,6 +1567,7 @@ GraphUtils.createGraphie = function (el: any) {
[x, axisCenter[1]],
xLabelFormat(x),
xAxisPosition,
false,
);
}
}
Expand All @@ -1586,6 +1588,7 @@ GraphUtils.createGraphie = function (el: any) {
[axisCenter[0], y],
yLabelFormat(y),
yAxisPosition,
false,
);
}
}
Expand All @@ -1602,6 +1605,7 @@ GraphUtils.createGraphie = function (el: any) {
[axisCenter[0], y],
yLabelFormat(y),
yAxisPosition,
false,
);
}
}
Expand Down
3 changes: 2 additions & 1 deletion packages/perseus/src/util/interactive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ _.extend(GraphUtils.Graphie.prototype, {
options.label.setPosition(position);
options.label.processMath(text, /* force */ true);
} else {
graphie.label(position, text, "center", options.style);
graphie.label(position, text, "center", false);
}
}

Expand Down Expand Up @@ -2524,6 +2524,7 @@ _.extend(GraphUtils.Graphie.prototype, {
snapY: circle.snapY,
constraints: circle.centerConstraints,
});
console.log("circle.options", options);
circle.circ = graphie.circle(
circle.center,
circle.radius,
Expand Down

0 comments on commit 64e91fe

Please sign in to comment.