Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions graph/boxplot_basic.html
Original file line number Diff line number Diff line change
Expand Up @@ -219,12 +219,16 @@ <h5>Steps:</h5>

// Compute summary statistics used for the box:
var data_sorted = data.sort(d3.ascending)
var min_data = data_sorted[0]
var max_data = data_sorted[data_sorted.length - 1]
var q1 = d3.quantile(data_sorted, .25)
var median = d3.quantile(data_sorted, .5)
var q3 = d3.quantile(data_sorted, .75)
var interQuantileRange = q3 - q1
var min = q1 - 1.5 * interQuantileRange
var max = q1 + 1.5 * interQuantileRange
var lowerExtremeValue = q1 - 1.5 * interQuantileRange
var upperExtremeValue = q3 + 1.5 * interQuantileRange
var min = d3.max([min_data, lowerExtremeValue])
var max = d3.min([max_data, upperExtremeValue])

// Show the Y scale
var y = d3.scaleLinear()
Expand Down
2 changes: 1 addition & 1 deletion graph/custom_color.html
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ <h1>Categorical color scale</h1>
<p></p>
<p>You have a several groups, and want to attribute a specific color to each group. Several way to build this scale</p>
<ul>
<li>Give 2 colors as a range. Use <code>scaleLinear()</code></li>
<li>Give a list of colors as a range. Use <code>scaleOrdinal()</code></li>
<li>Use a palette coming from ColorBrewer. Use <code>scaleSequential()</code>. List of available palette <a href="https://www.r-graph-gallery.com/38-rcolorbrewers-palettes/">here</a>. These color scale are offered in the <a href="https://github.com/d3/d3-scale-chromatic">d3-scale-chromatic plugin</a></li>
<li>Palette coming from viridis. Same idea.</li>
</ul>
Expand Down