-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support multiple marks for rawData plots (#68)
* First pass at rawData mark column * Move tip to its own function * Explicitly stack tip, remove unused tip code * Explicitly set name of mark column * Allow mark to be passed into getPrimaryMarkOptions * Add different symbol marks to categorical legends * Bring examples back in * Fix y axis only error * Fix markColumn type definition * Update border radius and multi chart example
- Loading branch information
Showing
9 changed files
with
119 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { renderPlot } from "../util/renderPlotClient.js"; | ||
// This code is both displayed in the browser and executed | ||
const codeString = ` | ||
const rawData = [ | ||
{col1: "a", col2: 5, col3: "Sales", mark: "barY"}, | ||
{col1: "b", col2: 2, col3: "Sales", mark: "barY"}, | ||
{col1: "c", col2: 3, col3: "Sales", mark: "barY"}, | ||
{col1: "a", col2: 10, col3: "Clicks", mark: "line"}, | ||
{col1: "b", col2: 5, col3: "Clicks", mark: "line"}, | ||
{col1: "c", col2: 5, col3: "Clicks", mark: "line"}, | ||
// TODO: would be nice if the mark generated a different color by default | ||
{col1: "a", col2: 10, col3: "Clicks-dot", mark: "dot"}, | ||
{col1: "b", col2: 5, col3: "Clicks-dot", mark: "dot"}, | ||
{col1: "c", col2: 5, col3: "Clicks-dot", mark: "dot"}, | ||
] | ||
const types = {col1: "string", col2: "number", col3: "string", mark: "string"} | ||
duckplot | ||
.rawData(rawData, types) | ||
.x("col1") | ||
.y("col2") | ||
.color("col3") | ||
.mark("dot") | ||
.markColumn("mark") | ||
`; | ||
|
||
export const rawDataMultiChart = (options) => | ||
renderPlot("stocks.csv", codeString, options); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters