Skip to content

Commit

Permalink
Merge pull request #13 from thclark/feature/update-plotly-and-sphinx
Browse files Browse the repository at this point in the history
Feature/update plotly and sphinx
  • Loading branch information
thclark authored Feb 11, 2022
2 parents 16d19e9 + cd92c1b commit 2677131
Show file tree
Hide file tree
Showing 22 changed files with 1,088,142 additions and 247 deletions.
7 changes: 1 addition & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
exclude: "build|node_modules|.git/|.tox|dist|sphinx_charts.egg-info|((?:[^/]*/)*)(.svg)|((?:[^/]*/)*)(.xml)"
exclude: "build|node_modules|.git/|.tox|dist|sphinx_charts.egg-info|((?:[^/]*/)*)(.svg)|((?:[^/]*/)*)(.xml)|sphinx_charts/plotly/|sphinx_charts/extensions/"
default_stages: [commit]
fail_fast: true
default_language_version:
Expand All @@ -14,11 +14,6 @@ repos:
- id: no-commit-to-branch
- id: trailing-whitespace

- repo: https://gitlab.com/bmares/check-json5
rev: v1.0.0
hooks:
- id: check-json5

- repo: https://github.com/psf/black
rev: 21.12b0
hooks:
Expand Down
2 changes: 1 addition & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ python:
sphinx:
builder: html
configuration: docs/source/conf.py
fail_on_warning: false
fail_on_warning: false
6 changes: 0 additions & 6 deletions MANIFEST.in

This file was deleted.

29 changes: 16 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@
[![black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)
[![black-girls-code](https://img.shields.io/badge/black%20girls-code-f64279.svg)](https://www.blackgirlscode.com/)

# Sphinx Charts

# Sphinx Charts

Interactive charts, graphs and figures for sphinx using plotly and D3.
Interactive charts, graphs and figures for sphinx using [plotly v2.8.3](https://plotly.com/) and D3.

[Documentation is here](https://sphinx_charts.readthedocs.io).

Expand All @@ -25,6 +24,7 @@ extensions = [
```

Paste the following into a new file `<your_docs_src_directory>/charts/test.json`:

```
{
"data": [
Expand All @@ -40,6 +40,7 @@ Paste the following into a new file `<your_docs_src_directory>/charts/test.json`
```

Include the following directive in your `*.rst` file:

```
.. chart:: charts/test.json
Expand All @@ -48,7 +49,6 @@ Include the following directive in your `*.rst` file:

... and away you go!


## Developer notes

**Note: You don't need to pay attention to the following unless you plan to develop sphinx_charts itself.**
Expand All @@ -63,6 +63,7 @@ Include the following directive in your `*.rst` file:
### Pre-Commit

You need to install pre-commit to get the hooks working. Do:

```
pip install pre-commit
pre-commit install
Expand All @@ -82,23 +83,26 @@ Upon failure, the commit will halt. **Re-running the commit will automatically f
- You'll have to fix documentation yourself prior to a successful commit (there's no auto fix for that!!).

You can run pre-commit hooks without making a commit, too, like:

```
pre-commit run black --all-files
```

or

```
# -v gives verbose output, useful for figuring out why docs won't build
pre-commit run build-docs -v
```


### Contributing

- Please raise an issue on the board (or add your $0.02 to an existing issue) so the maintainers know
what's happening and can advise / steer you.
- Please raise an issue on the board (or add your \$0.02 to an existing issue) so the maintainers know
what's happening and can advise / steer you.

- Create a fork of {{library_name}}, undertake your changes on a new branch, (see `.pre-commit-config.yaml` for branch naming conventions). To run tests and make commits,
you'll need to do something like:
you'll need to do something like:

```
git clone <your_forked_repo_address> # fetches the repo to your local machine
cd sphinx_charts # move into the repo directory
Expand All @@ -111,14 +115,13 @@ tox # Runs the tests with coverage. NB you c

- Adopt a Test Driven Development approach to implementing new features or fixing bugs.

- Ask the `sphinx_charts` maintainers *where* to make your pull request. We'll create a version branch, according to the
roadmap, into which you can make your PR. We'll help review the changes and improve the PR.
- Ask the `sphinx_charts` maintainers _where_ to make your pull request. We'll create a version branch, according to the
roadmap, into which you can make your PR. We'll help review the changes and improve the PR.

- Once checks have passed, test coverage of the new code is >=95%, documentation is updated and the Review is passed, we'll merge into the version branch.

- Once all the roadmapped features for that version are done, we'll release.


### Release process

The process for creating a new release is as follows:
Expand All @@ -134,7 +137,6 @@ The process for creating a new release is as follows:
9. Merge to master. Successful test, doc build, flake8 and a new version number will automatically create the release on pypi.
10. Go to code > releases and create a new release on GitHub at the same SHA.


## Documents

### Building documents automatically
Expand All @@ -145,19 +147,20 @@ In fact, the way pre-commit works, you won't be allowed to make the commit unles
this way we avoid getting broken documentation pushed to the main repository on any commit sha, so we can rely on
builds working.


### Building documents manually

**If you did need to build the documentation**

Install `doxgen`. On a mac, that's `brew install doxygen`; other systems may differ.

Install sphinx and other requirements for building the docs:

```
pip install -r docs/requirements.txt
```

Run the build process:

```
sphinx-build -b html docs/source docs/build
```
9 changes: 5 additions & 4 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

# Required by the python script for building documentation
Sphinx>=2,<3
sphinx-rtd-theme==0.5.0
sphinx-tabs==1.2.1
sphinx-math-dollar==1.1.1
sphinx>=4,<5
sphinx-rtd-theme==1.0.0
sphinx-tabs==1.2
sphinx_math_dollar==1.1.1
docutils==0.16
13 changes: 12 additions & 1 deletion docs/source/charts/test_bar_and_scatter_plot.json
Original file line number Diff line number Diff line change
@@ -1 +1,12 @@
{"data":[{"type":"bar","x":["cppgiraffes","orangutans","monkeys"],"y":[2,2.5,3]},{"type":"scatter","x":[0,1,2],"y":[1,2,3]}],"layout":{},"meta":{"caption":"","id":"","name":"","short_caption":""}}
{
"data": [
{
"type": "bar",
"x": ["cppgiraffes", "orangutans", "monkeys"],
"y": [2, 2.5, 3]
},
{ "type": "scatter", "x": [0, 1, 2], "y": [1, 2, 3] }
],
"layout": {},
"meta": { "caption": "", "id": "", "name": "", "short_caption": "" }
}
1,083,617 changes: 1,083,616 additions & 1 deletion docs/source/charts/test_mandelbrot_plot.json

Large diffs are not rendered by default.

Loading

0 comments on commit 2677131

Please sign in to comment.