• Stars
    star
    131
  • Rank 266,586 (Top 6 %)
  • Language
    JavaScript
  • License
    ISC License
  • Created about 6 years ago
  • Updated 10 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

The Observable standard inspector.

@observablehq/inspector

Node CI

This library implements the default value renderer for Observable programs. When used with the Observable runtime as observers, inspectors can insert elements into the DOM and render interactive displays for arbitrary values.

To install this library from npm:

npm install @observablehq/inspector

This library is also available for download from unpkg as an ES module and as a UMD bundle.

API Reference

Inspectors

An inspector implements the Observable runtime’s Observer interface by rendering the current value of its associated variable to a given DOM element. Inspectors display DOM elements “as-is”, and create interactive “devtools”-style inspectors for other arbitrary values such as numbers and objects.

# new Inspector(element) <>

Creates a new inspector attached to the specified DOM element. See also Inspector.into.

# inspector.pending() <>

Applies the observablehq--running class to this inspector’s element.

# inspector.fulfilled(value) <>

Inspects the specified value, replacing the contents of this inspector’s element as appropriate, and dispatching an update event. If the specified value is a DOM element or text node, and the value is not already attached to the DOM, it is inserted into this inspector’s element, replacing any existing contents. Otherwise, for other arbitrary values such as numbers, arrays, or objects, an expandable display of the specified value is generated into this inspector’s element. Applies the observablehq class to this inspector’s element, and for non-element values, the observablehq--inspect class.

# inspector.rejected(error) <>

Inspects the specified error, replacing the contents of this inspector’s element as appropriate with the error’s description, and dispatching an error event. Applies the observablehq and observablehq--error class to this inspector’s element.

# Inspector.into(container) <>

Returns a function that when passed a given variable, returns a new inspector attached to a new DIV element within the specifier container element. If container is a string, it represents a selector, and the container element becomes the matching selected element. This method can be used with an Observable module definition as the observer factory to conveniently render an entire program.

More Repositories

1

plot

A concise API for exploratory data visualization implementing a layered grammar of graphics
HTML
3,811
star
2

framework

A static site generator for data apps, dashboards, reports, and more. Observable Framework combines JavaScript on the front-end for interactive graphics with any language on the back-end for data analysis.
TypeScript
1,660
star
3

runtime

The reactive dataflow runtime that powers Observable Framework and Observable notebooks
JavaScript
958
star
4

stdlib

The Observable standard library.
JavaScript
943
star
5

htl

A tagged template literal that allows safe interpolation of values into HTML, following the HTML5 spec
JavaScript
290
star
6

parser

The Observable parser.
JavaScript
175
star
7

array

Manipulate columnar data efficiently using typed arrays.
JavaScript
125
star
8

inputs

Better input elements
JavaScript
111
star
9

examples

Examples of using Observable in a variety of contexts
HTML
102
star
10

datasets

Test datasets for convenience in Observable notebooks.
JavaScript
67
star
11

database-proxy

A proxy to connect Observable notebooks to databases on private networks
JavaScript
47
star
12

vega

Convenience methods for using Vega and Vega-Lite in Observable.
JavaScript
42
star
13

feedback

Customer submitted bugs and feature requests
41
star
14

graphviz

A convenience method for using Graphviz.
JavaScript
39
star
15

plot-create-react-app-example

An example of Observable Plot with Create React App
JavaScript
38
star
16

prettier-react-tachyons

A prettier transform for React and Tachyon users.
JavaScript
29
star
17

notebook-download-example

An example of downloading and embedding an Observable notebook into a web app.
JavaScript
23
star
18

rollup-plugin-credits

Generate license credits
JavaScript
16
star
19

react-zoomable-sunburst

create-react-app + observablehq
JavaScript
15
star
20

katex

A minimally-tweaked distribution of KaTeX.
CSS
9
star
21

create

JavaScript
9
star
22

plot-cheatsheets

An interactive reference + PDF for learning Observable Plot
7
star
23

documentation

7
star
24

observable-jupyter

This repository has been archived. Please see the fork maintained by Thomas Ballinger.
Jupyter Notebook
4
star
25

odsc-visualization

Code for talk at ODSC East 2024
JavaScript
3
star
26

.github

Default community health files for Observable's open-source projects
2
star
27

codemirror-testing

A repo to test out CodeMirror outside of our infrastructure
TypeScript
1
star