Comments (7)
Hi, another Pyxley user here. At Tamedia Digital (Zurich), the data science team is planning to use Pyxley for quick dashboard implementation. We'd love to see datetimes supported for line charts. Thanks!
from pyxley.
Another user who is using Pyxley and ran into this same issue. One should be allowed to specify the date format of the data.
from pyxley.
I think the problem is that I'm casting a string to a Date. You should be able to format however you like, it just needs to be a string when it's transmitted to the javascript. I can probably force that in the default request function.
from pyxley.
No. I tried string and it did not work. If I recall right the problem is
that the MG date formatting function that is called from d3 expects a
format and without a format passed it assumes a default of Y M and D. That
is my recollection when I tried to understand whats going on.
Thanks
On Thu, Jan 7, 2016 at 8:23 AM, Nick Kridler [email protected]
wrote:
I think the problem is that I'm casting a string to a Date. You should be
able to format however you like, it just needs to be a string when it's
transmitted to the javascript. I can probably force that in the default
request function.—
Reply to this email directly or view it on GitHub
#17 (comment).
from pyxley.
Here's the javascript code that does the conversion.
_update: function(params) {
d3.json(this.props.options.url.concat("?",$.param(params)),
function(error, data){
var options = this.props.options.params;
if(data.date){
for(var i=0; i < data.result.length; i++){
data.result[i] = MG.convert.date(data.result[i], "x");
}
}
options.data = data.result;
MG.data_graphic(options);
}.bind(this));
},
https://github.com/stitchfix/pyxleyJS/blob/master/src/metricsgraphics.js
I'll have to look in to it and try it with different date formatting.
from pyxley.
Right. On this line data.result[i] = MG.convert.date(data.result[i], "x"); is
called to convert Date. But because no format is passed it uses default
format of %Y-%m-%d
https://github.com/mozilla/metrics-graphics/wiki/Convenience-Functions
Converts a data object's values from strings to javascript Date objects
that can then be plotted. The function parses %Y-%m-%d-styled timestamps by
default. An optional third argument allows one to specify an alternative
style, per the formats defined here:
How do I as user of Pyxley override this behavior? (Sorry if I am missing
something obvious - I am not a Javascript expert).
Thanks for your help.
On Thu, Jan 7, 2016 at 8:47 AM, Nick Kridler [email protected]
wrote:
Here's the javascript code that does the conversion.
https://github.com/stitchfix/pyxleyJS/blob/master/src/metricsgraphics.js
—
Reply to this email directly or view it on GitHub
#17 (comment).
from pyxley.
This worked for me:
for(var i = 0; i < data.length; i++) {
data[i] = MG.convert.date(data[i], 'date', '%Y-%m-%dT%H:%M:%SZ');
}
My date in database looks like this: 2018-04-28T13:24:55Z
from pyxley.
Related Issues (20)
- Error: Module not found: Error: Cannot resolve module 'react-dom' HOT 2
- Does it need a server or is everything running on the client side? HOT 2
- bower.json missing from datatables example
- Error instaling node-sass when using pyxapp --init . (ubuntu 14.04) HOT 1
- how can i refresh the data periodically? HOT 1
- Add LICENSE to MANIFEST.in HOT 1
- pyxley in production HOT 1
- Error with webpack HOT 1
- pyxley's example can't run successful!!!
- Example Wrong!!!! HOT 3
- requirements.txt HOT 2
- problem running the basic app HOT 2
- Line Plot not plotting properly HOT 7
- Passing the url parameters from layout to the components HOT 2
- Adding Google map integration
- Unable to arrange plots side by side.
- updating the underlying data does not change the plots and charts on the web page HOT 4
- getting pyxley to work HOT 1
- Loading pyxley charts and datatable from jquery
- Proposing a PR to fix a few small typos
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 pyxley.