score:11
that's neither a standard javascript object nor a d3 method. that's an observable method.
if you look at the introduction, you'll see that dom
is a collection of functions:
object {
canvas: ƒ(e, t)
context2d: ƒ(e, t, n)
download: ƒ(…)
element: ƒ(e, t)
input: ƒ(e)
range: ƒ(e, t, n)
select: ƒ(e)
svg: ƒ(e, t)
text: ƒ(e)
uid: ƒ(e)
}
so, in an observable notebook, one can do...
dom.text("i am a text node.")
...to create a text node or, as you just found,
dom.svg(500, 50)
...to create an svg. however, that only works in an observable notebook.
score:4
to expand on the previous answer, dom is indeed part of the standard library in observable. you can use it and the rest of the standard library methods outside of observable by exporting or embedding a notebook, as described in the downloading and embedding notebooks documentation page.
Source: stackoverflow.com
Related Query
- d3 is not defined - ReferenceError
- Uncaught ReferenceError: d3 is not defined
- D3: Uncaught ReferenceError: stream_layers is not defined
- Uncaught (in promise) ReferenceError: topojson is not defined
- ReferenceError - d3 is not defined
- (Flask, d3) Uncaught ReferenceError: d3 is not defined
- Uncaught ReferenceError: d3Scale is not defined / D3 V4 / rollup.js
- Displaying SVG elements with D3 and d3.slider: Uncaught ReferenceError: svg is not defined
- Uncaught ReferenceError: d3 is not defined in WordPress Visual Composer
- Uncaught ReferenceError: d3 is not defined
- Uncaught Reference Error: queue is not defined
- changing from html to jsp : referenceerror d3 is not defined
- D3 transition looping throwing Uncaught TypeError: t.call is not a function
- Uncaught TypeError: xScale.rangeBand is not a function in d3.js
- Uncaught TypeError: t.rgb is not a function
- "Uncaught ReferenceError: DOM is not defined"
- Uncaught TypeError: this.y.rangeBand is not a function after migration to D3 version 4
- Unit testing AngularJS directive, postLink D3 not changing DOM
- SVG added to DOM using javascript is not visible.
- Retrieve DOM target from drag callback when `this` is not available
- Uncaught TypeError: d3.queue is not a function D3.js
- d3.min.js Uncaught TypeError: a.map is not a function
- d3.min.js:1 Uncaught TypeError: n.getFullYear is not a function
- Uncaught TypeError: this.d3.set is not a function
- D3.js - Uncaught TypeError: .enter(...).append(...).merge is not a function
- Uncaught TypeError: (void 0) is not a function using d3 with angular 7
- Uncaught TypeError: svg.selectAll is not a function in D3.js force layout
- Uncaught TypeError: d3.scaleOrdinal is not a function
- Errors Using `d3.legend`: Uncaught TypeError: node.getAttribute is not a function
- Jshint: error : d3 is not defined
More Query from same tag
- How to read multiple files to plot on one line graph in D3.js
- D3 Tree Graph - How to transition links when using straight line, not diagonal
- d3 line chart, line not drawing
- Applying Bostock's wrap function on text
- How to add arc d3 v4 map
- How to zoom around an svg
- Graphing code size
- d3 center bar chart's x-axis on arbitrary value
- d3.js: Is it possible to line transition by key instead of index?
- Dispatching drag-end event
- "marker-mid" is not working with path d3.js force layout
- D3 and chord diagram
- D3 tooltip display on page load
- Concurrency transitions in D3 (circle following filling path)
- How to use custom Angular filter inside directive with D3
- D3 scatter plot - visible points outside the chart after zoom
- D3.js Collapsible tree: Adding a label for each level
- How to set d3.layout.force.charge once d3.layout.force has already been initialized?
- Groups and lines from nested data
- d3 in node and in browser - How to import?
- D3/JS mapping a JSON data callback
- loading json through javascript/D3
- Bar chart output isn't what's expected
- Count the number of rows of a CSV file, with d3.js
- Updating a Pie Chart in d3.js
- n3 line chart x axis label
- Trouble Binding JSON subarrays in d3.js
- How to create an interaction between charts in d3
- D3 line chart legend not working with v3 but working with v2
- d3 y axis label position