Skip to content

Commit e3dfb55

Browse files
committed
docs: add a hello world example in code
1 parent f502ce4 commit e3dfb55

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

README.md

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
---
1717

18-
Function Plot is a powerful library built on top of <a href="http://d3js.org/">D3.js</a> whose purpose
18+
function-plot is a powerful library built on top of <a href="http://d3js.org/">D3.js</a> whose purpose
1919
is to render functions with little configuration, think of it as a little clone of Google's plotting
2020
utility: [y = x * x](https://www.google.com/webhp?sourceid=chrome-instant&ion=1&espv=2&es_th=1&ie=UTF-8#q=y+%3D+x+%5E+2)
2121

@@ -36,20 +36,26 @@ npm install function-plot
3636

3737
## Examples
3838

39-
[`Examples in the homepage`](http://mauriciopoppe.github.io/function-plot/)
40-
41-
## API
42-
4339
```javascript
4440
import functionPlot from 'function-plot'
45-
functionPlot(options)
41+
functionPlot({
42+
target: '#root',
43+
data: [{
44+
fn: 'x^2',
45+
derivative: {
46+
fn: '2*x',
47+
updateOnMouseMove: true
48+
}
49+
}]
50+
})
4651
```
4752

48-
[`All the available options are described in the docs`](https://mauriciopoppe.github.io/function-plot/docs/functions/default-1.html)
53+
[`Check more examples in the homepage`](http://mauriciopoppe.github.io/function-plot/)
54+
55+
[`Check the available options in the docs`](https://mauriciopoppe.github.io/function-plot/docs/functions/default-1.html)
4956

5057
## License
5158

5259
2015-2023 MIT © Mauricio Poppe
5360

54-
5561
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fmauriciopoppe%2Ffunction-plot.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2Fmauriciopoppe%2Ffunction-plot?ref=badge_large)

0 commit comments

Comments
 (0)