Skip to content

Commit ba89ec6

Browse files
committed
[fix] regarding [Bug]: Exponential Graph not displaying line #3
1 parent f06de97 commit ba89ec6

File tree

4 files changed

+71
-549
lines changed

4 files changed

+71
-549
lines changed

package.json

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,10 @@
77
"license": "MIT",
88
"private": true,
99
"scripts": {
10-
"build": "rimraf dist && make-dir dist && cpy manifest.json dist && webpack"
10+
"build": "webpack"
1111
},
1212
"devDependencies": {
13-
"cpy-cli": "^4.1.0",
14-
"make-dir-cli": "^3.0.0",
15-
"rimraf": "^3.0.2",
13+
"copy-webpack-plugin": "^11.0.0",
1614
"sass": "^1.51.0",
1715
"sass-loader": "^12.6.0",
1816
"ts-loader": "^9.3.0",
@@ -24,4 +22,4 @@
2422
"function-plot": "^1.22.8",
2523
"obsidian": "^0.11.13"
2624
}
27-
}
25+
}

src/main.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@ export default class ObsidianFunctionPlot extends Plugin {
3131
// styles
3232
el.classList.add('functionplot')
3333
// parse yaml for bounds and functions to plot
34-
34+
3535
const header = (source.match(/-{3}[^]+-{3}/) || [null])[0]
3636
const functions = (header ? source.substring(header.length) : source)
3737
.split('\n')
3838
.map(line => line.trim())
3939
.filter(line => line.length > 0)
40-
40+
4141
const config: HeaderOptions = Object.assign(
4242
{},
4343
DEFAULT_HEADER_OPTIONS,
@@ -58,7 +58,7 @@ export default class ObsidianFunctionPlot extends Plugin {
5858
domain: [config.bounds[2], config.bounds[3]],
5959
label: config.yLabel
6060
},
61-
data: functions.map(line => { return { "fn": line.split('=')[1].trim() } })
61+
data: functions.map(line => { return { fn: line.split('=')[1].trim(), graphType: 'polyline' } })
6262
}
6363
// render
6464
functionPlot(fPlotOptions)

webpack.config.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
const { join } = require('path');
2+
const CopyPlugin = require('copy-webpack-plugin');
23

34
module.exports = {
45
mode: "production",
@@ -23,6 +24,11 @@ module.exports = {
2324
}
2425
],
2526
},
27+
plugins: [
28+
new CopyPlugin({
29+
patterns: ['manifest.json']
30+
})
31+
],
2632
resolve: {
2733
extensions: ['.ts', '.js'],
2834
},
@@ -31,6 +37,7 @@ module.exports = {
3137
},
3238
output: {
3339
path: join(__dirname, "dist/"),
40+
clean: true,
3441
filename: 'main.js',
3542
libraryTarget: 'commonjs'
3643
}

0 commit comments

Comments
 (0)