Skip to content

Commit

Permalink
Merge pull request #135 from philips-emr/3094461
Browse files Browse the repository at this point in the history
Fix chart render
  • Loading branch information
Rodrigo Firmino da Silva Rodrigues authored Jul 20, 2023
2 parents 1e78e35 + 7a54f02 commit 7d6eacf
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 16 deletions.
9 changes: 4 additions & 5 deletions dist/vis.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* A dynamic, browser-based visualization library.
*
* @version 4.15.4
* @date 2023-07-10
* @date 2023-07-20
*
* @license
* Copyright (C) 2011-2016 Almende B.V, http://almende.com
Expand Down Expand Up @@ -20827,8 +20827,7 @@ return /******/ (function(modules) { // webpackBootstrap
var diffInHours = (end - start) / (1000 * 60 * 60);
var rangeColumnCount = this.body.range.props && this.body.range.props.columnCount ? this.body.range.props.columnCount : 0;
var columnCount = rangeColumnCount ? rangeColumnCount : diffInHours / (gap ? gap : 1) + totalizersToAdd;
var itemsFit = this.body.range.options.itemsFit;

var itemsFit = this.body.range.options.itemsFit || [];
if (itemsFit && columnCount < itemsFit.length) {
columnCount = itemsFit.length;
}
Expand Down Expand Up @@ -28369,9 +28368,9 @@ return /******/ (function(modules) { // webpackBootstrap

var _loop = function _loop(i) {
var dataPointItem = datapoints[i];
if (_this6.body.range.options.gap === 0 || _this6.body.range.options.itemsFit.some(function (x) {
if (_this6.body.range.options && (_this6.body.range.options.gap === 0 || _this6.body.range.options.itemsFit && _this6.body.range.options.itemsFit.some(function (x) {
return x.type == GAPCHARTNOW;
})) {
}))) {
dataPointItem.screen_x = _this6._calculateGapPositionVIS(dataPointItem.x, widthTimeline);
} else {
var factor = _this6.body.range.end - _this6.body.range.start;
Expand Down
2 changes: 1 addition & 1 deletion dist/vis.map

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions dist/vis.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/timeline/component/LineGraph.js
Original file line number Diff line number Diff line change
Expand Up @@ -1038,7 +1038,7 @@ LineGraph.prototype._convertXcoordinates = function (datapoints) {

for (let i = 0; i < datapoints.length; i++) {
const dataPointItem = datapoints[i];
if (this.body.range.options.gap === 0 || this.body.range.options.itemsFit.some(x => x.type == GAPCHARTNOW)) {
if (this.body.range.options && (this.body.range.options.gap === 0 || (this.body.range.options.itemsFit && this.body.range.options.itemsFit.some(x => x.type == GAPCHARTNOW)))) {
dataPointItem.screen_x = this._calculateGapPositionVIS(dataPointItem.x, widthTimeline);
} else {
let factor = this.body.range.end - this.body.range.start;
Expand Down
2 changes: 1 addition & 1 deletion lib/timeline/component/TimeAxis.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ TimeAxis.prototype._repaintLabels = function () {
const diffInHours = (end - start) / (1000 * 60 * 60);
const rangeColumnCount = this.body.range.props && this.body.range.props.columnCount ? this.body.range.props.columnCount : 0;
let columnCount = rangeColumnCount ? rangeColumnCount : diffInHours / (gap ? gap : 1) + totalizersToAdd;
const { itemsFit } = this.body.range.options;
const itemsFit = this.body.range.options.itemsFit || [];
if (itemsFit && columnCount < itemsFit.length) {
columnCount = itemsFit.length;
}
Expand Down

0 comments on commit 7d6eacf

Please sign in to comment.