Skip to content

Commit

Permalink
Merge pull request #241 from jpmorganchase/y-scatter
Browse files Browse the repository at this point in the history
Added `y_scatter` chart type
  • Loading branch information
texodus authored Sep 17, 2018
2 parents 7059726 + c09b0d9 commit c8db1bd
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 10 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

[![Build Status](https://travis-ci.org/jpmorganchase/perspective.svg?branch=master)](https://travis-ci.org/jpmorganchase/perspective)
[![Gitter](https://img.shields.io/gitter/room/nwjs/nw.js.svg)](https://gitter.im/jpmorganchase/perspective)
[![npm](https://img.shields.io/npm/v/@jpmorganchase/perspective.svg?style=flat-square)](https://www.npmjs.com/package/@jpmorganchase/perspective)

A streaming data visualization engine for Javascript, Perspective makes it
simple to build real-time & user configurable analytics entirely in the browser.
Expand Down
2 changes: 2 additions & 0 deletions packages/perspective-viewer-highcharts/src/js/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ export function default_config(aggregates, mode) {
type = 'line';
} else if (mode === 'y_area') {
type = 'area';
} else if (mode === 'y_scatter') {
type = 'scatter';
} else if (mode.indexOf('bar') > -1) {
type = 'column';
} else if (mode == 'treemap') {
Expand Down
24 changes: 18 additions & 6 deletions packages/perspective-viewer-highcharts/src/js/highcharts.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ function delete_chart() {
}
}

global.registerPlugin("y_bar", {
name: "Y Bar Chart",
create: draw("vertical_bar"),
global.registerPlugin("x_bar", {
name: "X Bar Chart",
create: draw("horizontal_bar"),
resize: resize,
initial: {
"type": "number",
Expand All @@ -46,9 +46,9 @@ global.registerPlugin("y_bar", {
delete: delete_chart
});

global.registerPlugin("x_bar", {
name: "X Bar Chart",
create: draw("horizontal_bar"),
global.registerPlugin("y_bar", {
name: "Y Bar Chart",
create: draw("vertical_bar"),
resize: resize,
initial: {
"type": "number",
Expand All @@ -70,6 +70,18 @@ global.registerPlugin("y_line", {
delete: delete_chart
});

global.registerPlugin("y_scatter", {
name: "Y Scatter Chart",
create: draw("y_scatter"),
resize: resize,
initial: {
"type": "number",
"count": 1
},
selectMode: "select",
delete: delete_chart
});

global.registerPlugin("y_area", {
name: "Y Area Chart",
create: draw("y_area"),
Expand Down
2 changes: 1 addition & 1 deletion packages/perspective/src/js/perspective.js
Original file line number Diff line number Diff line change
Expand Up @@ -1738,7 +1738,7 @@ class WorkerHost extends Host {
__MODULE__ = __MODULE__(module);
} else {
let wasmXHR = new XMLHttpRequest();
wasmXHR.open('GET', msg.path + '/psp.async.wasm', true);
wasmXHR.open('GET', msg.path + 'psp.async.wasm', true);
wasmXHR.responseType = 'arraybuffer';
wasmXHR.onload = function() {
module = {};
Expand Down
6 changes: 3 additions & 3 deletions packages/perspective/src/js/perspective.parallel.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ class WebWorker extends worker {

_start_cross_origin() {
var dir = (typeof WebAssembly === "undefined" ? 'asmjs' : 'wasm');
XHRWorker(__SCRIPT_PATH__.path() + '/perspective.worker.' + dir + '.js', function(worker) {
XHRWorker(__SCRIPT_PATH__.path() + 'perspective.worker.' + dir + '.js', function(worker) {
for (var key in this._worker) {
worker[key] = this._worker[key];
}
Expand All @@ -130,7 +130,7 @@ class WebWorker extends worker {

_start_cross_origin_wasm() {
var wasmXHR = new XMLHttpRequest();
wasmXHR.open('GET', __SCRIPT_PATH__.path() + '/psp.async.wasm', true);
wasmXHR.open('GET', __SCRIPT_PATH__.path() + 'psp.async.wasm', true);
wasmXHR.responseType = 'arraybuffer';
wasmXHR.onload = () => {
let msg = {
Expand All @@ -149,7 +149,7 @@ class WebWorker extends worker {

_start_same_origin() {
var dir = (typeof WebAssembly === "undefined" || detect_iphone() ? 'asmjs' : 'async');
var w = new Worker(__SCRIPT_PATH__.path() + '/perspective.worker.' + dir + '.js');
var w = new Worker(__SCRIPT_PATH__.path() + 'perspective.worker.' + dir + '.js');
for (var key in this._worker) {
w[key] = this._worker[key];
}
Expand Down

0 comments on commit c8db1bd

Please sign in to comment.