-
Notifications
You must be signed in to change notification settings - Fork 5
API
Everything in this library is scoped under the webcodebook namespace:
object
the webcodebook namespace represented as an object whose properties and methods provide access to the functions needed to create a web codebook, an explorer, or to initialize a stand-alone instance of one of the charts used in the webcodebook.
a factory to create a codebook.
returns: codebook
object
Param | Type | Description |
---|---|---|
element | string |
CSS selector identifying the element in which to create the codebook; defaults to "body"
|
config | object |
config object specifying all options for how the codebook is to appear and behave; see Configuration |
function to initialize a codebook
for a given data object.
Param | Type | Description |
---|---|---|
data | object |
data object to be summarize; see Data Guidelines |
Added in v1.2. Function to add a callback to a codebook
. Should be called before codebook.init()
Param | Type | Description |
---|---|---|
event | string |
event specifying when the function should be run. Valid events are "init" and "complete" |
function | function |
function to be called. Function's context (this ) is the codebook object itself |
a factory to create a codebook explorer. The codebook explorer allows users to pre-configure a UI element to toggle between codebooks for multiple data files.
returns: explorer
object
Param | Type | Description |
---|---|---|
element | string |
CSS selector identifying the element in which to create the explorer; defaults to "body"
|
config | object |
config object specifying all options for how the explorer is to appear and behave; see Configuration |
A function that adds additional files to an existing explorer. files
should follow the guidelines specified here. Added in v1.3.
Added in v1.5. Function to add a callback to an explorer
. Should be called before explorer.init()
.
Param | Type | Description |
---|---|---|
event | string |
event specifying when the function should be run. Valid events are "init", "addFile" and "makeCodebook" |
function | function |
function to be called. Function's context (this ) is the codebook object itself |
An object containing references to the code used to create the 4 custom chart types used in the web codebook:
- Horizontal Bar charts - initialized with
src/charts/createHorizontalBars.js
- Vertical Bar charts - initialized with
src/charts/createVerticalBars.js
- Histogram/Box Plots - initialized with
src/charts/createHistogramBoxPlot.js
- Dot Plots - initialized with
src/charts/createDotPlot.js
The charts are all created using custom webcharts renderers. Once created, each chart is a stand-alone webcharts chart
object that is bound to the codebook
object. Users could theoretically create stand-alone, customizable instances of these charts outside of the context of a codebook, but that functionality is not fully supported or documented in the current release.