Comments (3)
Thank you for posting your issue and clear explanation.
First of all, there was an issue with the datetime format that I fixed. Secondly the timedelta was shown in hours but should have been in minutes. I also fixed this! The parameter timedelta can now be changed in minutes, hours and days. Otherwise it can take a lot of time for the simulation when a long timespan is used. The default is minutes and now the movements in movingbubbles with your data seem to be correct now! But also check it again. I noticed in your query that no datetime format was specified. This is important because the default is different.
Update to the latest version with:
pip install -U d3blocks
Example:
df = pd.read_csv(r'C:\temp\test_AL.csv')
# Notes that are shown between two time points.
time_notes = [{"start_minute": 1, "stop_minute": 10, "note": "The first 10 minutes start in the state Regarder la TV."}]
time_notes.append({"start_minute": 11, "stop_minute": 360, "note": "Then we stay in this state up to 12:00"})
time_notes.append({"start_minute": 361, "stop_minute": 390, "note": "Finally the Consulter de l actualite happens and is up to 13:30."})
time_notes.append({"start_minute": 391 , "stop_minute": 450, "note": "aaaand we go back to the first state.."})
from d3blocks import D3Blocks
d3 = D3Blocks()
d3.movingbubbles(df,
standardize=None,
dt_format='%Y-%m-%d %H:%M:%S',
time_notes=time_notes,
title='d3blocks_movingbubbles',
speed={"slow": 1000,
"medium": 200,
"fast": 20},
)
# Check the movements
print(d3.edge_properties)
# If you want to specify the time_notes, best is to use the cumsum of the time in the state.
d3.edge_properties['time_in_state'].cumsum()
from d3blocks.
The percentage stil needs a fix. I just realized this. This is computed in javascript itself and not python. Each block has its own set of js functions. For movingbubbles it is movingbubbles.html.j2
// Output readable percent based on count.
function readablePercent(n) {
var pct = 100 * n / 1000;
if (pct < 1 && pct > 0) {
pct = "<1%";
} else {
pct = Math.round(pct) + "%";
}
return pct;
}
from d3blocks.
I fixed this issue too now in v1.2.6!
from d3blocks.
Related Issues (20)
- The blogs/tutorials are behind a paywall HOT 3
- treemap example fails on d3.show() HOT 6
- Tidy tree feature HOT 3
- Issue importing, minmax_distance: list[float] = [50, 100] in d3graph.py, line 879 HOT 4
- Working with very large graphs (d3graph) HOT 2
- error to import d3blocks in jupyter notebook HOT 6
- How to change node colors in sankey plots? HOT 5
- Sunburst HOT 1
- RecursionError: maximum recursion depth exceeded while calling a Python object HOT 4
- Sorting issue on Chord diagrams HOT 2
- Change node shape and node label position in D3graph ? HOT 2
- Saving graphics as high resolution image HOT 3
- How do I break a text label into multiple rows? HOT 1
- Inclusion of "ethical ads" HOT 3
- Sankey font size HOT 4
- Sankey: order of entries
- Tooltip in treemap HOT 2
- Tree Diagram 1-to-many visualization HOT 1
- "color for link " is not aviliable in chord. HOT 1
- I cannot import d3blocks HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from d3blocks.