Skip to content

fix links #1656

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 30, 2023
Merged
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
2 changes: 1 addition & 1 deletion docs/features/legends.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Plot.plot({

The legend above is a *swatches* legend because the *color* scale is *ordinal* (with a *categorical* scheme). When the *color* scale is continuous, a *ramp* legend with a smooth gradient is generated instead. The plot below of global average surface temperature ([GISTEMP](https://data.giss.nasa.gov/gistemp/)) uses a *diverging* *color* scale to indicate the deviation from the 1951–1980 average in degrees Celsius.

:::plot defer https://observablehq.com/@observablehq/plot-colored-scatterplot
:::plot defer https://observablehq.com/@observablehq/plot-diverging-color-scatterplot
```js
Plot.plot({
color: {
Expand Down
2 changes: 1 addition & 1 deletion docs/features/scales.md
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ Plot.plot({

Below we again show observed global surface temperatures. The reversed *BuRd* color scheme is used since <span :style="{borderBottom: `solid 2px ${d3.interpolateRdBu(0.9)}`}">blue</span> and <span :style="{borderBottom: `solid 2px ${d3.interpolateRdBu(0.1)}`}">red</span> are semantically associated with cold and hot, respectively.

:::plot https://observablehq.com/@observablehq/plot-colored-scatterplot
:::plot https://observablehq.com/@observablehq/plot-diverging-color-scatterplot
```js
Plot.plot({
grid: true,
Expand Down
2 changes: 1 addition & 1 deletion docs/interactions/crosshair.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Plot.plot({

The **color** option sets the fill color of the text and the stroke color of the rule. This option can be specified as a channel to reinforce a color encoding.

:::plot defer https://observablehq.com/@observablehq/plot-colored-crosshair
:::plot defer https://observablehq.com/@observablehq/plot-color-crosshair
```js
Plot.plot({
marks: [
Expand Down
8 changes: 4 additions & 4 deletions docs/marks/axis.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,27 +207,27 @@ Plot.plot({

The color of an axis can be controlled with the **color**, **stroke**, and **fill** options, which affect the axis’ component marks differently. The **stroke** option affects the tick vector; the **fill** option affects the label texts. The **color** option is shorthand for setting both **fill** and **stroke**. While these options are typically set to constant colors (such as _red_ or the default _currentColor_), they can be specified as channels to assign colors dynamically based on the associated tick value.

:::plot https://observablehq.com/@observablehq/plot-colored-axes
:::plot https://observablehq.com/@observablehq/plot-axes-with-color
```js
Plot.axisX(d3.ticks(0, 1, 10), {color: "red"}).plot() // text fill and tick stroke
```
:::

:::plot https://observablehq.com/@observablehq/plot-colored-axes
:::plot https://observablehq.com/@observablehq/plot-axes-with-color
```js
Plot.axisX(d3.ticks(0, 1, 10), {stroke: Plot.identity, strokeWidth: 3, tickSize: 10}).plot() // tick stroke
```
:::

:::plot https://observablehq.com/@observablehq/plot-colored-axes
:::plot https://observablehq.com/@observablehq/plot-axes-with-color
```js
Plot.axisX(d3.ticks(0, 1, 10), {fill: "red"}).plot() // text fill
```
:::

To draw an outline around the tick labels, say to improve legibility when drawing an axes atop other marks, use the **textStroke** (default _none_), **textStrokeWidth** (default 3), and **textStrokeOpacity** (default 1) options.

:::plot https://observablehq.com/@observablehq/plot-colored-axes
:::plot https://observablehq.com/@observablehq/plot-axes-with-color
```js
Plot.plot({
height: 40,
Expand Down
2 changes: 1 addition & 1 deletion docs/marks/bar.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ There is typically one ordinal value associated with each bar, such as a name (o

Above, since **y** was specified instead of **y1** and **y2**, the bar spans from zero to the given *y* value: if you only specify a single quantitative value, barY applies an implicit [stackY transform](../transforms/stack.md) and likewise barX implicitly applies stackX. The stacked horizontal bar chart below draws one bar (of unit width in **x**) per penguin, colored and sorted by the penguin’s body mass, and grouped by species along **y**.

:::plot defer https://observablehq.com/@observablehq/plot-colored-stacked-bar-chart
:::plot defer https://observablehq.com/@observablehq/plot-stacked-unit-chart
```js
Plot.plot({
marginLeft: 60,
Expand Down
2 changes: 1 addition & 1 deletion docs/marks/cell.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ Here the *x*-scale domain contains the *id* of every episode. An ordinal scale b

One-dimensional cells can be a compact alternative to a bar chart, where the *fill* color of the cell replaces the length of the bar. However, position is a more salient encoding and should be preferred to color if space is available.

:::plot https://observablehq.com/@observablehq/plot-colored-cells
:::plot https://observablehq.com/@observablehq/plot-color-cells
```js
Plot.cell(alphabet, {x: "letter", fill: "frequency"}).plot()
```
Expand Down
2 changes: 1 addition & 1 deletion docs/marks/dot.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ Plot.plot({

Dots support **stroke** and **fill** channels in addition to position along **x** and **y**. Below, color is used as a redundant encoding to emphasize the rising trend in average global surface temperatures. A *diverging* color scale encodes values below zero blue and above zero red.

:::plot defer https://observablehq.com/@observablehq/plot-colored-scatterplot
:::plot defer https://observablehq.com/@observablehq/plot-diverging-color-scatterplot
```js
Plot.plot({
y: {
Expand Down
2 changes: 1 addition & 1 deletion docs/transforms/bin.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ The binX transform takes **x** as input and outputs **x1** and **x2** representi

While the binX transform is often used to generate **y**, it can output any channel. Below, the **fill** channel represents count per bin, resulting in a one-dimensional heatmap.

:::plot defer https://observablehq.com/@observablehq/plot-colored-bins
:::plot defer https://observablehq.com/@observablehq/plot-color-bins
```js-vue
Plot
.rect(olympians, Plot.binX({fill: "count"}, {x: "weight"}))
Expand Down
4 changes: 2 additions & 2 deletions docs/why-plot.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Or put more simply: **with Plot, you’ll see more charts.**

You can make a meaningful chart in Plot with as little as one line of code.

:::plot https://observablehq.com/@observablehq/plot-concise-colored-scatterplot
:::plot https://observablehq.com/@observablehq/color-scatterplot
```js
Plot.dot(penguins, {x: "culmen_length_mm", y: "culmen_depth_mm", stroke: "species"}).plot()
```
Expand All @@ -39,7 +39,7 @@ What makes Plot concise? In a word: *defaults*. If you specify the semantics—y

The beauty of defaults is that you can override them as needed. This is ideal for exploring: you invest minimally in the initial chart, and as you start to see something interesting, you progressively customize to improve the display. Perhaps the plot above would be easier to read with an aspect ratio proportional to the data, a grid, and a legend?

:::plot https://observablehq.com/@observablehq/plot-refined-colored-scatterplot
:::plot https://observablehq.com/@observablehq/plot-refined-color-scatterplot
```js
Plot.plot({
grid: true,
Expand Down