Skip to content

Commit

Permalink
fix: multiple functions, docs
Browse files Browse the repository at this point in the history
  • Loading branch information
leonhma committed Aug 23, 2022
1 parent 0f65ff8 commit f83ba0a
Show file tree
Hide file tree
Showing 15 changed files with 32 additions and 4,243 deletions.
1 change: 1 addition & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ automation:

invalid:
- 'LICENSE'
- 'versions.json'
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ node_modules/
yarn-error.log
main.js
data.json
package-lock.json
13 changes: 13 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Contributing

Contibutions are always welcome! We appreciate every help with this project, be it just submitting issues or feature requests, picking one up and working on it, making edits to the wiki or opening a pull request with a new feature or a bugfix, as it helps grow the project.

TL;DR:

- The `minAppVersion` should be kept up-to-date

## Rules

Because obsidian keeps an index of versions of the plugin and their respective minimum version requirements for obsidian itself, the `minAppVersion` field in `manifest.json` and the version of the dependency `obsidian` in `package.json` should be kept equal. The version should also reflect the lowest version of api under which the plugin will work. The dependency version in `package.json` is pinned to a single version.

Oh, and also: This project uses yarn, although it doesn't matter if you use another package manager so long as you don't commit the log and lock files to VCS. Just be sure to let us know of your choice of package manager if you encounter a problem.
67 changes: 14 additions & 53 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,74 +4,35 @@ A plugin for displaying mathematical graphs in obsidian.md.

> *Remember to star this plugin on [Github](https://github.com/leonhma/obsidian-functionplot) if you like it.*
## How to use

Since version `1.1.0` you can create plots via a handy GUI. Open the command palette and select `Obsidian Functionplot: Plot a function`. This opens a dialog where you can easily specify the options and functions to plot.

### Manual usage

1. Type:

~~~text
```functionplot
---
title: Graph
disableZoom: false
bounds: [-10, 10, -10, 10]
grid: true
xLabel: x
yLabel: y
---
f(x) = x^2
g(x) = 0.5*x^3+x^2-44
```
~~~
*This file only contains basic instructions to get you to using this plugin quickly. If you want a more detailed documentation, take a look at the [wiki](https://github.com/leonhma/obsidian-functionplot/wiki).*

*(The metadata header in this example contains all possible options, you don't usually have to specify all of them)*

2. This will create a coordinate system with bounds `-10 < x < 10, -10 < y < 10` and plot the functions f and g. If you havent disabled it, you can even drag and zoom the graph.

![Graph image](./images/graph-light.png#gh-light-mode-only)
![Graph image](./images/graph-dark.png#gh-dark-mode-only)

## Options

This section describes all the header options in yaml format.
## How to use

`title`: string, default: ""
> The title of the graph.
Since version `1.1.0` you can create plots via a handy GUI with live-preview functionality.

`disableZoom`: boolean, default: false
> If true, the user can't zoom the graph.
1. Open the command pallete and select `Obsidian Functionplot: Plot a Function`

`bounds`: array, default: [-10, 10, -10, 10]
> The initial bounds of the graph. If disableZoom is true, this is permanent.
2. Adjust the plot to your liking.

`grid`: boolean, default: true
> If true, a grid is drawn.
![Create plot modal](./images/create-modal/light.png#gh-light-mode-only)
![Create plot modal](./images/create-modal//dark.png#gh-dark-mode-only)

`xLabel`: string, default: ""
> The label of the x-axis.
3. This will create a coordinate system with bounds `-10 < x < 10, -10 < y < 10` and plot the functions f and g. If you havent disabled it, you can even drag and zoom the graph.

`yLabel`: string, default: ""
> The label of the y-axis.
![Graph image](./images/plot/light.png#gh-light-mode-only)
![Graph image](./images/plot/dark.png#gh-dark-mode-only)

## Questions

If you have any questions about the usage of the plugin, take a look at the [wiki](https://github.com/leonhma/obsidian-functionplot/wiki) or post a question in the [discussions](https://github.com/leonhma/obsidian-functionplot/discussions).

## Bugs and Errors

If you encounter any errors while using this plugin, please follow these steps:
If you encounter any errors while using this plugin, please report them to us. To do so, click [this link](https://github.com/leonhma/obsidian-functionplot/issues/new?assignees=leonhma&labels=bug&template=BUG_REPORT.yml), fill out the form as best as you can and click `Submit new issue`. These issues are publically viewable, so please don't submit any personal information.

## Contributing

1. Make sure you have followed the syntax as described above.
2. Ensure that you are using the latest version of this plugin. Do this by going to the "Community plugins" tab in the settings, and clicking "Check for updates".
3. If the issue still persists, please report it on GitHub. (If you managed to solve this problem on your own, but think we should know about it, please file the fitting type of issue.)
1. Go to the "Issues" tab of the repo.
2. Search for your error. If you can find it, chime in to the converation and let us know that it happened to you too. It appears this is a known issue and it is currently being worked on.
3. If you can't find it, open a new issue. Do this by clicking the "New issue" button in the top right. Select "Bug report".
4. Fill out the issue with as much information as you can. Your issue will be resolved in the near future.
Contributions are always welcome! Be it submitting issues, editing the wiki or creating a pull request, contributions by people like you help keep the project evolving. Please adhere to the [contributing guidelines](CONTRIBUTING.md).

## Attribution

Expand Down
Binary file added images/create-modal/dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/create-modal/light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed images/graph-dark.png
Binary file not shown.
Binary file removed images/graph-light.png
Binary file not shown.
Binary file added images/plot/dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/plot/light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/settings/dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/settings/light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit f83ba0a

Please sign in to comment.