Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
co2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tools
co2
Commits
03ae64f3
Verified
Commit
03ae64f3
authored
11 months ago
by
Ruben van Dijk
Browse files
Options
Downloads
Patches
Plain Diff
Convert to plotly.
parent
8ed5f806
Branches
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#13356
passed
11 months ago
Stage: deploy
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
generate.py
+5
-7
5 additions, 7 deletions
generate.py
poetry.lock
+27
-38
27 additions, 38 deletions
poetry.lock
pyproject.toml
+1
-1
1 addition, 1 deletion
pyproject.toml
with
33 additions
and
46 deletions
generate.py
+
5
−
7
View file @
03ae64f3
import
mpld3
import
pandas
as
pd
import
matplotlib.pyplot
as
plt
from
mpld3
import
plugin
s
import
plotly.tools
as
tl
s
#"off":"dicht", 'on':"open"
df
=
pd
.
read_csv
(
r
"
input/input.csv
"
)
...
...
@@ -31,8 +30,7 @@ co2.plot(figsize=(9, 4), ax=axs[0], ylabel='Co2', xlabel='')
raam
.
astype
(
float
).
plot
(
figsize
=
(
9
,
4
),
ax
=
axs
[
1
],
ylabel
=
'
Raam Dicht
'
,
drawstyle
=
'
steps-post
'
,
xlabel
=
""
)
plugins
.
connect
(
fig
,
plugins
.
MousePosition
())
html_str
=
mpld3
.
fig_to_html
(
fig
)
Html_file
=
open
(
"
output/all.html
"
,
"
w
"
)
Html_file
.
write
(
html_str
)
Html_file
.
close
()
plotly_fig
=
tls
.
mpl_to_plotly
(
fig
)
plotly_fig
.
data
[
1
].
line
.
shape
=
"
hv
"
# fix raam dicht steps
plotly_fig
.
data
[
1
].
xaxis
=
plotly_fig
.
data
[
0
].
xaxis
#fix zoom
plotly_fig
.
write_html
(
"
output/all.html
"
)
This diff is collapsed.
Click to expand it.
poetry.lock
+
27
−
38
View file @
03ae64f3
...
...
@@ -50,20 +50,6 @@ ufo = ["fs (>=2.2.0,<3)"]
unicode
=
[
"unicodedata2 (>=15.1.0)"
]
woff
=
[
"zopfli (>=0.1.4)"
,
"brotlicffi (>=0.8.0)"
,
"brotli (>=1.0.1)"
]
[[package]]
name
=
"jinja2"
version
=
"3.1.4"
description
=
"A very fast and expressive template engine."
category
=
"main"
optional
=
false
python-versions
=
">
=
3.7
"
[package.dependencies]
MarkupSafe
=
">
=
2.0
"
[package.extras]
i18n
=
[
"Babel (>=2.7)"
]
[[package]]
name
=
"kiwisolver"
version
=
"1.4.5"
...
...
@@ -72,14 +58,6 @@ category = "main"
optional
=
false
python-versions
=
">
=
3.7
"
[[package]]
name
=
"markupsafe"
version
=
"2.1.5"
description
=
"Safely add untrusted strings to HTML/XML markup."
category
=
"main"
optional
=
false
python-versions
=
">
=
3.7
"
[[package]]
name
=
"matplotlib"
version
=
"3.8.4"
...
...
@@ -99,18 +77,6 @@ pillow = ">=8"
pyparsing
=
">
=
2.3
.
1
"
python-dateutil
=
">
=
2.7
"
[[package]]
name
=
"mpld3"
version
=
"0.5.10"
description
=
"D3 Viewer for Matplotlib"
category
=
"main"
optional
=
false
python-versions
=
"*"
[package.dependencies]
jinja2
=
"*"
matplotlib
=
"*"
[[package]]
name
=
"numpy"
version
=
"1.26.4"
...
...
@@ -186,6 +152,18 @@ tests = ["check-manifest", "coverage", "defusedxml", "markdown2", "olefile", "pa
typing
=
[
"typing-extensions"
]
xmp
=
[
"defusedxml"
]
[[package]]
name
=
"plotly"
version
=
"5.22.0"
description
=
"An open-source, interactive data visualization library for Python"
category
=
"main"
optional
=
false
python-versions
=
">
=
3.8
"
[package.dependencies]
packaging
=
"*"
tenacity
=
">
=
6.2
.
0
"
[[package]]
name
=
"pyparsing"
version
=
"3.1.2"
...
...
@@ -224,6 +202,18 @@ category = "main"
optional
=
false
python-versions
=
">
=
2.7
,
!
=
3.0
.*
,
!
=
3.1
.*
,
!
=
3.2
.*
"
[[package]]
name
=
"tenacity"
version
=
"8.3.0"
description
=
"Retry code until it succeeds"
category
=
"main"
optional
=
false
python-versions
=
">
=
3.8
"
[package.extras]
doc
=
[
"reno"
,
"sphinx"
]
test
=
[
"pytest"
,
"tornado (>=4.5)"
,
"typeguard"
]
[[package]]
name
=
"tzdata"
version
=
"2024.1"
...
...
@@ -235,23 +225,22 @@ python-versions = ">=2"
[metadata]
lock-version
=
"1.1"
python-versions
=
"^3.10"
content-hash
=
"
3a725fc91fadf54e5a40d73173fe3412387e531beece90b0ab8966754fff7fa8
"
content-hash
=
"
152b3c2534c606794320bd45007852a27a0cde563982c9153e1d2882b72afea0
"
[metadata.files]
contourpy
=
[]
cycler
=
[]
fonttools
=
[]
jinja2
=
[]
kiwisolver
=
[]
markupsafe
=
[]
matplotlib
=
[]
mpld3
=
[]
numpy
=
[]
packaging
=
[]
pandas
=
[]
pillow
=
[]
plotly
=
[]
pyparsing
=
[]
python-dateutil
=
[]
pytz
=
[]
six
=
[]
tenacity
=
[]
tzdata
=
[]
This diff is collapsed.
Click to expand it.
pyproject.toml
+
1
−
1
View file @
03ae64f3
...
...
@@ -8,7 +8,7 @@ authors = ["Ruben <co2project@rubend.nl>", "Berinda"]
python
=
"^3.10"
matplotlib
=
"^3.8.4"
pandas
=
"^2.2.2"
m
pl
d3
=
"^
0.5.1
0"
pl
otly
=
"^
5.22.
0"
[tool.poetry.dev-dependencies]
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment