Skip to content

Commit 8564e38

Browse files
committed
Fixed issues resolving the default chart template.
1 parent a5170d4 commit 8564e38

3 files changed

Lines changed: 3 additions & 29 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "data-forge-plot",
3-
"version": "0.2.0",
3+
"version": "0.2.2",
44
"description": "Plotting API for use with Data-Forge.",
55
"main": "build/index.js",
66
"types": "build/index.d.ts",

src/find-package-dir.ts

Lines changed: 0 additions & 25 deletions
This file was deleted.

src/plot-api.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import { assert } from "chai";
1010
const opn = require("opn");
1111
import * as path from "path";
1212
import * as Sugar from "sugar";
13-
import { findPackageDir } from "./find-package-dir";
1413
import { ISerializedDataFrame } from "data-forge/build/lib/dataframe";
1514
import { exportTemplate, IExportOptions } from "inflate-template";
1615
import { captureImage, ICaptureOptions } from "capture-template";
@@ -22,8 +21,8 @@ import { captureImage, ICaptureOptions } from "capture-template";
2221
// TODO :export let globalChartRenderer: IChartRenderer | null = null;
2322

2423
async function findChartTemplatePath(): Promise<string> {
25-
const parentDir = await findPackageDir(__dirname);
26-
const chartTemplatesPath = path.join(parentDir, "node_modules", "@data-forge-plot", "c3", "build", "template");
24+
const defaultTemplatePath = require.resolve("@data-forge-plot/c3/build/template/template.json");
25+
const chartTemplatesPath = path.dirname(defaultTemplatePath);
2726
return chartTemplatesPath;
2827
}
2928

0 commit comments

Comments
 (0)