client/src/components/project/panels/layout/ctrlLayoutPanel.js
// onRefresh for original / geo / scatter
onRefresh for original / geo / scatter
onRefresh for original / geo / scatter
function onRefresh(layout_model) {
        console.log('[LayoutPanelCtrl.onRefresh] called with layout_model: %O', layout_model);
        var layout = $scope.layout;
        var athenaNamed = _.find(layout_model.options.primary, 'key', 'athena_attr_prefix');
        if(athenaNamed) {
            athenaNamed = athenaNamed.input_value;
            var name = _.find(layout_model.options.primary, 'key', 'layoutName').input_value;
            updateNameInProjectSettings (layout_model.algoName, name, athenaNamed);
            layout.setAttrX(athenaNamed + '_X');
            layout.setAttrY(athenaNamed + '_Y');
        } else if(layout_model.plotType === 'scatterplot') {
            layout.setAttrX(_.find(layout_model.options.primary, 'key', 'xAttr').input_value);
            layout.setAttrY(_.find(layout_model.options.primary, 'key', 'yAttr').input_value);
            layout.setScalerInfoX(_.find(layout_model.options.primary, 'key', 'xScaleType').input_value,
                        parseFloat(_.find(layout_model.options.primary, 'key', 'xScaleBase').input_value),
                        parseFloat(_.find(layout_model.options.primary, 'key', 'xScaleExponent').input_value));
            layout.setScalerInfoY(_.find(layout_model.options.primary, 'key', 'yScaleType').input_value,
                            parseFloat(_.find(layout_model.options.primary, 'key', 'yScaleBase').input_value),
                            parseFloat(_.find(layout_model.options.primary, 'key', 'yScaleExponent').input_value));
        } else if(layout_model.plotType === 'grid') {
            layout.gridAttr = _.find(layout_model.options.primary, 'key', 'renderAttr').input_value;
            layout.gridSortAttr = _.find(layout_model.options.primary, 'key', 'sortAttr').input_value;
            layout.listCompareIds = _.find(layout_model.options.primary, 'key', 'compareIds').input_value;
        }
        else if(layout_model.plotType == 'geo') {
            layout.setAttrX(_.find(layout_model.options.primary, 'key', 'xAttr').input_value);
            layout.setAttrY(_.find(layout_model.options.primary, 'key', 'yAttr').input_value);
        }
        else if(layout_model.plotType === 'list') {
            layout.listAttrs = _.find(layout_model.options.primary, 'key', 'renderAttrs').input_value;
            layout.listSortAttrAr = _.find(layout_model.options.primary, 'key', 'listSortAttrAr').input_value;
            layout.listSortReverseAr = _.find(layout_model.options.primary, 'key', 'sortReverseAr').input_value;
            layout.listCompareIds = _.find(layout_model.options.primary, 'key', 'compareIds').input_value;
            layout.listColSizes = _.find(layout_model.options.primary, 'key', 'listColSizes').input_value;
            console.log('refreshing layout: ', layout);
        }
        return $scope.layoutHelpers.refreshLayout($scope.layout);
    }
function onRefresh ( layout_model ) { console . log ( '[LayoutPanelCtrl.onRefresh] called with layout_model: %O' , layout_model ) ; var layout = $scope . layout ; var athenaNamed = _ . find ( layout_model . options . primary , 'key' , 'athena_attr_prefix' ) ; if ( athenaNamed ) { athenaNamed = athenaNamed . input_value ; var name = _ . find ( layout_model . options . primary , 'key' , 'layoutName' ) . input_value ; updateNameInProjectSettings ( layout_model . algoName , name , athenaNamed ) ; layout . setAttrX ( athenaNamed + '_X' ) ; layout . setAttrY ( athenaNamed + '_Y' ) ; } else if ( layout_model . plotType === 'scatterplot' ) { layout . setAttrX ( _ . find ( layout_model . options . primary , 'key' , 'xAttr' ) . input_value ) ; layout . setAttrY ( _ . find ( layout_model . options . primary , 'key' , 'yAttr' ) . input_value ) ; layout . setScalerInfoX ( _ . find ( layout_model . options . primary , 'key' , 'xScaleType' ) . input_value , parseFloat ( _ . find ( layout_model . options . primary , 'key' , 'xScaleBase' ) . input_value ) , parseFloat ( _ . find ( layout_model . options . primary , 'key' , 'xScaleExponent' ) . input_value ) ) ; layout . setScalerInfoY ( _ . find ( layout_model . options . primary , 'key' , 'yScaleType' ) . input_value , parseFloat ( _ . find ( layout_model . options . primary , 'key' , 'yScaleBase' ) . input_value ) , parseFloat ( _ . find ( layout_model . options . primary , 'key' , 'yScaleExponent' ) . input_value ) ) ; } else if ( layout_model . plotType === 'grid' ) { layout . gridAttr = _ . find ( layout_model . options . primary , 'key' , 'renderAttr' ) . input_value ; layout . gridSortAttr = _ . find ( layout_model . options . primary , 'key' , 'sortAttr' ) . input_value ; layout . listCompareIds = _ . find ( layout_model . options . primary , 'key' , 'compareIds' ) . input_value ; } else if ( layout_model . plotType == 'geo' ) { layout . setAttrX ( _ . find ( layout_model . options . primary , 'key' , 'xAttr' ) . input_value ) ; layout . setAttrY ( _ . find ( layout_model . options . primary , 'key' , 'yAttr' ) . input_value ) ; } else if ( layout_model . plotType === 'list' ) { layout . listAttrs = _ . find ( layout_model . options . primary , 'key' , 'renderAttrs' ) . input_value ; layout . listSortAttrAr = _ . find ( layout_model . options . primary , 'key' , 'listSortAttrAr' ) . input_value ; layout . listSortReverseAr = _ . find ( layout_model . options . primary , 'key' , 'sortReverseAr' ) . input_value ; layout . listCompareIds = _ . find ( layout_model . options . primary , 'key' , 'compareIds' ) . input_value ; layout . listColSizes = _ . find ( layout_model . options . primary , 'key' , 'listColSizes' ) . input_value ; console . log ( 'refreshing layout: ' , layout ) ; } return $scope . layoutHelpers . refreshLayout ( $scope . layout ) ; }
onRefresh for original / geo / scatter
onRefresh for original / geo / scatter
// layout.listSortAttr = _.find(layout_model.options.primary, 'key', 'sortAttr').input_value; // layout.listSortReverse = _.find(layout_model.options.primary, 'key', 'sortReverse').input_value;