npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

joplin-plugin-function-plot

v1.0.0

Published

This plugin render a fenced JSON options into a function plot. It is essentially a Joplin wrapper of the function-plot library of Mauricio Poppe, which does most of the heavy lifting.

Downloads

18

Readme

Function Plot

This plugin render a fenced JSON options into a function plot. It is essentially a Joplin wrapper of the function-plot library of Mauricio Poppe, which does most of the heavy lifting.

screenshot

Usage

Some simple examples can be found in the example below. For advanced usage please check the document of function-plot. Note that some features of the library are not supported by the plugin such as linked graphs, tip function, etc. Basically anything that outside the JSON options are not supported.

One important warning is that you need to write the options in JSON format while examples in function-plot is actually javascript objects. Meaning that you need to double-quote all keys, do not use single quote, and do not leave ending comma.

# 📈 Function Plot

## Plotting a curve

- $y=x^2$

```function-plot
{
  "width" : 400,
  "height": 250,
  "target": "#quadratic",
  "data": [{
    "fn": "x^2"
  }]
}
```



- Advanced
```function-plot
{
  "width" : 400,
  "height": 250,
  "target": "#quadratic",
  "data": [{
    "fn": "x^2"
  }],
  "title": "Function y = x * x",
  "xAxis": {
    "label": "x - axis",
    "domain": [-6,6]
  },
  "yAxis": {
    "label": "y - axis"
  },
  "disableZoom": true,
  "grid": true
}
```


## Derivative
```function-plot
{
  "width" : 400,
  "height": 250,
  "target": "#derivative",
  "data": [{
    "fn": "x^2",
    "derivative": {
      "fn": "2 * x",
      "x0": 2,
      "updateOnMouseMove": true
    }
  }]
}
```

## Range and closed path
- $sin(x) +3$
```function-plot
{
  "width" : 400,
  "height": 250,
  "target": "#closed",
  "xAxis": {"domain": [-2, 12]},
  "data": [{
    "fn": "3 + sin(x)",
    "range": [2, 8],
    "closed": true
  }]
}
```

## Multiple graphs
```function-plot
{
  "width" : 400,
  "height": 250,
  "target": "#multiple",
  "data": [
    { "fn": "x", "color": "pink" },
    { "fn": "-x" },
    { "fn": "x * x" },
    { "fn": "x * x * x" },
    { "fn": "x * x * x * x" }
  ]
}
```


## Parametric Function
```function-plot
{
  "width" : 400,
  "height": 250,
  "target": "#parametric-circle",
  "yAxis": {"domain": [-1.897959183, 1.897959183]},
  "xAxis": {"domain": [-3, 3]},
  "data": [{
    "x": "cos(t)",
    "y": "sin(t)",
    "fnType": "parametric",
    "graphType": "polyline"
  }]
}

```

## Constants
- $\pi$
```function-plot
{
  "width" : 400,
  "height": 250,
  "target": "#pi-constant",
  "data": [
    {"fn": "sin(x)"},
    {"fn": "sin(x+PI/4)"},
    {"fn": "sin(x+PI/2)"}]
}
```

- $e$

```function-plot
{
  "width" : 400,
  "height": 250,
  "target": "#euler-constant",
  "data": [
    {"fn": "E^x", "graphType":"polyline"}
  ]

}
```

Acknowledgement

  • This plugin is not possible without the function-plot library of Mauricio Poppe

License

MIT