-
Notifications
You must be signed in to change notification settings - Fork 622
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
Support href and cursor properties for marks #3229
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -193,7 +193,7 @@ export interface VgSignal { | |
push?: string; | ||
} | ||
|
||
export type VgEncodeChannel = 'x'|'x2'|'xc'|'width'|'y'|'y2'|'yc'|'height'|'opacity'|'fill'|'fillOpacity'|'stroke'|'strokeWidth'|'strokeOpacity'|'strokeDash'|'strokeDashOffset'|'cursor'|'clip'|'size'|'shape'|'path'|'innerRadius'|'outerRadius'|'startAngle'|'endAngle'|'interpolate'|'tension'|'orient'|'url'|'align'|'baseline'|'text'|'dir'|'ellipsis'|'limit'|'dx'|'dy'|'radius'|'theta'|'angle'|'font'|'fontSize'|'fontWeight'|'fontStyle'; | ||
export type VgEncodeChannel = 'x'|'x2'|'xc'|'width'|'y'|'y2'|'yc'|'height'|'opacity'|'fill'|'fillOpacity'|'stroke'|'strokeWidth'|'strokeOpacity'|'strokeDash'|'strokeDashOffset'|'cursor'|'clip'|'size'|'shape'|'path'|'innerRadius'|'outerRadius'|'startAngle'|'endAngle'|'interpolate'|'tension'|'orient'|'url'|'align'|'baseline'|'text'|'dir'|'ellipsis'|'limit'|'dx'|'dy'|'radius'|'theta'|'angle'|'font'|'fontSize'|'fontWeight'|'fontStyle'|'tooltip'|'href'|'cursor'; | ||
export type VgEncodeEntry = { | ||
[k in VgEncodeChannel]?: VgValueRef | (VgValueRef & {test?: string})[]; | ||
}; | ||
|
@@ -1056,6 +1056,18 @@ export interface VgMarkConfig { | |
* Placeholder text if the `text` channel is not specified | ||
*/ | ||
text?: string; | ||
|
||
/** | ||
* A URL to load upon mouse click. If defined, the mark acts as a hyperlink. | ||
* | ||
* @format uri | ||
*/ | ||
href?: string; | ||
|
||
/** | ||
* The mouse cursor used over the mark. Any valid [CSS cursor type](https://developer.mozilla.org/en-US/docs/Web/CSS/cursor#Values) can be used. | ||
*/ | ||
cursor?: 'auto' | 'default' | 'none' | 'context-menu' | 'help' | 'pointer' | 'progress' | 'wait' | 'cell' | 'crosshair' | 'text' | 'vertical-text' | 'alias' | 'copy' | 'move' | 'no-drop' | 'not-allowed' | 'e-resize' | 'n-resize' | 'ne-resize' | 'nw-resize' | 's-resize' | 'se-resize' | 'sw-resize' | 'w-resize' | 'ew-resize' | 'ns-resize' | 'nesw-resize' | 'nwse-resize' | 'col-resize' | 'row-resize' | 'all-scroll' | 'zoom-in' | 'zoom-out' | 'grab' | 'grabbing'; | ||
} | ||
|
||
const VG_MARK_CONFIG_INDEX: Flag<keyof VgMarkConfig> = { | ||
|
@@ -1084,17 +1096,18 @@ const VG_MARK_CONFIG_INDEX: Flag<keyof VgMarkConfig> = { | |
font: 1, | ||
fontSize: 1, | ||
fontWeight: 1, | ||
fontStyle: 1 | ||
fontStyle: 1, | ||
cursor: 1, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure why previously list Btw, does it really make sense to have There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Working on it There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
works |
||
href: 1, | ||
// commented below are vg channel that do not have mark config. | ||
// 'x'|'x2'|'xc'|'width'|'y'|'y2'|'yc'|'height' | ||
// cursor: 1, | ||
// clip: 1, | ||
// dir: 1, | ||
// ellipsis: 1, | ||
// endAngle: 1, | ||
// path: 1, | ||
// innerRadius: 1, | ||
// outerRadius: 1, | ||
// path: 1, | ||
// startAngle: 1, | ||
// url: 1, | ||
}; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
neither