OEB Visualizations is a collection of Vue components for data visualization in OpenEBench.
To install the package run:
npm install @inb/oeb_visualizations
:bulb: 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>
:bulb: 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:
<script src="https://cdn.jsdelivr.net/npm/@inb/oeb_visualizations/dist/oeb-visualizations.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
<script src="https://cdn.plot.ly/plotly-latest.min.js"></script>
citationsPlot
in this example).
<script>
var app = new Vue({
el: '#app',
data: {
// Other data available to the Vue instance goes here
dataPlot: {
// Your data for the plot
}
}
})
Vue.component('citations-plot', 'oeb_visualizations'.citationsPlot)
</script>
#app
) and add your components under it (not necessarily as direct child).
<div id="app">
<citations-plot :dataTraces="dataPlot"></citations-plot>
</div>