pachadotdev / d3po Goto Github PK
View Code? Open in Web Editor NEWMega htmlwidget for Shiny.
Home Page: https://pacha.dev/d3po
License: Apache License 2.0
Mega htmlwidget for Shiny.
Home Page: https://pacha.dev/d3po
License: Apache License 2.0
What remains to finish the migration to D3.js 5.x:
Why it cannot be done currently:
What is recommended:
Additionally, it would be good to:
=== npm audit security report ===
# Run npm install --save-dev [email protected] to resolve 6 vulnerabilities
SEMVER WARNING: Recommended action is a potentially breaking change
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ High │ Regular Expression Denial of Service │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package │ minimatch │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ gulp [dev] │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path │ gulp > vinyl-fs > glob-stream > glob > minimatch │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info │ https://npmjs.com/advisories/118 │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ High │ Regular Expression Denial of Service │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package │ minimatch │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ gulp [dev] │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path │ gulp > vinyl-fs > glob-stream > minimatch │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info │ https://npmjs.com/advisories/118 │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ High │ Regular Expression Denial of Service │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package │ minimatch │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ gulp [dev] │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path │ gulp > vinyl-fs > glob-watcher > gaze > globule > glob > │
│ │ minimatch │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info │ https://npmjs.com/advisories/118 │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ High │ Regular Expression Denial of Service │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package │ minimatch │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ gulp [dev] │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path │ gulp > vinyl-fs > glob-watcher > gaze > globule > minimatch │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info │ https://npmjs.com/advisories/118 │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ Moderate │ Prototype Pollution │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package │ lodash │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ gulp [dev] │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path │ gulp > vinyl-fs > glob-watcher > gaze > globule > lodash │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info │ https://npmjs.com/advisories/782 │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ Low │ Prototype Pollution │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package │ lodash │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ gulp [dev] │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path │ gulp > vinyl-fs > glob-watcher > gaze > globule > lodash │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info │ https://npmjs.com/advisories/577 │
└───────────────┴──────────────────────────────────────────────────────────────┘
With shiny, this is suppossed to be able to change titles (among other things) but it doesn't work.
Here's a reproducible example: https://github.com/pachamaltese/d3po/blob/master/dev/api-2.R
I'm thinking about building an "open highcharter", something that allows interactive D3 visualization from Shiny in a very easy way. Think of this as Ikea furniture, something that is accesible and fits almost anywhere.
R already features excellent visualization libraries such as D3 (via the r2d3 package) or plotly, however though those enable the creation of great looking visualisations they have very steep learning curves and even sometimes require some understanding of JavaScript.
After LatinR I realised that, for this to be complete, it has to include internationalization (i.e. show 1.000 instead of 1,000 in spanish) and provide easy i18n activation for example with functions like the_chart(..., lang = "es")
.
The idea is to take the good ideas from highcharts, but also other good ideas from echarts, vegaLite and D3plus to create an R package that is easy to use and provides a set of well polished D3 templates for interactive visualization.
As an R user, I'm thinking about something designed for the %>%
operator and the ultimate aim of the project is to produce a package that:
Need to implement all proxy methods, currently only available for po_title
.
The example geo.html
has never worked for me. It would be great if it worked, so that I may verify that my refactoring work doesn't break it.
I'll leave this in your hands @pachamaltese .
See https://github.com/pachamaltese/d3po/blob/master/javascript/src/color/random.js and https://github.com/pachamaltese/d3po/blob/master/javascript/src/color/scale.js
Reading the code, the expected behavior seems to be:
// defined as: d3.scale.ordinal().range(["#bf3251", "#5c57d9", "#d6c650", "#406662", "#872a41", "#1c26b3", "#d05555", "#549e95", "#993f7b", "#dc8e7a", "#ede788", "#7485aa", "#4d6fd0", "#635b56", "#7454a6", "#a8c380", "#8abdb6", "#74c0e2", "#bcd8af", "#a1aafb", "#a17cb0", "#d1a1bc"]);
var defaultScale = require("./scale.js");
console.log(defaultScale(3))
// expected: "#406662", because it's the fourth color in the array (idx=3)
// actual: "#bf3251", because it's the first call to the scale and the argument (3) is not in the scale domain
But it's not, because no domain is defined for the ordinal scale. The actual behavior is that every call to the defaultScale
function will return the following value in the range, and the argument is ignored since the domain is empty (in reality, every new argument is added to the domain, and a further call with the same argument will return the same value):
// defined as: d3.scale.ordinal().range(["#bf3251", "#5c57d9", "#d6c650", "#406662", "#872a41", "#1c26b3", "#d05555", "#549e95", "#993f7b", "#dc8e7a", "#ede788", "#7485aa", "#4d6fd0", "#635b56", "#7454a6", "#a8c380", "#8abdb6", "#74c0e2", "#bcd8af", "#a1aafb", "#a17cb0", "#d1a1bc"]);
var defaultScale = require("./scale.js");
console.log(defaultScale(235))
// returns the first value: #bf3251
console.log(defaultScale("string"))
// returns the second value: #5c57d9
console.log(defaultScale(0))
// returns the third value: #d6c650
console.log(defaultScale(235))
// returns the first value again: #bf3251, because 235 has been added to the domain
Thus, the values returned by https://github.com/pachamaltese/d3po/blob/master/javascript/src/color/random.js are not random at all.
check here: https://github.com/pachamaltese/d3plus/blob/master/dev/sankey.R#L20
example to replicate: http://d3plus.org/examples/basic/a523b45768c2ca464363/
Add missing po_line
and po_scatter
/po_point
this network works ok in rstudio viewer pane: https://github.com/pachamaltese/d3plus/blob/master/dev/network.R
Part of #15, the goal here is to split up large JS files ( > 500 lines) into smaller modules.
hola @fbecerra
en el ultimo commit deje un ejemplo en javascript que ejecuto con python -m http.server, me gustaria dejar el boton de descarga dentro del div del titulo, con miras a agregarle un subtitulo despues (pero no ahora mismo)
the resize is not working but after I manually reload browser tab
Title is not aligned correctly.
example to replicate: https://www.highcharts.com/demo/line-basic
example to replicate: http://d3plus.org/examples/basic/9042919/
check here: https://github.com/pachamaltese/d3plus/blob/master/dev/sankey.R#L20
example to replicate: http://d3plus.org/examples/basic/a523b45768c2ca464363/
What remains to finish the migration to D3.js 5.x:
Why it cannot be done currently:
What is recommended:
Additionally, it would be good to:
Before I start modifying code towards #16 , I want to be able to verify that everything still works at each step. I see there is a /dev
directory with several examples in .html
files. However, it's not clear how to run these. One way I can see is to copy-paste the code from those into the index.html
of the src
directory.
What I'm thinking of doing as a next step is to set up a page that shows all those examples at once, zoomed out, so that I can verify with little effort that nothing breaks when I change code. It's not exactly unit tests, but it's the same in spirit (let's call it "visual unit tests").
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.