feat: Add groupBase axis option

This commit is contained in:
1ambda 2017-03-12 16:46:59 +09:00
parent 91ae54d1c1
commit 9768ecfcc5
3 changed files with 12 additions and 13 deletions

View file

@ -52,9 +52,14 @@ limitations under the License.
</span>
<span ng-if="isGroupAxis(axisSpec)"
class="label label-default"
style="background-color: #CD5C5C; font-weight: 300; font-size: 13px; margin-left: 3px;">
style="background-color: #cd5c5c; font-weight: 300; font-size: 13px; margin-left: 3px;">
group by
</span>
<span ng-if="isGroupBaseAxis(axisSpec)"
class="label label-default"
style="background-color: #906ebd; font-weight: 300; font-size: 13px; margin-left: 3px;">
group base
</span>
<!-- axis box: in case of single dimension -->
<ul data-drop="true"

View file

@ -23,6 +23,7 @@ export const Aggregator = {
}
export function isAggregator(axisSpec) { return axisSpec.aggregator; }
export function isGroup(axisSpec) { return axisSpec.group; }
export function isGroupBase(axisSpec) { return axisSpec.groupBase; }
export function isSingleDimension(axisSpec) { return axisSpec.dimension === 'single'; }

View file

@ -15,7 +15,7 @@
import Transformation from './transformation';
import {
isAggregator, isGroup, isSingleDimension,
isAggregator, isGroup, isGroupBase, isSingleDimension,
groupAndAggregateRows, getGroupAndAggrColumns,
} from './advanced-transformation-util';
@ -99,10 +99,6 @@ class AdvancedTransformation extends Transformation {
return `${axisSpec.name} (${axisSpec.type})`
},
isAggregatorAxis: (axisSpec) => {
return isAggregator(axisSpec)
},
toggleColumnPanel: () => {
configInstance.panel.columnPanelOpened =
!configInstance.panel.columnPanelOpened
@ -115,13 +111,10 @@ class AdvancedTransformation extends Transformation {
self.emitConfig(configInstance)
},
isGroupAxis: (axisSpec) => {
return isGroup(axisSpec)
},
isSingleDimensionAxis: (axisSpec) => {
return isSingleDimension(axisSpec)
},
isGroupAxis: (axisSpec) => { return isGroup(axisSpec) },
isGroupBaseAxis: (axisSpec) => { return isGroupBase(axisSpec) },
isAggregatorAxis: (axisSpec) => { return isAggregator(axisSpec) },
isSingleDimensionAxis: (axisSpec) => { return isSingleDimension(axisSpec) },
parameterChanged: (paramSpec) => {
self.emitConfig(configInstance)