Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dist/js/properties/non-scalar/BandStructureProperty.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export declare class BandStructureConfig extends HighChartsConfig {
});
cleanXDataArray(rawData?: XDataArray): XDataArrayNested;
calculatePointsDistance(listOfPoints?: XDataArrayNested): number[];
findSymmetryPointIndex(xDataArray: XDataArrayNested, point: number[]): number;
findSymmetryPointIndex(xDataArray: XDataArrayNested, point: number[], tolerance?: number): number;
plotXLines(): PlotLines[];
plotXLineAtPoint({ point, distance }: {
point: string;
Expand Down
4 changes: 2 additions & 2 deletions dist/js/properties/non-scalar/BandStructureProperty.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ class BandStructureConfig extends highcharts_1.HighChartsConfig {
});
}
// find index of a point inside an array of points
findSymmetryPointIndex(xDataArray, point) {
return xDataArray.findIndex((p) => math_1.math.vDist(p, point) === 0);
findSymmetryPointIndex(xDataArray, point, tolerance = 10 ** -exports._POINT_COORDINATES_PRECISION_) {
return xDataArray.findIndex((p) => math_1.math.vEqualWithTolerance(p, point, tolerance));
}
// create config for vertical lines at high symmetry points
plotXLines() {
Expand Down
8 changes: 6 additions & 2 deletions src/js/properties/non-scalar/BandStructureProperty.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,12 @@ export class BandStructureConfig extends HighChartsConfig {
}

// find index of a point inside an array of points
findSymmetryPointIndex(xDataArray: XDataArrayNested, point: number[]) {
return xDataArray.findIndex((p) => codeJSMath.vDist(p, point) === 0);
findSymmetryPointIndex(
xDataArray: XDataArrayNested,
point: number[],
tolerance = 10 ** -_POINT_COORDINATES_PRECISION_,
): number {
return xDataArray.findIndex((p) => codeJSMath.vEqualWithTolerance(p, point, tolerance));
}

// create config for vertical lines at high symmetry points
Expand Down
Loading