Skip to content

IRSA-642-DM-11250: fixed two bugs #427

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

Merged
merged 2 commits into from
Jul 28, 2017
Merged
Changes from all commits
Commits
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
32 changes: 20 additions & 12 deletions src/firefly/js/visualize/saga/CoverageWatcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {cloneRequest} from '../../tables/TableUtil.js';
import {TABLE_LOADED, TABLE_SELECT,TABLE_HIGHLIGHT,TABLE_UPDATE,
TABLE_REMOVE, TBL_RESULTS_ACTIVE, TABLE_SORT} from '../../tables/TablesCntlr.js';
import ImagePlotCntlr, {visRoot, dispatchPlotImage, dispatchDeletePlotView} from '../ImagePlotCntlr.js';
import {primePlot, getPlotViewById} from '../PlotViewUtil.js';
import {primePlot, getPlotViewById, getDrawLayerById} from '../PlotViewUtil.js';
import {REINIT_RESULT_VIEW} from '../../core/AppDataCntlr.js';
import {doFetchTable, getTblById, getActiveTableId, getColumnIdx, getTableInGroup, isTableUsingRadians} from '../../tables/TableUtil.js';
import MultiViewCntlr, {getMultiViewRoot, getViewer} from '../MultiViewCntlr.js';
Expand Down Expand Up @@ -99,12 +99,15 @@ export function* watchCoverage(options) {
let {paused=true}= options;
const decimatedTables= {};
let tbl_id;
paused= paused || !get(getViewer(getMultiViewRoot(), viewerId), 'mounted' , false);

if (paused) {
paused= !get(getViewer(getMultiViewRoot(), viewerId),'mounted', false);
}
options= Object.assign(defOptions,cleanUpOptions(options));
let displayedTableId= null;
let previousDisplayedTableId;

if (!paused) {
if (paused) {
const firstId= getActiveTableId();
if (firstId) displayedTableId = updateCoverage(firstId, viewerId, decimatedTables, options);
}
Expand Down Expand Up @@ -372,7 +375,7 @@ function isOnePoint(wpList) {


function makeOverlayCoverageDrawing() {
const colors= {};
const drawingOptions= {};
/**
*
* @param decimatedTables
Expand All @@ -389,16 +392,21 @@ function makeOverlayCoverageDrawing() {

const allRowsTable= decimatedTables[tbl_id];

dispatchDestroyDrawLayer(tbl_id);
const layer= getDrawLayerById(getDlAry(), tbl_id);
if (layer) {
drawingOptions[tbl_id]= layer.drawingDef;
dispatchDestroyDrawLayer(tbl_id);
}

const overlayAry= options.multiCoverage ? Object.keys(decimatedTables) : [allRowsTable.tbl_id];

overlayAry.forEach( (id) => {
// if (id!==tbl_id) return;
if (!colors[id]) colors[id]= lookupOption(options,'color',id) || getNextColor();
if (!drawingOptions[id]) drawingOptions[id]= {};
if (!drawingOptions[id].color) drawingOptions[id].color= lookupOption(options,'color',id) || getNextColor();
const oriTable= getTblById(id);
const arTable= decimatedTables[id];
if (oriTable && arTable) addToCoverageDrawing(PLOT_ID, options, oriTable, arTable, colors[id]);
if (oriTable && arTable) addToCoverageDrawing(PLOT_ID, options, oriTable, arTable, drawingOptions[id]);

});
};
Expand All @@ -411,9 +419,9 @@ function makeOverlayCoverageDrawing() {
* @param {CoverageOptions} options
* @param {TableData} table
* @param {TableData} allRowsTable
* @param {string} color
* @param {string} drawOp
*/
function addToCoverageDrawing(plotId, options, table, allRowsTable, color) {
function addToCoverageDrawing(plotId, options, table, allRowsTable, drawOp) {

if (allRowsTable==='WORKING') return;
const covType= getCoverageType(options,allRowsTable);
Expand All @@ -428,15 +436,15 @@ function addToCoverageDrawing(plotId, options, table, allRowsTable, color) {
dispatchCreateDrawLayer(Catalog.TYPE_ID, {
catalogId: table.tbl_id,
title: `Coverage: ${table.title || table.tbl_id}`,
color,
color: drawOp.color,
tableData,
tableMeta,
tableRequest: table.request,
highlightedRow: table.highlightedRow,
catalog: !boxData,
columns,
symbol: lookupOption(options,'symbol',tbl_id),
size: lookupOption(options,'symbolSize',tbl_id),
symbol: drawOp.symbol || lookupOption(options,'symbol',tbl_id),
size: drawOp.size || lookupOption(options,'symbolSize',tbl_id),
boxData,
selectInfo: table.selectInfo,
angleInRadian,
Expand Down