Coder Social home page Coder Social logo

hpcc-systems / visualization Goto Github PK

View Code? Open in Web Editor NEW
89.0 29.0 61.0 130.28 MB

HPCC JavaScript Framework

Home Page: https://hpcc-systems.github.io/Visualization/

License: Other

JavaScript 2.68% CSS 1.70% HTML 2.37% Shell 0.01% TypeScript 93.13% ECL 0.01% Sass 0.10%
typescript umd

visualization's Introduction

@hpcc-js (aka Viz Framework 2.0)

Test PR Join the chat at https://gitter.im/hpcc-systems/Visualization

How to get started?

  1. Quick Start: Covers the basics on how to include the framework into your web application.
  2. Tutorials: Starting with a simple "hello world", the tutorials walk through the basics of instantiating the visualizations, fetching data and creating dashboards.
  3. Gallery + Indexed Gallery (new): Many many samples (and growing weekly), includes an interactive playgound + property editor for discovering the capabilities of each visualization.
  4. Chat: Join us in our chat room - all questions and suggestions welcomed!

Whats in the "box"?

The "@hpcc-js" repository contains several packages which fall into two main categories:

  • Visualizations
  • HPCC Platform browser/node.js connectors and utilities

All packages are available for use independently and are published to the NPM repository under the @hpcc-js scope name.

They support all modern browsers including:

  • IE 11
  • Chrome
  • Firefox
  • Edge

They support the following module formats:

  • iife
  • commonjs
  • AMD
  • UMD
  • es6
  • unpkg

And work well with JavaScript bundlers:

  • WebPack
  • Rollup.js

Hello World Example

The simplest example pulls the pre-built packages directly from NPM via unpkg and loads them into the the global namespace ("IIFE" style), when used this way you have to manually include all dependencies and need to be careful about global namespace pollution...

<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>Simple Bar Chart</title>
    <script src="https://unpkg.com/@hpcc-js/common"></script>
    <script src="https://unpkg.com/@hpcc-js/api"></script>
    <script src="https://unpkg.com/@hpcc-js/chart"></script>
    <script>
        var hpccChart = window["@hpcc-js/chart"];
    </script>
</head>

<body>
    <div id="placeholder" style="width:800px; height:600px;"></div>
    <script>
        var chart = new hpccChart.Bar()
            .target("placeholder")
            .columns(["Subject", "Year 1", "Year 2", "Year 3"])
            .data([
                ["Geography", 75, 68, 65],
                ["English", 45, 55, -52],
                ["Math", 98, 92, 90],
                ["Science", 66, 60, 72]
            ])
            .render()
            ;
    </script>
</body>

</html>

To explore this example see Dermatology-Bar and enable the "Properties" option (top right).

Installing via npm

To install via npm, simply use npm install as you would normally. Each package is "scoped" with "@hpcc-js" and you will need to specify each required package specifically, for example:

npm install @hpcc-js/chart @hpcc-js/map

You can see the current status of each package here: https://www.npmjs.com/

Referencing in your application

@hpcc-js is written using TypeScript and generates ES2015 + UMD JavaScript modules which can be included into your normal development flow as is (this includes compatibility with both WebPack + Rollup.js).

To import @hpcc-js packages into an ES2015 application, simply import the required symbols from any @hpcc-js package:

import { Bar } from "@hpcc-js/chart";

const chart = new Bar()
    .target("placeholder")
    .columns(["Subject", "Year 1", "Year 2", "Year 3"])
    .data([
        ["Geography", 75, 68, 65],
        ["English", 45, 55, -52],
        ["Math", 98, 92, 90],
        ["Science", 66, 60, 72]
    ])
    .render()
    ;

Using AMD

require(["@hpcc-js/chart"], function(hpccChart) {
    var chart = new hpccChart.Bar()
        .target("placeholder")
        .columns(["Subject", "Year 1", "Year 2", "Year 3"])
        .data([
            ["Geography", 75, 68, 65],
            ["English", 45, 55, -52],
            ["Math", 98, 92, 90],
            ["Science", 66, 60, 72]
        ])
        .render()
        ;
});

Developer Zone

Prerequisites

  • NodeJS LTS (10.x at time of writing)

Building a development environment

These are the recommended steps for creating a development environment.

git clone https://github.com/hpcc-systems/Visualization.git hpcc-js
cd hpcc-js
npm install
npm run build-dev

At which point the "demos" should now load.

Note: In this development mode, there is no need to create any webpack or rollupjs bundles, but you will need to ensure that any modifications to the TypeScript files are re-compiled into JavaScript. The simplest way to do this is to run the TypeScript compiler in "watch" mode for the package you are editing:

cd ./packages/chart
tsc -w

Building a release

Building a local release with min files

npm run build
npm run minimize

Running lint + unit tests

npm run lint
npm run build-all
npm run test

Publishing a full release to NPM (require admin rights on https://github.com/hpcc-systems/Visualization)

npm run tag 

Full clean (including removal of package dependencies)

npm run clean
npm run uninstall
rm -rf ./node_modules

visualization's People

Contributors

anmoljagetia avatar buunguyen avatar clewisln avatar dependabot[bot] avatar dwheelock avatar fnisswandt avatar ghalliday avatar gitter-badger avatar gordonsmith avatar irieksts avatar jbrundage avatar jchambers-ln avatar jeclrsg avatar jesse-morris-ln avatar jpellock avatar mzummo avatar richardkchapman avatar salimmantri avatar tomcharmanodg avatar yangxulexis avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

visualization's Issues

C3 Charts Pending

Below charts are not available in C3
• Horizontal Bar / Column Chart
• Table Widget
• Donut Chart
• Gauge Chart
• Document Widget
it needs to be implemented in C3.

Flyaway/Implode

Some visualizations should only be "full size" as needed. Typically they are input filters to a main visualization.

Additional Post Processing Properties

“first” : 20 // take only the first 20 records from this datasource
“reverse” : true // start reading this list from the end
“sort”: [ “fred”,”-bob”,”edith” ] // sort the data by a multi-key

e.g.:
{
"id":"CountyDonut1",
"source":{
"id":"Ins003_countystats",
"sort":[
"-Cnt"
],
"mappings":{
"weight":"Cnt",
"label":"clean_error"
},
"output":"View_CountyDonut1",
"first":"5"
},
"properties":{

        },
        "type":"PIE"
     },

Need the ability to initialize an HTML Marshaller from a workunit named output DDL json string

Extend an HTMLMarshaller to allow initialization with a workunit ID and a named output as well as initializing it with a roxie URL.

-also needs to handle json coming back from something other than a direct HPCC Connection
for example, DDL Json may be coming back from either
http(s)://:/wsWorkunits/WUResult.json?Wuid=w1234-12311&ResultName=Ins002_DDL
or from an url like
http://rampsapp/HPCCpassthrough?cluster=healthcare&passthroughUrl%3DwsWorkunits%2FWUResult.json%3FWuid%3Dw1234-12311&ResultName%3DIns002_DDL

zooming

if you double click on a Choropleth it zooms both the Choropleth
vizualizationglitch
and the rest of the screen, though google charts don't zoom

WUID-based visualization updates onSelect functioning incorrectly

When clicking a chart that drives another chart on a WUID-based visualization, additional charts not driven by that chart are also updated with data.

Here is a correctly functioning service-based visualization:
http://10.239.227.24:8002/WsEcl/submit/query/roxie/drealeed_TestFilteredViz.Ins004_Service/json

Here is the same plugin with the same data run as a WUID visualization:
http://10.239.227.24:8010/WUInfo/WsWorkunits?Wuid=W20141204-120537&ResultName=drealeed_TestFilteredViz_Comp_Ins002_DDL

Add https-connectivity capability to legacy dashboard app

I generated a dashboard on an https hpcc cluster and went to look at it here:
http://viz.hpccsystems.com/master/legacyDash.html?Hostname=216.19.105.2&Port=18010&Wuid=W20141203-141140&ResultName=drealeed_DashboardVisualization_Comp_Ins002_DDL

in jsonp_callback, the following response came back from the server:

<title>400 Bad Request</title>

Bad Request

Your browser sent a request that this server could not understand.
Reason: You're speaking plain HTTP to an SSL-enabled server port.
Instead use the HTTPS scheme to access this URL, please.

Hint: https://216.19.105.2:18010/


Apache/2.2.15 (CentOS) Server at 216.19.105.2 Port 18010

can we add an &protocol=https or &https=true parameter to this page? Would that fix the issue?

Multichart surface resize issue

Multisurface window renders incorrectly when dropdown menu is down/selected and the top leading edge of the window is clicked. clicking the edge again will fix the window.

image

Variable mistyped

File: HipieDDL.js:361

selectioLabel = key;

needs to be changed to:

selectionLabel = key;

Add legand

Create Legend widget, initially for 2DCharts

Drilldown/Explode

Ability to launch a new dashboard via a select event. Think opening a Comp report Dashboard from an entity in a table of a graph control.

bugs/features - click/dblClick & graph scrolling

.click and .dblClick should return a GSL object like the other chainable methods.

.dblClick needs to be universally implemented.

graph scrolling allows widget to be scrolled out of container and positioned "absolutely" on the page outside of its container.

C3/Other Chart Colors & Palette.js

So far with C3 it looks as though there are 2 ways I can do colors:

var ColorArr = Palette.custom(["orange", "green"], 0, 100, XVAR);
this._config.color.pattern = ColorArr.range();

where XVAR is the # of bars (or # of bars in each group)

this works for .ordinal .brewer with similar options.

basically your just giving the .pattern an array of colors.

the second way allows for a bit more customization but I am not sure if its needed or how to create an elegant way of implementing it and overall implementing both methods across all charts.

EX:
this._config.data.colors = {
Geography: '#ff0000',
English: '#00ff00',
Math: '#0000ff',
Science: '#0000ff'
}

    this._config.data.color = function (color, d) {
        console.log(d);
        // d will be 'id' when called for legends
        return d.id && d.id === 'English' ? d3.rgb(color).darker(d.value / 150) : color;

    }

this will (if i can figure out where I went wrong in my code) and based off of what i see at http://c3js.org/samples/data_color.html let you
customize the color of each bar based off of the original input color for each bar + allows you access to the data (d) for potentially doing colors based off the data value

inter-widget reloading failing on latest build on viz.hpccsystems.com

I noticed something curious: when I run this viz against
http://viz.hpccsystems.com/v0.9.0-beta/legacyDash.html?Hostname=10.173.147.1&Port=8010&Protocol=http&Wuid=W20150211-103717&ResultName=leeddx_TestServiceViz_Comp_Ins001_DDL

, data comes back, but the table data is populated incorrectly upon clicking the pie—a known bug that was fixed a while back.

However, if I run it against
http://viz.hpccsystems.com/master/legacyDash.html?Hostname=10.173.147.1&Port=8010&Protocol=http&Wuid=W20150211-103717&ResultName=leeddx_TestServiceViz_Comp_Ins001_DDL

the table isn’t updated at all and remains empty when clicking on the pie. I don’t see any javascript errors in the console eithr. Any idea what’s up with that?:

Problem with table chart

When we render the Table chart with some data it renders correctly for the first time. But if we change the chart to some other type and change back again to table chart the data is not shown correctly. It shows some javascript functions appended in the extra columns.

Design Mode

Graph Marshaller add option for "Develop Mode" which will show the surface frames, otherwise they should be hidden...

google chart side scrolling

To reproduce:
Go to viz.hpccsystems.com/master... to view the visualization
change one of the graphs to the google Pie
Drag the google pie to the right edge
the window will start to scroll to the right
the container goes behind and the google chart stays above a white layer
if you drop the google chart in this area you can't pick it up again
vizualizationglitch

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.