You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: contributing.md
+22-14
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,9 @@
1
1
# Contributing
2
2
3
-
Thank you for contributing to plotly.py! We are actively looking for
3
+
Thank you for your interest in contributing to plotly.py! We are actively looking for
4
4
diverse contributors, with diverse background and skills.
5
5
6
-
This guide start by a general description of the different ways to contribute
6
+
This guide starts with a general description of the different ways to contribute
7
7
to plotly.py, then we explain some technical aspects of preparing your
8
8
contribution.
9
9
@@ -17,26 +17,34 @@ but the general idea is to be nice.
17
17
There are many ways to contribute to plotly.py. It helps to understand first
18
18
the structure of the code and of the repository.
19
19
20
-
- the `codegen` (package in `packages/python/plotly/codegen`): all the code
21
-
inside `plotly.graph_objects` is generated from the plotly javascript API
22
-
(the "schema"). The `codegen` package is where the code generation is done.
23
-
Most of the codegen code concerns the generation of docstrings. Traces and
20
+
-[the `plotly.graph_objects` module](https://plotly.com/python/graph-objects/) (usually imported as `go`)
21
+
is [generated from the Plotly.js schema](https://plotly.com/python/figure-structure/),
22
+
so changes to be made in this package need to be
23
+
[contributed to Plotly.js](https://github.com/plotly/plotly.js) or to the `codegen` system
24
+
in `packages/python/plotly/codegen`. Most of the codegen code concerns the generation of docstrings from
25
+
the schema JSON in Plotly.js. Traces and
24
26
Layout classes have a direct correspondence with their Javascript
25
-
counterpart. Additional methods are defined for the `Figure` object, such as
27
+
counterpart. Higher-level methods that work on on figures regardless of the current schema (e.g., `BaseFigure.for_each_trace`) are defined in `packages/python/plotly/plotly/basedatatypes.py`. Additional helper methods are defined there for the `Figure` object, such as
26
28
`update_layout`, `add_trace`, etc.
27
29
28
-
- the `plotly.express` package (usually imported as `px`) is a high-level
29
-
functional API. Its code is in `packages/python/plotly/express`. Most
30
-
functions of `plotly.express` call the internal `_make_figure` function
30
+
-[the `plotly.express` module](https://plotly.com/python/plotly-express/) (usually imported as `px`) is a high-level
31
+
functional API that uses `graph_objects` under the hood. Its code is in `packages/python/plotly/express`.
32
+
Plotly Express functions
33
+
are designed to be highly consistent with each other, and to do *as little computation
34
+
in Python as possible*, generally concerning themselves with formatting data and creating
35
+
figures out of `plotly.graph_objects` instances. Most
36
+
functions of `plotly.express` call the same internal `_make_figure` function
31
37
in `_core.py`. More generally, the internals of `px` consist of general
32
38
functions taking care of building the figure (defining subplots, traces
33
39
or frames, for example), with special cases for different traces handled
34
40
within these functions. There is also subsequent code reuse for `px`
35
41
docstrings, in particular for documenting parameters.
36
42
37
-
- the `plotly.figure_factory` module provides Python "recipes" for building
38
-
advanced visualizations, such as Gantt charts, annotated heatmaps, etc.
39
-
Figure factories are one of the easiest entry points into plotly.py, since
43
+
-[the `plotly.figure_factory` module](https://plotly.com/python/figure-factories/) (usually imported as `ff`)
44
+
provides Python "recipes" for building
45
+
advanced visualizations with involved computation done in Python, such as
46
+
Hexbin maps, ternary contour plots, etc.
47
+
Figure factories are one of the easiest entry points into contributing to plotly.py, since
40
48
they consist of Python-only code, with standalone, well-separated functions.
41
49
However, please note that some of the figure factories become less relevant
42
50
as we are introducing more features into `plotly.express`. Some issues in the
0 commit comments