Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Highcharts conversion to Plotly JS #1822

Merged
merged 143 commits into from
May 7, 2024
Merged
Show file tree
Hide file tree
Changes from 137 commits
Commits
Show all changes
143 commits
Select commit Hold shift + click to select a range
5467eec
Patch for Plotly Conversion
aestoltm Feb 13, 2024
29d46d0
Patch changes to renamed files
aestoltm Feb 13, 2024
86afba7
eslint is throwing warnings on code that would break if we changed, s…
aestoltm Feb 13, 2024
4200757
Style
aestoltm Feb 14, 2024
1adbfe1
update some integration tests
aestoltm Feb 14, 2024
05ab64f
Updates to tests
aestoltm Feb 14, 2024
2125dfd
point to local qa branch for testing
aestoltm Feb 15, 2024
1dd097b
Update Usage Explorer Test
aestoltm Feb 15, 2024
633fb24
Update Usage and ME tests
aestoltm Feb 16, 2024
5399995
Update tests. Fix bug in export found in report builder tests
aestoltm Feb 16, 2024
d8dc061
more test updates
aestoltm Feb 16, 2024
80355e5
Adjust print to find out why report is failing
aestoltm Feb 16, 2024
5ec7733
Point to ubccr qa branch
aestoltm Feb 16, 2024
1c22a35
Found bug with rework of getClickedPoint
aestoltm Feb 20, 2024
53afc2d
Add back eslint flags
aestoltm Feb 20, 2024
6034615
Fix for custom queries
aestoltm Feb 21, 2024
dd042a0
Fix for appkernels
aestoltm Feb 23, 2024
205bf78
Added <br /> to relace check in image export
aestoltm Feb 28, 2024
6e586da
Update plotly version because it allows for shapes to be legend entries
aestoltm Feb 28, 2024
2ba14d1
add another check for export html encoding
aestoltm Feb 28, 2024
76a8325
Added fix for exporting empty charts
aestoltm Feb 29, 2024
443f9f2
Update plotly path
aestoltm Feb 29, 2024
57993ab
fix php notices and warnings
aestoltm Feb 29, 2024
02d037f
Update some usage tests
aestoltm Feb 29, 2024
8a90434
Update sytanx on usage test
aestoltm Feb 29, 2024
3534b24
Fix syntax erro
aestoltm Feb 29, 2024
6a5e546
Style changes
aestoltm Feb 29, 2024
d8b7bf7
Update for change indicator for app kernels and usage tab bug fix
aestoltm Mar 1, 2024
464ad87
Usage chart bug fix
aestoltm Mar 1, 2024
ad160d2
Change back circle ci conig
aestoltm Mar 12, 2024
4ef6e5f
Update circleci script
aestoltm Mar 12, 2024
290e774
Various bug fixes for base xdmod and for its modules
aestoltm Mar 15, 2024
f37aac7
Merge branch 'xdmod11.0' into xdmod_plotly_conversion
aestoltm Mar 15, 2024
a1744e9
Update code comments and docs
aestoltm Mar 18, 2024
985fe2a
Removed unused highchart lib files and updated gitignore
aestoltm Mar 18, 2024
846860b
Update comment
aestoltm Mar 18, 2024
37df36c
Update process for Thumbnail/Report function
aestoltm Mar 18, 2024
37aaaf0
Update regression
aestoltm Mar 19, 2024
b2689eb
Update ME regression tests
aestoltm Mar 19, 2024
ba2291e
Fix syntax error
aestoltm Mar 19, 2024
4783ec2
Fix bug with accessing data
aestoltm Mar 19, 2024
3d3a5e6
Fix accessing y value
aestoltm Mar 19, 2024
bc57a21
Fix accessing data array
aestoltm Mar 19, 2024
89204c4
Fix checking series count
aestoltm Mar 19, 2024
63eda4b
series count
aestoltm Mar 19, 2024
72ae16a
Update based on php notices
aestoltm Mar 19, 2024
3cd28bc
Fix substr encoding bug, using mb_substr instead
aestoltm Mar 20, 2024
e2e8293
Fix bug with legend interaction and aggregate chart axis labels
aestoltm Mar 20, 2024
1a3835f
Remove print statment from report generator test. Fix linter issues
aestoltm Mar 20, 2024
ec54df0
Linter updates
aestoltm Mar 20, 2024
535a781
Update xml encoder
aestoltm Mar 20, 2024
f3d9455
Replace removed line
aestoltm Mar 20, 2024
e6e77a9
Fix indentation
aestoltm Mar 20, 2024
2dda77b
Update ui tests with help from @ryanrath converting the selectors fro…
aestoltm Mar 20, 2024
a2f5989
Fix syntax error
aestoltm Mar 20, 2024
c2c404b
Fix metric explorer title selector
aestoltm Mar 20, 2024
a0a6f2d
linter updates, and fix legend selector in usage tab ui tests
aestoltm Mar 20, 2024
4615efc
Linter fixes
aestoltm Mar 20, 2024
ae31cc3
Fixed bug with log scale for data labels trying to evaluate 0, also f…
aestoltm Mar 21, 2024
0889db3
Fix syntax error with metric explorer test
aestoltm Mar 21, 2024
9ddf45c
Fix bug with log scale and data labels
aestoltm Mar 21, 2024
90bb609
Update image hashes
aestoltm Mar 21, 2024
e0e8053
Update tests selector
aestoltm Mar 22, 2024
d7ec4b0
Update php style check and update ui tests
aestoltm Mar 22, 2024
bd3f448
Fix syntax and style errors
aestoltm Mar 22, 2024
894de26
Linter fixes
aestoltm Mar 22, 2024
90f149e
Update regression tests
aestoltm Mar 22, 2024
2898bba
Update integratation test bug
aestoltm Mar 22, 2024
7a92457
update clickFirstDataPoint
aestoltm Mar 22, 2024
7b04bb2
Test UI test changes
aestoltm Mar 26, 2024
9989c3c
Try to fix ME ui test
aestoltm Mar 26, 2024
6f21226
Remove waitForChartToChange function for plotly JS charts
aestoltm Mar 26, 2024
69ff2c3
Alter waitForChartToChange function
aestoltm Mar 26, 2024
0930e09
Fix bug with clickFirstDataPoint
aestoltm Mar 26, 2024
c3b1c7e
Update selector for metric explorer test. Also update expected trend …
aestoltm Mar 27, 2024
8c0313c
Updates for sonar tests
aestoltm Mar 27, 2024
c6d024e
More sonar updates
aestoltm Mar 27, 2024
fcc513c
Style update to metric explorer ui tests
aestoltm Mar 27, 2024
12dc5d4
Refactor how data labels are generated for both timeseries and aggreg…
aestoltm Mar 27, 2024
6527ad3
Add back check for timeseries , also update style errors
aestoltm Mar 27, 2024
325b397
Fix timeseries bug and update image hashes in regression tests
aestoltm Mar 28, 2024
6760e2b
Fix legend bug in Usage Tab and Metric Explorer. Also update regressi…
aestoltm Mar 28, 2024
297c40c
Address php notices
aestoltm Mar 28, 2024
51ea59d
Fix php notice with timeseries chart
aestoltm Mar 28, 2024
71385d1
Fix php notice with data labels in timeseries chart
aestoltm Mar 28, 2024
4850c58
Fix bug with legend ordering when log scale, error bars, and trendlin…
aestoltm Mar 28, 2024
df1f5b0
Update regression tests from bugfix
aestoltm Mar 28, 2024
f070edc
Fix Restricted Data Warning and refactor plotly relayout event for sa…
aestoltm Mar 28, 2024
f2087b1
Style fixes for linter
aestoltm Mar 28, 2024
1ed8dab
update regression tests after bugfix of some relayout events
aestoltm Mar 29, 2024
8e31fb7
Update regression from last commit
aestoltm Mar 29, 2024
63b93a5
Update for efficiency tab and update chart summary view in usage tab
aestoltm Apr 4, 2024
379f87d
Update marker opacity for exported charts and Usage chart overview
aestoltm Apr 4, 2024
edb03b4
Fixed two bugs: 1) Hidden trace for area plots had its marker visible…
aestoltm Apr 4, 2024
ed863fb
Update regression tests after updating image export and usage chart o…
aestoltm Apr 5, 2024
810d760
Add plotly to NOTICE and create constant for chart dtick of 1 day
aestoltm Apr 9, 2024
5ef3463
Apply feedback from other module
aestoltm Apr 9, 2024
267ccf2
Refactor relayout event into a single helper function instead of dupl…
aestoltm Apr 10, 2024
2c1c616
Fix legendHeight from previous commit
aestoltm Apr 10, 2024
5121d21
Fix refactor of relayout events. Also adjust some bugfixes
aestoltm Apr 15, 2024
c6015c3
Linter fixes
aestoltm Apr 15, 2024
b4bf540
Syntax error fix
aestoltm Apr 15, 2024
dcac3a4
Add lineSplit to .eslintrc
aestoltm Apr 15, 2024
df186c9
Fix syntax error
aestoltm Apr 15, 2024
7d49ee0
update regression image hashes
aestoltm Apr 15, 2024
13da0a3
Undo change to node path
aestoltm Apr 15, 2024
110ed1f
Simplify comparison logic
aestoltm Apr 15, 2024
78e08f1
Fix style issues
aestoltm Apr 15, 2024
e9ba69e
Style fix
aestoltm Apr 15, 2024
f2ec0a6
Update webdriverio helper function selector
aestoltm Apr 17, 2024
696111f
Shorten selector
aestoltm Apr 17, 2024
32ef72f
Address feedback in metric explorer raw data drilldown. Fix selector …
aestoltm Apr 17, 2024
8df6734
Syntax fix
aestoltm Apr 17, 2024
ff732ad
Fix selector
aestoltm Apr 17, 2024
6cc3ed0
Merge branch 'xdmod11.0' into xdmod_plotly_conversion
aestoltm Apr 17, 2024
f2cb086
Revert csv export changes
aestoltm Apr 17, 2024
4f980d9
Update documentation
aestoltm Apr 18, 2024
9a49f60
Linter fix
aestoltm Apr 18, 2024
c4af822
Update documentation on new chart features
aestoltm Apr 18, 2024
5611f14
Remove default layout for now as it is not used.
aestoltm Apr 19, 2024
f241d25
Linter fix
aestoltm Apr 19, 2024
ea229fc
Updated plotly notice with correct name
aestoltm Apr 29, 2024
e1e6fa9
Update scale factor description
aestoltm Apr 29, 2024
8b56820
Fix merge conflict
aestoltm Apr 29, 2024
38f1e59
Update regression tests from changes made in PR #1801
aestoltm Apr 29, 2024
91aa817
Correct plotly name
aestoltm May 1, 2024
85cfe6f
Fixes multiple bugs. 1) Setting manual range for either min or max va…
aestoltm May 3, 2024
1ac2176
Address style feedback
aestoltm May 3, 2024
5a7e83c
Fix linter issues
aestoltm May 3, 2024
1081032
Fix syntax error
aestoltm May 3, 2024
b6fea30
Rollback regex to original version
aestoltm May 3, 2024
5cc9aa3
Update eslint syntax check
aestoltm May 3, 2024
f8069f2
Adjust placment of ecmaVersion
aestoltm May 3, 2024
86fd35d
Update ecmaVersion correctly
aestoltm May 3, 2024
030de51
Fix bracket placement
aestoltm May 3, 2024
871ff1f
Update regression tests after finding bug with chart range for area p…
aestoltm May 6, 2024
7f9d409
Move documentation updates to release notes, update open xdmod upgrad…
aestoltm May 6, 2024
70eb6c8
Update documentation, remove some unused code
aestoltm May 6, 2024
0c2f9dc
Remove unused code
aestoltm May 6, 2024
0e15179
Adjustments to release notes. Sanitize chart title input field from a…
aestoltm May 6, 2024
2b11701
Style fix
aestoltm May 6, 2024
9a52542
Encode anchor tags instead of removing. Address some documentation su…
aestoltm May 6, 2024
2ba8ac7
Update tags to be in code format
aestoltm May 7, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,6 @@ xdmod-*.rpm
/.sonar/
external_libraries/

/html/gui/lib/highcharts
/html/gui/lib/jquery
/html/gui/lib/jquery-plugins
/html/gui/lib/moment
Expand Down
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
# Open XDMoD Change Log

## 2024-XX-XX v11.0.0
- Important Notes
- Open XDMoD is now no longer bundled with any non-commercial licenses. The charting library used in Open XDMoD has changed from [Highcharts](https://www.highcharts.com/) to [Plotly JS](https://plotly.com/javascript/), an open source library. This transition removes the non-commercial license required from the Highcharts library. Please refer to the [license notices](https://open.xdmod.org/10.5/notices.html) for more information about the open source licenses bundled with Open XDMoD.
aaronweeden marked this conversation as resolved.
Show resolved Hide resolved
- New Features
- General
- Chart axes are draggable to adjust the chart range. For charts in the Metric Explorer, the axis range can be reset to the default through the axis context menu. For other charts, the chart can be reset to the default by double-clicking.
- Rendering support for a subset of HTML tags in a chart's main title. Please refer to the [list](https://plotly.com/javascript/reference/layout/annotations/#layout-annotations-items-annotation-text) of supported HTML tags. Unsupported tags will not render but still display in the title.
aaronweeden marked this conversation as resolved.
Show resolved Hide resolved
aaronweeden marked this conversation as resolved.
Show resolved Hide resolved
- Uncategorized
- Chart Feature Changes
- For line charts, the context menu for a data series is brought up by clicking on its points, not its lines. As before, the context menu can also be brought up by clicking on it in the legend.
- The button for resetting the chart zoom in Metric Explorer charts appears in the chart context menus instead of a button on the chart. Resetting the chart zoom for charts in all other tabs now requires a double click on the plotting area instead of a button on the chart.
- Chart Features Temporarily Removed
aaronweeden marked this conversation as resolved.
Show resolved Hide resolved
- The ability to change the layering order for charts with multiple axes.
- Hover animations.
- Shadow.
- Known Issues
- Charts exported as images can have legend displacement based on the chart size. The current workaround is to make the exported chart larger until the legend fits. Customizing legend entry names to be shorter may also help.
- Chart legend double-click feature is disabled due to an interaction with legend single-click events.
## 2023-09-11 v10.5.0
- Bug Fixes
- Cloud
Expand Down
8 changes: 4 additions & 4 deletions NOTICE
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ License: MIT license
Author: jQuery Foundation and other contributors
Link: http://jquery.com/

Name: Highcharts
aaronweeden marked this conversation as resolved.
Show resolved Hide resolved
License: Creative Commons Attribution-NonCommercial 3.0
Author: Torstein Hønsi
Link: http://www.highcharts.com/
Name: Plotly.js
License: MIT license
Author: Plotly, Inc.
Link: https://github.com/plotly/plotly.js

Name: RSVP.js
License: MIT license
Expand Down
27 changes: 11 additions & 16 deletions background_scripts/chrome-helper/chrome-helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,18 @@ const args = require('yargs').argv;

await page.goto('file://' + args['input-file']);

let svgInnerHtml;

if (args.plotly) {
// Chart traces and axis values svg
let plotlyChart = await page.evaluate(() => document.querySelector('.user-select-none.svg-container').children[0].outerHTML);
// Chart title and axis titles svg
const plotlyLabels = await page.evaluate(() => document.querySelector('.user-select-none.svg-container').children[2].innerHTML);

plotlyChart = plotlyChart.substring(0, plotlyChart.length - 6);
const plotlyImage = plotlyChart + '' + plotlyLabels + '</svg>';
// HTML tags in titles thorw xml not well-formed error
svgInnerHtml = plotlyImage.replace(/<br>|<b>|<\/b>/gm, '');
} else {
svgInnerHtml = await page.evaluate(() => document.querySelector('.highcharts-container').innerHTML);
}
// Chart traces and axis values svg
let chart = await page.evaluate(() => document.querySelector('.user-select-none.svg-container').children[0].outerHTML);
// Chart title and axis titles svg
const chartLabels = await page.evaluate(() => document.querySelector('.user-select-none.svg-container').children[2].innerHTML);

chart = chart.substring(0, chart.length - 6);
let svg = chart + '' + chartLabels + '</svg>';

// Unencoded HTML tags throw xml not well-formed error
svg = svg.replace(/data-unformatted="(.*?)"/g, (str) => str.replace(/>/g, '&gt;').replace(/</g, '&lt;'));

console.log(JSON.stringify(svgInnerHtml));
console.log(JSON.stringify(svg));

await browser.close();
})();
10 changes: 5 additions & 5 deletions classes/DataWarehouse/Access/Common.php
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ protected function exportImage($returnData, $width, $height, $scale, $format, $f

$result = array(
"headers" => array( "Content-Type" => "image/png"),
"results" => \xd_charting\exportHighchart($returnData, '148', '69', 2, 'png')
"results" => \xd_charting\exportChart($returnData, '148', '69', 2, 'png')
);

return $result;
Expand All @@ -312,7 +312,7 @@ protected function exportImage($returnData, $width, $height, $scale, $format, $f

$result = array(
"headers" => array( "Content-Type" => "image/png"),
"results" => \xd_charting\exportHighchart($returnData, $width, $height, $scale, 'png')
"results" => \xd_charting\exportChart($returnData, $width, $height, $scale, 'png')
);

return $result;
Expand All @@ -329,7 +329,7 @@ protected function exportImage($returnData, $width, $height, $scale, $format, $f

$result = array(
"headers" => \DataWarehouse\ExportBuilder::getHeader( $format, false, $filename),
"results" => \xd_charting\exportHighchart($returnData['data'][0], $width, $height, $scale, $format, null, $fileMeta)
"results" => \xd_charting\exportChart($returnData['data'][0], $width, $height, $scale, $format, null, $fileMeta)
);

return $result;
Expand All @@ -338,7 +338,7 @@ protected function exportImage($returnData, $width, $height, $scale, $format, $f
{
$result = array(
"headers" => \DataWarehouse\ExportBuilder::getHeader( $format, false, $filename),
"results" => 'data:image/png;base64,'.base64_encode(\xd_charting\exportHighchart($returnData['data'][0], $width, $height, $scale, 'png'))
"results" => 'data:image/png;base64,'.base64_encode(\xd_charting\exportChart($returnData['data'][0], $width, $height, $scale, 'png'))
);
return $result;

Expand All @@ -348,7 +348,7 @@ protected function exportImage($returnData, $width, $height, $scale, $format, $f
$result = array(
"headers" => \DataWarehouse\ExportBuilder::getHeader( $format, false, $filename),
"results" => 'data:image/svg+xml;base64,' . base64_encode(
\xd_charting\exportHighchart( $returnData['data'][0], $width, $height, $scale, 'svg'))
\xd_charting\exportChart( $returnData['data'][0], $width, $height, $scale, 'svg'))
);

return $result;
Expand Down
21 changes: 10 additions & 11 deletions classes/DataWarehouse/Access/MetricExplorer.php
aaronweeden marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,10 @@ public function get_data($user)
? '\DataWarehouse\Data\TimeseriesDataset'
: '\DataWarehouse\Data\SimpleDataset';

$highchart_classname
$chart_classname
= $timeseries
? '\DataWarehouse\Visualization\HighChartTimeseries2'
: '\DataWarehouse\Visualization\HighChart2';
? '\DataWarehouse\Visualization\TimeseriesChart'
: '\DataWarehouse\Visualization\AggregateChart';

$filename = $this->getFilename();
$filenameSpecifiedInRequest = $filename !== null;
Expand Down Expand Up @@ -159,7 +159,7 @@ public function get_data($user)

$font_size = $this->getFontSize();

$hc = new $highchart_classname(
$chart = new $chart_classname(
$aggregation_unit,
$start_date,
$end_date,
Expand All @@ -176,13 +176,12 @@ public function get_data($user)
);

if ($show_title) {
$hc->setTitle($title, $font_size);
$chart->setTitle($title, $font_size);
}

// Called before and after configure.
$hc->setLegend($legend_location, $font_size);

$hc->configure(
$chart->setLegend($legend_location, $font_size);
$chart->configure(
$data_series,
$x_axis,
$y_axis,
Expand All @@ -195,9 +194,9 @@ public function get_data($user)
$showRemainder
);

$hc->setLegend($legend_location, $font_size);
$chart->setLegend($legend_location, $font_size);

$returnData = $hc->exportJsonStore($limit, $offset);
$returnData = $chart->exportJsonStore($limit, $offset);

$requestDescripter = new \User\Elements\RequestDescripter($this->request);
$chartIdentifier = $requestDescripter->__toString();
Expand All @@ -211,7 +210,7 @@ public function get_data($user)
$returnData['data'][0]['reportGeneratorMeta'] = array(
'chart_args' => $chartIdentifier,
'title' => $title,
'params_title' => $hc->getSubtitleText(),
'params_title' => $chart->getSubtitleText(),
'start_date' => $start_date,
'end_date' => $end_date,
'included_in_report' => $includedInReport ? 'y' : 'n',
Expand Down
Loading