Compare commits

..

15 Commits
0.4.0 ... 0.9.0

Author SHA1 Message Date
John Lunde
ec98314793 Merge pull request #10 from qlik-oss/revert-the-reverted
Revert
2018-11-19 11:00:06 +01:00
Martin Walter
0953911571 Revert 2018-11-19 10:58:50 +01:00
Piotr Nestorow
0a673631b2 Merge pull request #9 from qlik-oss/revert-5-data-limit
Revert "[QPE-233] Data limit"
2018-11-16 15:43:01 +01:00
John Lunde
b1ade90e8b Revert "[QPE-233] Data limit" 2018-11-16 15:40:30 +01:00
John Lunde
c088774e75 Merge pull request #5 from qlik-oss/data-limit
[QPE-233] Data limit
2018-11-16 14:05:37 +01:00
John Lunde
7d6bd5696a Merge pull request #7 from qlik-oss/disable-edit-mode-interactions
[QPE-303] Disable edit mode interactions
2018-11-16 14:04:56 +01:00
John Lunde
dd30f94b34 Merge pull request #6 from qlik-oss/use-qlik-theme-colors
[QPE-237] Use qlik theme colors
2018-11-16 13:01:08 +01:00
Kristoffer Lind
11f2bad2bd disable pointer events when is-edit-mode 2018-11-15 08:10:01 +01:00
Kristoffer Lind
06a28a2ae7 set is-edit-mode class when in edit mode 2018-11-15 08:09:13 +01:00
Kristoffer Lind
5c84aeb8ee update karma webpack config 2018-11-14 16:48:38 +01:00
Kristoffer Lind
fe1c3d90e2 use colors from qlik theme color scale 2018-11-14 16:42:09 +01:00
Kristoffer Lind
78a441036c expose qlik as available import 2018-11-14 16:41:02 +01:00
John Lunde
7cba160828 Merge pull request #3 from qlik-oss/enable-printing
[QPE-235] enable printing
2018-11-13 14:54:41 +01:00
Kristoffer Lind
15be850423 document data limitation 2018-11-13 12:54:56 +01:00
Kristoffer Lind
2af87e2d42 enable printing 2018-11-09 11:30:41 +01:00
6 changed files with 65 additions and 13 deletions

View File

@@ -19,6 +19,14 @@ module.exports = (config) => {
webpack: {
devtool: 'source-map',
mode: settings.mode,
externals: {
qlik: {
amd: 'qlik',
commonjs: 'qlik',
commonjs2: 'qlik',
root: '_'
}
},
module: {
rules: [
{

View File

@@ -31,6 +31,9 @@ The measures are optional
QVF based on characters from Victor Hugo's novel , Les Misérables.
![Network chart](resources/network_chart_v1.png)
### Data Limit
Starts having issues stabilizing(transforming into untangled view) at around 100-200 nodes depending on dataset.
# Getting Started

View File

@@ -7,6 +7,7 @@ Use at your own risk.
*/
import "@babel/polyfill";
import paint from './paint';
import './styles/main.less';
const component = {
initialProperties: {
@@ -136,11 +137,12 @@ const component = {
}
}
},
support: {
export: true
},
snapshot: {
canTakeSnapshot: true
},
paint: paint
};

View File

@@ -1,19 +1,29 @@
import { Network } from 'vis/index-network';
import qlik from 'qlik';
const colorScheme = 'Diverging Classes';
function isTextCellNotEmpty(c) {
return (c.qText && !(c.qIsNull || c.qText.trim() == ''));
}
function paint ( $element, layout ) {
var _this = this,
qData = layout.qHyperCube.qDataPages[0],
function paint ( $element, layout, qTheme, component ) {
const colorScale = qTheme.properties.scales
.find(scale => scale.name === colorScheme).scale;
const colors = colorScale[colorScale.length - 1];
function getColor (number) {
return colors[number % colors.length];
}
var qData = layout.qHyperCube.qDataPages[0],
id = layout.qInfo.qId,
containerId = 'network-container_' + id;
if(qData && qData.qMatrix) {
$element.empty().append($('<div />')
.attr({ id: containerId })
.toggleClass('is-edit-mode', _this.inEditState())
.css({
height: $element.height(),
width: $element.width(),
@@ -59,6 +69,7 @@ function paint ( $element, layout ) {
var uniqueId = [];
var nodes = [];
var edges = [];
const groups = {};
for(let i = 0; i< dataSet.length; i++){
if (layout.displayEdgeLabel) {
@@ -72,13 +83,16 @@ function paint ( $element, layout ) {
uniqueId.push(dataSet[i].id);
var nodeItem = {
"id": dataSet[i].id,
"label": dataSet[i].label,
"title": dataSet[i].title,
"group": dataSet[i].group,
"value": dataSet[i].nodeValue
id: dataSet[i].id,
label: dataSet[i].label,
title: dataSet[i].title,
group: dataSet[i].group,
value: dataSet[i].nodeValue
};
nodes.push(nodeItem); // create node
groups[nodeItem.group] = {
color: getColor(nodeItem.group)
};
}
}
@@ -92,6 +106,7 @@ function paint ( $element, layout ) {
var container = document.getElementById(containerId);
var options = {
groups: groups,
layout: {
randomSeed: 1
},
@@ -139,11 +154,24 @@ function paint ( $element, layout ) {
connectedNodes.push(properties.nodes[0]);
//Make the selections
_this.backendApi.selectValues(0,connectedNodes,false);
component.backendApi.selectValues(0,connectedNodes,false);
}
}
});
}
}
export default paint;
function themePaint ($element, layout) {
const component = this;
try {
const app = qlik.currApp(this);
app.theme.getApplied().then( function( qTheme ) {
paint($element, layout, qTheme, component);
});
} catch (exception) {
console.error(exception); // eslint-disable-line no-console
}
}
export default themePaint;

3
src/styles/main.less Normal file
View File

@@ -0,0 +1,3 @@
.is-edit-mode > div {
pointer-events: none;
}

View File

@@ -16,6 +16,14 @@ const config = {
filename: settings.name + '.js',
libraryTarget: 'umd'
},
externals: {
qlik: {
amd: 'qlik',
commonjs: 'qlik',
commonjs2: 'qlik',
root: '_'
}
},
module: {
rules: [
{