Skip to content
Draft
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 src/marks/auto.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export interface AutoOptions {
* should usually suffice, and setting an explicit mark type may lead to a
* nonsensical plot (especially if you change other options).
*/
mark?: "area" | "bar" | "dot" | "line" | "rule";
mark?: "area" | "bar" | "dot" | "line" | "rule" | "box" | "voronoi";
}

/**
Expand Down
7 changes: 7 additions & 0 deletions src/marks/auto.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {frame} from "./frame.js";
import {line, lineX, lineY} from "./line.js";
import {rect, rectX, rectY} from "./rect.js";
import {ruleX, ruleY} from "./rule.js";
import {boxX, boxY} from "./box.js";

export function autoSpec(data, options) {
options = normalizeOptions(options);
Expand Down Expand Up @@ -141,6 +142,10 @@ export function autoSpec(data, options) {
: cell;
colorMode = "fill";
break;
case "box":
markImpl = X && isOrdinal(X) ? boxY : boxX;
colorMode = "fill";
break;
default:
throw new Error(`invalid mark: ${mark}`);
}
Expand Down Expand Up @@ -359,6 +364,8 @@ const impls = {
rectX,
rectY,
cell,
boxX,
boxY,
bin,
binX,
binY,
Expand Down
286 changes: 286 additions & 0 deletions test/output/autoBox.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading