-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[17.0][MIG] Migrate web_widget_plotly_chart
- Loading branch information
Showing
19 changed files
with
186 additions
and
153 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# generated from manifests external_dependencies | ||
plotly==5.22.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[build-system] | ||
requires = ["whool"] | ||
build-backend = "whool.buildapi" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
- Roberto Fichera \<<roberto.fichera@levelprime.com>\> | ||
- Michele Zaccheddu \<<michele.zaccheddu@levelprime.com>\> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
- This module uses the library | ||
[Plotly.js](https://github.com/plotly/plotly.js) which is under the | ||
open-source MIT License. Copyright (c) 2019 Plotly, Inc | ||
- Odoo Community Association (OCA) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
This module add the possibility to insert Plotly charts into Odoo | ||
standard views. | ||
|
||
![Plotly Chart inserted into an Odoo view](../static/description/example.png) | ||
|
||
[Plotly](https://plot.ly/) is a Python interactive visualization library | ||
built on top of d3.js and stack.gl, plotly.js is a high-level, | ||
declarative charting library. plotly.js ships with over 40 chart types, | ||
including scientific charts, 3D graphs, statistical charts, SVG maps, | ||
financial charts, and more. | ||
|
||
If you want to see some samples of plotly's capabilities follow this | ||
[link](https://github.com/plotly/plotly.py#overview). |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
You need to install the python plotly library: | ||
|
||
pip install plotly==5.22.0 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
To insert a Plotly chart in a view proceed as follows: | ||
|
||
1. Import plotly: | ||
|
||
import plotly | ||
|
||
2. Declare a text computed field like this: | ||
|
||
plotly_chart = fields.Text( | ||
string='Plotly Chart', | ||
compute='_compute_plotly_chart', | ||
) | ||
|
||
3. In its computed method do: | ||
|
||
def _compute_plotly_chart(self): | ||
for rec in self: | ||
data = [{'x': [1, 2, 3], 'y': [2, 3, 4]}] | ||
rec.plotly_chart = plotly.offline.plot(data, | ||
include_plotlyjs=False, | ||
output_type='div') | ||
|
||
4. In the view, add something like this wherever you want to display | ||
your plotly chart: | ||
|
||
<div> | ||
<field name="plotly_chart" widget="plotly_chart" nolabel="1"/> | ||
</div> |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.