UNPKG

@spalger/kibana

Version:

Kibana is an open source (Apache Licensed), browser based analytics and search dashboard for Elasticsearch. Kibana is a snap to setup and start using. Kibana strives to be easy to get started with, while also being flexible and powerful, just like Elastic

34 lines (29 loc) 868 B
var $ = require('jquery'); var _ = require('lodash'); var $visCanvas = $('<div>').attr('id', 'vislib-vis-fixtures').appendTo('body'); var count = 0; var visHeight = $visCanvas.height(); $visCanvas.new = function () { count += 1; if (count > 1) $visCanvas.height(visHeight * count); return $('<div>').addClass('visualize-chart').appendTo($visCanvas); }; afterEach(function () { $visCanvas.empty(); if (count > 1) $visCanvas.height(visHeight); count = 0; }); module.exports = function VislibFixtures(Private) { return function (visLibParams) { var Vis = Private(require('ui/vislib/vis')); return new Vis($visCanvas.new(), _.defaults({}, visLibParams || {}, { shareYAxis: true, addTooltip: true, addLegend: true, defaultYExtents: false, setYExtents: false, yAxis: {}, type: 'histogram' })); }; };