This is one of the series of examples, where we step by step introduce new chart properties for the same set of charts.
Here, we wfurther fine tune our plots, to make them more easy to read. We add titles to axes and plots,
and rename axes ticks. One could have already noticed that setting the colourValue
property automatically
generates a legend
. Here, we will show how to manipulate this legend and how to create them manually.
The data used here are generated in a drug-screening experiment. 50 drugs at 5 different concentrations were tested against 21 pancreatic cancer cell lines. The heatmap shows drug-drug correlation. Like in the previous example, a click on a cell of the heatmap reveals the underlying statistics by demonstrating on the scatter plot (right upper corner) the values of avarage inhibition for all tested cell lines and the two selected drugs. By clicking on a data point one can select a cell line, and thus change the third plot (right bottom corner) that demonstrates individual inhibition percent values for the two selected drugs and the selected cell line.
A user of our framework can create apps with very little code. Bellow we show the part of the code that hasn't been explained in previous examples. You can find the complete code at the bottom of the page.
|
Click on all the yellow bubbles (), going from top to bottom, to see explanations of the code. Some lines of code, that have been already described in the previous examples, were omitted for the sake of simplicity. At the bottom of the page you can find the complete code. The Here, we define a title of the plot. In this example, two plots has fixed titles, while the title of the curvefitting
plot changes, indicating what cell line has been selected. So, as any interactively changing property, this title
as defined via a callback function, otherwise only the current value of the As a Initializing and placing a all the scatter plots with all their layers. Here, we set titles for X and Y axes. By default, the title of the legend that is generated after setting the Here, we fix domains for X and Y axes. By default, domains are defined to fit the current data, but if we want to compare different sets of data, it may be useful to fix scales to encompass all available data. Note, that fixing the domain doesn't prohibit zooming in and out. Here, we set the tick labels to be used instead of default ones, generated by d3.axis. The value passed to this property should be a set of arrays, where the first array should be a set of ticks to be displayed and all others are the labels to use for these values. Here, we define a variable to set the ticks. In this example, we used integer values from 0 to 4 to as indeces for the five tested concentrations. Now we want to replace this values with the actual concentrations. We know that all the drugs were tested at five concentrations, each 10 times higher than the previous one. But the minimal tested concentration may differ from drug to drug, so it's not enough to have just one set of labels. The linked-charts library supports having multiple sets of lables (try to find a pair of drugs with different concentrations to see how it works). If we have several sets of labels, we would like to have an easy way to indicate what drug this label corresponds to.
To this end, here we are adding an optional For each chart a legend is stored in as
|
Show/hide full code