TargetProcess/tauCharts

tickPeriod and tickFormat don't work for date scales

Closed this issue · 3 comments

Hi @jlewis91,

See updated sample https://jsfiddle.net/ykycn16p/1/

To make periodic scale working at the moment you have to specify period scale for dimension explicitly. Also once you start to define dimensions - you have to make it for all dimensions (see lines 14-17). Yes, I know it is annoying but I plan to simplify this soon (2-4 weeks from now). Preliminary, specifying "tickPeriod" will be enough in future.

Also in your original sample tickPeriod was equal to 100 which is invalid value. According to documentation there is a set of pre-defined periods:

  • day
  • week (split timeline by sundays)
  • month
  • quarter
  • year

Also you can define your own period. See details here http://api.taucharts.com/plugins/customticks.html

I will be happy to hear how you use taucharts. Can I ask you to leave a short feedback to make the project better?

Let me know if you have any questions / problems / ideas?

Vladimir Petriko,
Taucharts crew

Hey! Thanks for this and for the quick response. Amazing library, by the way and really clean source code. :)

Indeed, the original example did not save some of my changes & thus had an incorrect parameter. While the period scale might work for some purposes, if I want to have a weekly scale, I run into the following problem:
https://jsfiddle.net/ykycn16p/4/

...which I tried to fix with a continuous scale, but this doesn't seem to accept the tickPeriod argument.

As for feedback:
I think this is an great library, which has nice implementations of almost all of the requisite features one needs for interactive viz. I'm currently working on a few updates to the R library wrapper to iron out some bugs, hope this may make some of your new features and improvements available to the R crew and lead to increased uptake. As far as I'm concerned, you have the best open source solution out their in your niche.

I would like to use the lib at work for putting together dashboards and providing semi-interactive reports, but haven't been able to do this yet. One prerequisite has been that there is an R library which connects with it, but I guess I should have this solved by this week or so. ;)

One of the biggest issues (and I know this is a huge time invest, especially for an open source project which is developing quickly) is that the documentation is often very clear but somewhat out of date and split up among a bunch of different pages and blog posts.

For example, this page doesn't seem to correspond to the latest api. http://api.taucharts.com/datasource/index.html

Many of the new features are only mentioned in blog posts & I've been resorting to skimming the source code for implementing things like the quick_filter in the R wrapper.

There are also two smaller issues which I haven't seen written up:

Huge thanks for the detailed feedback! Unfortunately, pure documentation is the most frequent claim.

Now let me put some clarification on the original issue.

While the period scale might work for some purposes, if I want to have a weekly scale, I run into the following problem: https://jsfiddle.net/ykycn16p/4/

Taucharts goes from the data so time values must be accurately prepared for period scale. The "week" period scale splits timeline to discrete weekly intervals and suppose a beginning of week (Sunday) to be a tick value. A Sunday date can be re-formatted to "Week 1", "Week N" etc. using "tickFormat" parameter.

Specifying "week" period you make Taucharts implicate that data has a weekly basis. If date doesn't match Sunday date exactly - it casts the given date to the beginning of week. In your example there are several date values for each week since data has a daily basis:

...
x: new Date(now - days(i)),
...

You can observe this if convert a line chart to scatter plot: https://jsfiddle.net/ykycn16p/8/

...which I tried to fix with a continuous scale, but this doesn't seem to accept the tickPeriod argument.

Continuous "time" scale is not compatible with "tickPeriod" parameter. You can format ticks for continues time scale with "tickFormat" parameter but can't manage which exact ticks to show (inside we use native d3 time scale and it works weird sometimes). I will think what we can do with that.

https://jsfiddle.net/ykycn16p/9/

Let me know if you still have a questions on this.

If you don't mind other mentioned issues let's track and discuss separately.
Thanks again for your nice feedback. It inspires to move forward :)