-
Notifications
You must be signed in to change notification settings - Fork 17
FIREFLY-2006: Charts Grouping functionality #1992
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
Open
kpuriIpac
wants to merge
11
commits into
dev
Choose a base branch
from
FIREFLY-2006-charts-groups
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
9a6e9b2
charts grouping option
kpuriIpac 6389c93
fix several regression and new bugs
kpuriIpac a3835f7
try new cleaner refactor approach
kpuriIpac 378eb85
fixed more bugs
kpuriIpac 0d82f3c
more fixes
kpuriIpac 9fd1a41
fixes continued
kpuriIpac bfdf4a7
fix axes bug after filtering
kpuriIpac 4ecbaf3
overplot bug fix
kpuriIpac 93e982d
cleanup
kpuriIpac 5b1db6b
several robust fixes
kpuriIpac 6c9ad64
fix x-y col line delay opening dialog
kpuriIpac File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,7 +6,7 @@ import {logger} from '../../util/Logger.js'; | |
| import {COL_TYPE, getColumn, getColumns, getTblById, doFetchTable, stripColumnNameQuotes} from '../../tables/TableUtil.js'; | ||
| import {cloneRequest, makeTableFunctionRequest, MAX_ROW} from '../../tables/TableRequestUtil.js'; | ||
| import {dispatchChartUpdate, dispatchError, getChartData} from '../ChartsCntlr.js'; | ||
| import {formatColExpr, handleBigInt} from '../ChartUtil.js'; | ||
| import {formatColExpr, handleBigInt, isCurrentTableSource} from '../ChartUtil.js'; | ||
|
|
||
|
|
||
| import {toMaxFixed, getDecimalPlaces} from '../../util/MathUtil.js'; | ||
|
|
@@ -22,15 +22,20 @@ import Color from '../../util/Color.js'; | |
| * @param p.traceNum | ||
| * @returns {{options: {}, fetchData: fetchData}} | ||
| */ | ||
| export function getTraceTSEntries({chartId, traceNum}) { | ||
| export function getTraceTSEntries({chartId, traceNum, traceTS={}}) { | ||
|
|
||
| const options = {}; | ||
|
|
||
| // server call parameters | ||
| const {fireflyData, layout} = getChartData(chartId) || {}; | ||
| const histogramParams = get(fireflyData, `${traceNum}.options`); | ||
| //preserve histogram options when chart state updates are partial | ||
| const histogramParams = { | ||
| ...(traceTS.options || {}), | ||
| ...(fireflyData?.[traceNum]?.options || {}) | ||
|
Comment on lines
+33
to
+34
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. using const a={};
const b=undefined;
const c= {...a,...b}; |
||
| }; | ||
| if (!histogramParams.columnOrExpr) return {}; | ||
| options.columnExpression = histogramParams.columnOrExpr; | ||
| if (get(layout, 'xaxis.type') === 'log') { | ||
| if (layout?.xaxis?.type === 'log') { | ||
| options.columnExpression = 'lg('+histogramParams.columnOrExpr+')'; | ||
| } | ||
| if (histogramParams.fixedBinSizeSelection) { // fixed size bins | ||
|
|
@@ -58,15 +63,28 @@ function fetchData(chartId, traceNum, tablesource) { | |
| const {tbl_id, options} = tablesource; | ||
|
|
||
| const tableModel = getTblById(tbl_id); | ||
| if (!tableModel?.request || !options?.columnExpression) { | ||
| if (isCurrentTableSource(chartId, traceNum, tablesource)) { | ||
| dispatchError(chartId, traceNum, 'Histogram table source is incomplete'); | ||
| } | ||
| return; | ||
| } | ||
| const numericCols = getColumns(tableModel, COL_TYPE.NUMBER).map((c) => c.name); | ||
|
|
||
| const {request} = tableModel; | ||
| const valueColName = 'columnExpression'; | ||
| const formattedColumnExpression = formatColExpr({ | ||
| colOrExpr: options.columnExpression, | ||
| quoted: true, | ||
| colNames: numericCols | ||
| }); | ||
| const sreq = cloneRequest(request, { | ||
| startIdx: 0, | ||
| pageSize: MAX_ROW, | ||
| inclCols: `${formatColExpr({colOrExpr:options.columnExpression, quoted: true, colNames: numericCols})} as "${valueColName}"`, | ||
| sortInfo: `ASC,"${valueColName}"` | ||
| inclCols: `${formattedColumnExpression} as "${valueColName}"`, | ||
| //HistogramProcessor expects the selected value as "columnExpression", | ||
| //but the source query must sort by the original expression | ||
| sortInfo: `ASC,${formattedColumnExpression}` | ||
| }); | ||
| const sreqTblId = uniqueId(request.tbl_id); | ||
| sreq.META_INFO.tbl_id = sreqTblId; | ||
|
|
@@ -80,6 +98,8 @@ function fetchData(chartId, traceNum, tablesource) { | |
| doFetchTable(req).then( | ||
| (tableModel) => { | ||
|
|
||
| if (!isCurrentTableSource(chartId, traceNum, tablesource)) return; | ||
|
|
||
| if (tableModel.error) { | ||
| dispatchError(chartId, traceNum, tableModel.error); | ||
| return; | ||
|
|
@@ -147,7 +167,9 @@ function fetchData(chartId, traceNum, tablesource) { | |
| } | ||
| ).catch( | ||
| (reason) => { | ||
| dispatchError(chartId, traceNum, reason); | ||
| if (isCurrentTableSource(chartId, traceNum, tablesource)) { | ||
| dispatchError(chartId, traceNum, reason); | ||
| } | ||
| } | ||
| ); | ||
| } | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
take out the
getin the above two lines.