Skip to content

Commit

Permalink
composite chart changes are committed
Browse files Browse the repository at this point in the history
  • Loading branch information
arunthampi2006 committed Oct 24, 2017
1 parent 6c6d2ca commit 5c4fdf9
Show file tree
Hide file tree
Showing 9 changed files with 182 additions and 167 deletions.
68 changes: 31 additions & 37 deletions behaviors/redux-mixins-behavior.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,42 +55,41 @@
chartkeys: Object.assign({},state[action.value.id].nodes,action.value.nodes)
})
})
case 'ADD_UPDATE_COMPOSITE_CHART_DATA':
return Object.assign({},state,{[action.value.uuid]:Object.assign({},
state[action.value.uuid],{
compositeChartData:action.value.chartData
})})
case 'COMPOSITE_SPLIT_AREA_CHK':
return Object.assign({},state,{[action.value.uuid]:Object.assign({},
state[action.value.uuid],{
layoutAreaChk:action.value.layoutAreaChk
})})
case 'CHART_AVAILABLE_MODAL_CHK':
return Object.assign({},state,{[action.value.uuid]:Object.assign({},
state[action.value.uuid],{
chartAvailableModalChk:action.value.chartAvailableModalChk
})})
case 'CURRENT_NESTED_OBJ':
return Object.assign({},state,{[action.value.uuid]:Object.assign({},
state[action.value.uuid],{
currentNestedObj:action.value.currentNestedObj
})})

// case 'ADD_UPDATE_COMPOSITE_CHART_DATA':
// return Object.assign({},state,{[action.value.uuid]:Object.assign({},
// state[action.value.uuid],{
// compositeChartData:action.value.chartData
// })})
// case 'COMPOSITE_SPLIT_AREA_CHK':
// return Object.assign({},state,{[action.value.uuid]:Object.assign({},
// state[action.value.uuid],{
// layoutAreaChk:action.value.layoutAreaChk
// })})
// case 'CHART_AVAILABLE_MODAL_CHK':
// return Object.assign({},state,{[action.value.uuid]:Object.assign({},
// state[action.value.uuid],{
// chartAvailableModalChk:action.value.chartAvailableModalChk
// })})
// case 'CURRENT_NESTED_OBJ':
// return Object.assign({},state,{[action.value.uuid]:Object.assign({},
// state[action.value.uuid],{
// currentNestedObj:action.value.currentNestedObj
// })})

// case 'COMP_CHART_UUID_CHK':
// return Object.assign({},state,{[action.value.uuid]:Object.assign({},
// state[action.value.uuid],{
// compChartUUIDChk:action.value.compChartUUIDChk
// })})
// case 'UPDATE_READ_ONLY':
// return Object.assign({},state,{[action.value.uuid]:Object.assign({},
// state[action.value.uuid],{
// readOnly:action.value.readOnly
// })})
case 'CURRENT_CHART_DELETED':
delete state[action.value.uuid]
// return state
return Object.assign({},state)

case 'COMP_CHART_UUID_CHK':
return Object.assign({},state,{[action.value.uuid]:Object.assign({},
state[action.value.uuid],{
compChartUUIDChk:action.value.compChartUUIDChk
})})
case 'UPDATE_READ_ONLY':
return Object.assign({},state,{[action.value.uuid]:Object.assign({},
state[action.value.uuid],{
readOnly:action.value.readOnly
})})
case 'ADD_COMP_REFRENCE_SRC':
return Object.assign({},state,{[action.value.uuid]:Object.assign({},
state[action.value.uuid],{
Expand Down Expand Up @@ -147,11 +146,6 @@
state[action.value.uuid],{
itemXYZ:action.value.itemXYZ
})})





case 'IS_COMPOSITE_CHART':
return Object.assign({},state,{isCompsiteChart:action.value.isCompsiteChart})
case 'NEW_ITEM_CHK':
Expand Down
6 changes: 6 additions & 0 deletions calendar-chart/calendar-chart.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@
margin:0 auto;
font: 10px sans-serif;
}
paper-button.resetBtn {
font-size: x-small;
float: right;
padding: 4px;
margin-top: 5px;
}
</style>
<chart-input-group uuid="[[uuid]]">
<chart-input slot="chart-input" axis="x" label="Key" accept="date"></chart-input>
Expand Down
2 changes: 1 addition & 1 deletion composite-canvas/layout-area.html
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
let chartItem={}
chartItem.chartCls="resize col-md-5"
chartItem.elem=chartElem
chartItem.chartWidth = this.$.layoutArea.offsetWidth/2
chartItem.chartWidth = (this.$.layoutArea.offsetWidth* 41)/100
chartItem.chartHeight = this.$.layoutArea.offsetHeight/2
chartItem.chartCreate = true
chartBox.set("uuid",this.uuid)
Expand Down
6 changes: 6 additions & 0 deletions difference-chart/difference-chart.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@
stroke: #000;
stroke-width: 1px;
}
paper-button.resetBtn {
font-size: x-small;
float: right;
padding: 4px;
margin-top: 5px;
}

</style>
<chart-input-group uuid="[[uuid]]">
Expand Down
57 changes: 31 additions & 26 deletions display-component/base-chart.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ <h3>[[title]] </h3>
axisKeys:{
type:String,
statePath(state){
let chartId = this.isCompsiteChart && this.id!=""?this.id:this.uuid
let chartPath = state.charts[chartId]
// let chartId = this.isCompsiteChart && this.id!=""?this.id:this.uuid
let chartPath = state.charts[this.uuid]
let keyChk = chartPath && chartPath.inputs&&Object.keys(chartPath.inputs).length
let keys = keyChk && Object.keys(chartPath.inputs)
return keys
Expand All @@ -43,8 +43,8 @@ <h3>[[title]] </h3>
type:Array,
observer:'_chartDraw',
statePath(state){
let chartId = this.isCompsiteChart && this.id!=""?this.id:this.uuid
let chartPath = state.charts[chartId]
// let chartId = this.isCompsiteChart && this.id!=""?this.id:this.uuid
let chartPath = state.charts[this.uuid]
let keyChk = chartPath && chartPath.inputs&&Object.keys(chartPath.inputs).length
let inputData = keyChk ? chartPath.inputs:{}
return inputData
Expand All @@ -64,8 +64,8 @@ <h3>[[title]] </h3>
type:Object,
observer:'_chartDraw',
statePath(state){
let chartId = this.isCompsiteChart && this.id!=""?this.id:this.uuid
let chartPath = state.charts[chartId]
// let chartId = this.isCompsiteChart && this.id!=""?this.id:this.uuid
let chartPath = state.charts[this.uuid]
if(chartPath){
return chartPath.settings;
}else{
Expand Down Expand Up @@ -94,7 +94,7 @@ <h3>[[title]] </h3>
refSource:{
type:Array,
statePath(state){
let chartId = this.isCompsiteChart && this.id!=""?this.id:this.uuid
let chartId = this.isCompsiteChart && this.uuid
let chartPath = state.charts[chartId]
let refSource = chartPath && chartPath.refrenceSrc
return refSource?refSource:[]
Expand All @@ -114,8 +114,8 @@ <h3>[[title]] </h3>
stacked:{
type:Boolean,
statePath(state){
let chartId = this.isCompsiteChart && this.id!=""?this.id:this.uuid
let chartPath = state.charts[chartId]
// let chartId = this.isCompsiteChart && this.id!=""?this.id:this.uuid
let chartPath = state.charts[this.uuid]
let objAssignChk = (chartPath && chartPath.settings)
let stacked = objAssignChk&&chartPath.settings.stacked.value
return stacked
Expand All @@ -125,8 +125,8 @@ <h3>[[title]] </h3>
group:{
type:Boolean,
statePath(state){
let chartId = this.isCompsiteChart && this.id!=""?this.id:this.uuid
let chartPath = state.charts[chartId]
// let chartId = this.isCompsiteChart && this.id!=""?this.id:this.uuid
let chartPath = state.charts[this.uuid]
let objAssignChk = (chartPath && chartPath.settings)
let group = objAssignChk&&chartPath.settings.group.value
return group
Expand Down Expand Up @@ -166,16 +166,16 @@ <h3>[[title]] </h3>
filterIdx:{
type:Number,
statePath(state){
let chartIdChk = this.isCompsiteChart && this.id!=""&&state.charts[this.id]
let filterIdx = chartIdChk && state.charts[this.id].filterIdx
let chartIdChk = this.isCompsiteChart && state.charts[this.uuid]
let filterIdx = chartIdChk && chartIdChk.filterIdx
return filterIdx>=0?filterIdx:-1
}
},
compfilterChk:{
type:Boolean,
statePath(state){
let chartIdChk = this.isCompsiteChart && this.id!=""&&state.charts[this.id]
let compfilterChk = chartIdChk && state.charts[this.id].compfilterChk
let chartIdChk = this.isCompsiteChart && state.charts[this.uuid]
let compfilterChk = chartIdChk && chartIdChk.compfilterChk
return compfilterChk
},
observer:"filterCheckSelected"
Expand All @@ -194,8 +194,8 @@ <h3>[[title]] </h3>
filterKeys:{
type:Array,
statePath(state){
let chartIdChk = this.isCompsiteChart && this.id!=""&&state.charts[this.id]
let filterKeys = chartIdChk && state.charts[this.id].filterKeys
let chartIdChk = this.isCompsiteChart && state.charts[this.uuid]
let filterKeys = chartIdChk && chartIdChk.filterKeys
return filterKeys?filterKeys:[]
}
},
Expand All @@ -211,32 +211,32 @@ <h3>[[title]] </h3>
dblClick:{
type:Boolean,
statePath(state){
let chartIdChk = this.isCompsiteChart && this.id!=""&&state.charts[this.id]
let dblClick = chartIdChk && state.charts[this.id].dblClick
let chartIdChk = this.isCompsiteChart && state.charts[this.uuid]
let dblClick = chartIdChk && chartIdChk.dblClick
return dblClick?dblClick:false
}
},
filterReload:{
type:Boolean,
statePath(state){
let chartIdChk = this.isCompsiteChart && this.id!=""&&state.charts[this.id]
let filterReload = chartIdChk && state.charts[this.id].filterReload
let chartIdChk = this.isCompsiteChart && state.charts[this.uuid]
let filterReload = chartIdChk && chartIdChk.filterReload
return filterReload?filterReload:false
}
},
lastFilterActivated:{
type:Boolean,
statePath(state){
let chartIdChk = this.isCompsiteChart && this.id!=""&&state.charts[this.id]
let lastFilterActivated = chartIdChk && state.charts[this.id].lastFilterActivated
let chartIdChk = this.isCompsiteChart && state.charts[this.uuid]
let lastFilterActivated = chartIdChk && chartIdChk.lastFilterActivated
return lastFilterActivated?lastFilterActivated:false
}
},
itemXYZ:{
type:Object,
statePath(state){
let chartIdChk = this.isCompsiteChart && this.id!=""&&state.charts[this.id]
let itemXYZ = chartIdChk && state.charts[this.id].itemXYZ
let chartIdChk = this.isCompsiteChart && state.charts[this.uuid]
let itemXYZ = chartIdChk && chartIdChk.itemXYZ
return itemXYZ?itemXYZ:{}
}
},
Expand All @@ -256,7 +256,7 @@ <h3>[[title]] </h3>
layoutData:{
type:Array,
statePath(state){
let chartId = this.compUUID?this.compUUID:this.uuid
let chartId = this.isCompsiteChart && this.compUUID?this.compUUID:this.uuid
let chartPath = state.charts[chartId]
let layoutData = chartPath && chartPath.layoutData
return layoutData?layoutData:[]
Expand Down Expand Up @@ -585,6 +585,7 @@ <h3>[[title]] </h3>
chartRemove(){
let layoutData = this.layoutData.filter(item=>item.id!=this.uuid)
this.remove()
this.chartReset()
this.dispatch("updateLayoutItem",{uuid:this.compUUID,layoutData:layoutData})
this.dispatch("currentChartDeleted", {uuid:this.uuid})
}
Expand Down Expand Up @@ -637,6 +638,10 @@ <h3>[[title]] </h3>
propData.filterIdxGbl = filterIdxGbl
propData.itemXYZ = itemXYZ
filterKeys.length?this.reduxUpdateSrc(propData):this.chartReset()

let body = document.getElementsByTagName("body")
let d3Tip = body[0].querySelectorAll(".d3-tip")
d3Tip.length && d3Tip.forEach(item=>item.remove())
}
reduxUpdateSrc(propData){
this.dispatch("addfilterIdx", {uuid:this.uuid,filterIdx:propData.filterIdx})
Expand Down
Loading

0 comments on commit 5c4fdf9

Please sign in to comment.