Overview¶
OEB Visualizations is a collection of Vue components for data visualization in OpenEBench.
Installation¶
To install the package run:
Usage¶
In Vue applications¶
You can find more complete examples in the documentation of each component.
Install @inb/oeb_visualizations
in your project and import the component you want to use. Then add it to the components
section of your Vue component and use it in the template.
<template>
<div>
<citationsPlot :dataTraces="data" />
</div>
</template>
<script>
import citationsPlot from '@inb/oeb_visualizations'
export default {
name: 'IndexPage',
components: {
citationsPlot
},
data(){
return {
data: [
// Your data for the plot
]
}
}
}
</script>
In HTML pages¶
You can find a complete example here. Also available as a Code Pen.
oeb_visualization
components can be embedded in any page. There is no need to install anything, everything necessary is contained in the HTML.
To use a component in an HTML page:
- Include oeb_visualizations and its dependencies (Vue and Plotly) in your HTML file.
- Create a Vue instance and register the oeb_visualizations component you are going to use (
citationsPlot
in this example). - Finally, create a div where Vue will be active (id=
#app
) and add your components under it (not necessarily as direct child).