Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jan 30 22:34
    SteveCapetta opened #3482
  • Nov 08 2018 23:28
    leemi edited #3481
  • Nov 08 2018 23:28
    leemi opened #3481
  • Oct 27 2018 00:40
    rstarkov edited #3480
  • Oct 27 2018 00:40
    rstarkov edited #3480
  • Oct 27 2018 00:34
    rstarkov opened #3480
  • Oct 19 2018 14:59
    stephanwlee opened #3479
  • Oct 14 2018 14:15
    waltonseymour opened #3478
  • Oct 04 2018 09:20
    VasylKoretskyy closed #3477
  • Oct 04 2018 09:19
    VasylKoretskyy opened #3477
  • Oct 01 2018 00:47
    waltonseymour opened #3476
  • Sep 21 2018 20:22
    pastewka edited #3475
  • Sep 21 2018 20:21
    pastewka synchronize #3475
  • Sep 21 2018 20:11
    pastewka synchronize #3475
  • Sep 21 2018 18:38
    pastewka opened #3475
  • Sep 13 2018 11:21
    Fatou1993 opened #3474
  • Jul 20 2018 19:41
    riley-steele-parsons opened #3473
  • Jun 28 2018 15:32
    reckoner opened #3472
  • Jun 04 2018 23:01

    themadcreator on v3.8.3

    (compare)

  • Jun 04 2018 23:00

    themadcreator on 3.8.3

    (compare)

Bob12345
@Bob12345
@Bob12345 I think I have figured it out-- you can access the datasets' data array and push new values onto it. Adding a dataset every time actually adds whole new set of data and is not something you'd want to do.
var xx= 0;
$('#content').ready(function() { 
    setInterval(function() {
        var myData0 = plotGroupTop.components()[0].datasets()[0].data();
        var myData1 = plotGroupBottom.components()[0].datasets()[0].data();
        var t = (myData0 === plotGroupTop.components()[0].datasets()[0].data());
        $('#output').html(
                    "output: <p>" + " 0:" + myData0.length+ "  1:" + myData1.length + " ===" + t            
        );
        var mydate = new Date(myData0[myData0.length - 1].date);
        mydate = mydate.setHours(mydate.getHours()+ (++xx ));        
        myData0.push({date: mydate, value: 
        myData0[myData0.length - 1].value + Math.random() * 2 - 1
        });
        myData1.push({date: mydate, value: 
        myData1[myData1.length - 1].value + Math.random() * 2 - 1
        });
        plotGroupTop.components()[0]._onDatasetUpdate();
        plotGroupBottom.components()[0]._onDatasetUpdate();
    }, 200);
});
Sacha Zvetelman
@SachaZvetelman
Hey everyone, does someone have a working example of Plottable being used with Aurelia? Cheers!
Samuel Mburu
@samuelmburu
hi all, it's been awhile since I've been here (when 2.9.1 was the hot newness haha), I'm upgrading and wondering to myself will plottable v4 depend on d3v5 if so, when will that happen?
just some backround -- I decided to go with d3v3 and plottableV2.x, but now after missing out on so many perf updates I wonder if it was a mistake to not go with d3v4 and plottableV3... I'm trying not to do the same again. Any thoughts, words of wisdom?
@Bob12345 if i recall properly you can add the new data to the array data object under the dataset and then tell the plot to redraw itself and that will get you there (I did this with plottableV2.9.1) This should still work if dataset is constructed the same way as in v2, but I haven't read 3.X docs so i'm not sure --- good luck
Samuel Mburu
@samuelmburu

@SachaZvetelman how do you mean? plottable and aurelia are just javascript can you explain in more detail what you are trying to do with aurelia?

i work with angular + plottableV2.9.1 to display visualizations on my company website. the basic idea is create your plottable chart and then layer on anything extra in either d3(svg things) or with angular(data from server type of things). When it comes to interacting with angular(or insert framework of choice here) you'll have to incorporate plottable chart creation into the angular event/dispatch loop so that when any data changes your chart changes accordingly. I can go into more detail, but let me know if what i say makes sense

karolinkas
@karolinkas
Hey there, I have a question about switching to a newer version of Plottable as well. I'm still on version 2.5 and have build pretty complex plots with lots of different charts. Can I expect the chart update to be noticeable faster when switching to a newer version?
Bob12345
@Bob12345
image.png
@samuelmburu thanks for your reply. I think I have figured it out. took a little head-scratching since I'm new to js and plottable. it's plotting!!!! :smile:
Bob12345
@Bob12345

@karolinkas using

<script src="http://cdnjs.cloudflare.com/ajax/libs/d3/4.5.0/d3.js" charset="utf-8"></script>

<script src="http://unpkg.com/plottable@3.6.1/plottable.js" charset="utf-8"></script>
I think d3 has some breaking/migration pages on github

Bob12345
@Bob12345
jack fuller
@hachtman
Screen Shot 2018-05-16 at 14.19.00.png
Hi All, I'm using a Segment plot to overlay a Line plot ad have a couple of questions. 1. Is this good prcactive or should I be using GuideLineLayer? Secondly, can I add labels to the top of the Segment lines, as above? Thanks!
Luke LaFountaine
@lukelafountaine

I am just starting to play around with Plottable and am having trouble even creating a simple segment graph like the one here: http://plottablejs.org/components/plots/segment/

I am using version 3.8.3

var Plottable = require("plottable");

var xScale = new Plottable.Scales.Linear();
var yScale = new Plottable.Scales.Linear();

var plot = new Plottable.Plots.Segment()

The last line is erroring out: Uncaught TypeError: Cannot read property 'style' of null.

Any thoughts as to what is going on?

knjname
@knjname
Hi, I'm reading tutorial and made the first basic chart with React.
https://github.com/knjname/2018-07_plottablePlaygroud/blob/master/src/App.tsx
But it doesn't work. There's no chart properly drawn.
Of course I once have stopped using React (i.e., make chart draw on div element directly) but it showed the same result. Anyone has an idea about this?
image.png
Ghost
@ghost~5b46fd5bd73408ce4fa08cae
Anyone experience with localizing dates on an axis?
karolinkas
@karolinkas
@lukelafountaine It would help to see you code rather than a link to your documentation. Could you copy it to a JSFiddle?
@ghost~5b46fd5bd73408ce4fa08cae We have used moment.js to localise dates.
@knjname I think to would be better to pass in a className or id to the renderTo() method. At least from what I know about React you don't use refs for this.
karolinkas
@karolinkas
And now my question: we have a service sending us data to be visualised which is taking quite some time, that will not get improved performance right now. So what happens is that the axis is being drawn first with an initial date of 1970 and only later when the actually data comes in the line chart is being drawn and the axis get initialised with the correct dates. Do I have to write promises manually for the order of drawing axis first and then the lineChart later, when the data is ready?
Dominic Wörner
@domwoe
Hi! I'm experimenting with Plottable, but I'm having issues with plotting more than one plot using Plottable.Components.Group(). Both plots end up in the DOM but only the last one is visible.
Dominic Wörner
@domwoe
any advice? :)
Dominic Wörner
@domwoe
solved it. Reason was I used a class called "content" on my site
Another quick question: I'm using a time scale. What would be the suggested way to add a button that sets the scale back to default (init), because pan zoom can mess up the chart
Romit Khanal
@upsteer
I want to resize a component according my given height and width instead of Plottable automatically setting them. How can I do that?
Romit Khanal
@upsteer
For an interpolated color legend, how do I set the height, width for the component?
Kyle Bedell
@FullstackJack
Hi, how do I render a line chart with holes in the dataset? I don't want the line to go to zero where I don't have data. I want the line to stop and start again where there is actually is data.
Also, on a separate note, I had to add his bit of CSS to prevent the chart from positioning itself along the right edge of the page.
.plottable .background-container, .plottable .content, .plottable .foreground-container { left: 0; }
Kyle Bedell
@FullstackJack
I imagine I'd have to create two datasets if I want to split the line.
Would be nice if nullin y direction handled this.
Kyle Bedell
@FullstackJack
Uh-oh, big red flag, is there no way of making a bezier curved line? The examples with the oscillating line chart is faked with tons of little straight line segments.
Kyle Bedell
@FullstackJack
Oh, phew! Had to dig through the code, but plot.curve('cardinal') fixes that.
Tsion Behailu
@tbehailu
Hey all! I'm new to plottable and looking for some advice on changing the styles of the StackedBar plot. Is it possible to change the shape of the bars to a different shape? I'm interested in creating bars with rounded tops (image attached
Screen Shot 2018-12-04 at 11.49.52 AM.png
Jānis Elmeris
@JanisE
Hello! I would like to know, if it's possible to draw a line graph with more than one (multiple) Y-axis ()? (I would need three.)
Ian Smith
@ismith78

Hi. First of all I want to say thank you for creating such a useful module.

I have a question about the selection colour for the XDragBoxLayer. It appears as a washed out grey colour and I need it to be a bit more obvious, however the XDragBoxLayer doesn't seem to support attr or have an obvious way of changing the background colour.

I'm obviously missing something here but I just can't seem to spot it. So when I drag an area, how do I specify the colour that the area is drawn in?

Ian Smith
@ismith78

@ismith78 Found the issue - the colour is controlled by css and there was a definition that was pulled in elsewhere in the code that set the opacity to 0.03. After changing that the box is more visible.

If anyone else gets stuck, the css that I ended up using was

.plottable .selection-box-layer .selection-area {
fill: black;
fill-opacity: 0.3;
stroke: #CCC;
}

Nahuel Rosso
@arraydude

Hello guys!, i'm trying to replace my old d3 implementation using this library and it looks really straight forward but i having an issue, the API Documentation says that exists an DoubleClick interaction but webpack is saying :

Interactions.DoubleClick is not a constructor

Ian Smith
@ismith78

What is the best way of disposing of a graph when leaving a page? I have registered a ngOnDestroy which I use to make a call to the plottable destroy method. However there appears to be something trying to make a call inside plottable on mouse movement as I see the following crash

core.js:15714 ERROR TypeError: Cannot read property 'node' of undefined
at Function.../../node_modules/plottable/build/src/utils/transformAwareTranslator.js.Translator.isEventInside (transformAwareTranslator.js:56)
at Mouse.../../node_modules/plottable/build/src/dispatchers/mouseDispatcher.js.Mouse.eventInside (mouseDispatcher.js:167)
at Pointer.../../node_modules/plottable/build/src/interactions/pointerInteraction.js.Pointer._handleMouseEvent (pointerInteraction.js:38)
at CallbackSet.Pointer._this._mouseMoveCallback (pointerInteraction.js:19)
at callbackSet.js:26
at callbackWrapper (set.js:56)
at Set.forEach (<anonymous>)
at CallbackSet.../../node_modules/plottable/build/src/utils/set.js.Set.forEach (set.js:57)
at CallbackSet.../../node_modules/plottable/build/src/utils/callbackSet.js.CallbackSet.callCallbacks (callbackSet.js:25)
at Mouse.../../node_modules/plottable/build/src/dispatchers/dispatcher.js.Dispatcher._callCallbacksForEvent (dispatcher.js:80)
at Mouse.../../node_modules/plottable/build/src/dispatchers/mouseDispatcher.js.Mouse._measureAndDispatch (mouseDispatcher.js:163)
at HTMLDocument.processMoveCallback (mouseDispatcher.js:21)

I had been trapping on Interact onPointerMove and onPointerExit, but made sure that these events were cleared before the call to destroy method and that makes no difference

Ian Smith
@ismith78

Is there any way to dynamically define if a GuideLineLayer text is aligned to the left or right of the guideline? I'm seeing the same issue as can be seen with the example at http://plottablejs.org/examples/spacerace/.
If I hover the mouse on the far right data point (First Man on Moon 1969) then the text at the bottom is lost as the text cannot fit from the left of the gridline. It should be displayed to the right of the gridline (i.e. if the gridline is more to the right the label should switch).

However I have not been able to find anything in the API that controls this behaviour - is this something controlled in the CSS somewhere?

Ian Smith
@ismith78
My expectation was that this was controlled by xAlignment and that if I called xAlignment("right") that would flip the alignment of the text. However it seems that although I can check that the value has been set, changing the value from "left" to "right" has no effect.
nikhilesh
@nikitiwari_twitter

Hi,
Is it possible to create multi level charts.
For example Continent wise, Country wise, State wise sales.

Hence on the X axis there is a grouping happening at continent wise, then within that countrywise and then within that we should see state wise actual bars with values??

Something like below
https://i.stack.imgur.com/CYp8Y.jpg

A sample code will be very very helpful
Thanks a lot
Samuel Mburu
@samuelmburu
Hi there, it's been a while since I've been back, but I have a question regarding the clusteredBar plot -- is there any way to find out the gap size between the bars in a cluster?
the api docs aren't very clear as to how to find that out
Samuel Mburu
@samuelmburu
i was thinking that i could use the attribute projector to get the barWidth multiplied by the scale.innerPadding, but that did not work

well i took the longer route and used the attribute projector for barWidth, and then x1 position of my first datapoint from the first dataset, then the x position of the first datapoint from my second dataset of then the math is like this

bar2Xpos - (bar1Xpos + barWidth). <- that gives the spacing between bars -- hope that helps someone else

Samuel Mburu
@samuelmburu
i wish there was a function that returned that, but oh well
😔