From fcc6a2b04a4cda9051573cdce7044de34c553577 Mon Sep 17 00:00:00 2001 From: Jonas de Luna Skulberg Date: Thu, 8 Aug 2024 10:13:01 +0200 Subject: [PATCH 1/2] Add color to plot again --- src/Components/Plot.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/Components/Plot.ts b/src/Components/Plot.ts index cf38e56..de7f612 100644 --- a/src/Components/Plot.ts +++ b/src/Components/Plot.ts @@ -11,6 +11,7 @@ type PlotOptions = { coefficients?: Coefficients; plotRange?: number; plotBetween: [number, number] | undefined; + color: number; }; const defaultPlotOptions = { @@ -19,6 +20,7 @@ const defaultPlotOptions = { lineWidth: 4, coefficients: {}, plotBetween: undefined, + color: undefined, }; type Coefficients = { @@ -50,7 +52,6 @@ class Plot extends Component { constructor(func: string, options?: PlotOptions) { super(); this.setFuncName(); - this.setColor(); const { numPoints = 1000, @@ -58,8 +59,13 @@ class Plot extends Component { lineWidth = 1, coefficients = {}, plotBetween = undefined, + color, } = { ...defaultPlotOptions, ...options }; - + if (!color) { + this.setColor(); + } else { + this.color = color; + } const minX = (-this.PLOTRANGE / 1) * 2 + 0; const maxX = (this.PLOTRANGE / 1) * 2 + 0; const initialCurve = new CatmullRomCurve3( From 9cc8d28426647823272bd25c064bdaddd769163c Mon Sep 17 00:00:00 2001 From: Jonas de Luna Skulberg Date: Thu, 8 Aug 2024 10:14:02 +0200 Subject: [PATCH 2/2] v1.0.89 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ff80e3a..a5f3585 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@kateter-platform/graphica", - "version": "1.0.88", + "version": "1.0.89", "source": "./src/index.ts", "description": "A tool for advanced graphing and visualization", "repository": {