@c8y/ng1-modules 1019.24.1 → 1019.24.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- "use strict";!function(){function e(a,e,i,o){a.onRealtimeAlarmFn=function(e){a.onAlarm=e},a.onRealtimeEventFn=function(e){a.onEvent=e};var t,n=200;function c(e,i){!1!==a.child.config.updateDates&&(a.child.config.dateFrom=e,e=moment().diff(moment(i),"seconds")<5,a.child.config.widgetInstanceGlobalTimeContext||!a.viewRealtime||e||(a.viewRealtime=!1),a.child.config.dateTo=i)}function l(){var e,i,t,n;a.child&&a.child.config&&(e=(t=a.child.config).interval,t=t.realtime,e)&&(e!==o.custom.id||t)&&(e===o.custom.id&&t?(t=new Date(a.child.config.dateFrom),t=new Date(a.child.config.dateTo)-t,n=moment(),a.child.config.dateTo=n.toDate(),a.child.config.dateFrom=n.subtract(t,"milliseconds").toDate()):(i=e,(n=_.find(o.intervals,function(e){return e.id===i})||{}).qty&&(a.child.config.dateFrom=moment().subtract(n.qty,n.unit).toDate(),a.child.config.dateTo=moment().toDate())))}function d(){var e=i.height();_.isUndefined(_.get(t,"height"))||(e-=t.height),a.dataPointsGraphHeight=_.max([n,e])}function h(){e(function(){a.$broadcast("dashboardResize")},500)}function m(e,i){a.alarmsEventsTimeline=a.alarmsEventsTimeline||{},a.alarmsEventsTimeline.displayedDateFrom=e,a.alarmsEventsTimeline.displayedDateTo=i}function f(e){return _(e).map(function(e){return e.__target.id}).uniq().value().join(",")}a.onUpdateDates=c,a.onUpdateDisplayedDates=m,a.onBoxChanged=function(e){a.chartBox=e},a.onTimelinesChartSizeChanged=function(e){t=e,d(),h()},a.dataPointsGraphHeight=i.height(),a.viewRealtime=a.child&&a.child.config&&a.child.config.realtime,a.onRealtimeToggle=function(){a.viewRealtime=!a.viewRealtime},a.recalculate=l,l(),a.$watch("child.config.datapoints",function(e){e=f(e);a.channel=e?"/measurements/".concat(e):""}),a.$watch("child.config.alarmsEventsConfigs",function(e){e=f(e);a.alarmsChannel=e?"/alarms/".concat(e):"",a.eventsChannel=e?"/events/".concat(e):""}),a.$watchCollection(["child.config.dateFrom","child.config.dateTo"],function(){m(a.child.config.dateFrom,a.child.config.dateTo)}),a.$watch("child.config.date",function(){a.child.config.widgetInstanceGlobalTimeContext&&c(new Date(a.child.config.date[0]),new Date(a.child.config.date[1]))}),a.$watch("child.config.realtime",function(){a.viewRealtime=a.child&&a.child.config&&a.child.config.realtime}),a.$on("dashboardResize",function(e){e.targetScope!==a&&(d(),h())})}e.$inject=["$scope","$timeout","$element","INTERVAL_CONSTANTS"],angular.module("c8y.cockpit.dataPointExplorer").controller("DataPointWidgetCtrl",e)}();
1
+ "use strict";!function(){function i(a,i,e,o,n){a.onRealtimeAlarmFn=function(i){a.onAlarm=i},a.onRealtimeEventFn=function(i){a.onEvent=i};var t,c=200;function l(i,e,t){!1!==a.child.config.updateDates&&(a.child.config.dateFrom=i,!a.child.config.widgetInstanceGlobalTimeContext&&a.viewRealtime&&t===n.onDragEnd&&(a.viewRealtime=!1),a.child.config.dateTo=e)}function d(){var i,e,t,n;a.child&&a.child.config&&(i=(t=a.child.config).interval,t=t.realtime,i)&&(i!==o.custom.id||t)&&(i===o.custom.id&&t?(t=new Date(a.child.config.dateFrom),t=new Date(a.child.config.dateTo)-t,n=moment(),a.child.config.dateTo=n.toDate(),a.child.config.dateFrom=n.subtract(t,"milliseconds").toDate()):(e=i,(n=_.find(o.intervals,function(i){return i.id===e})||{}).qty&&(a.child.config.dateFrom=moment().subtract(n.qty,n.unit).toDate(),a.child.config.dateTo=moment().toDate())))}function h(){var i=e.height();_.isUndefined(_.get(t,"height"))||(i-=t.height),a.dataPointsGraphHeight=_.max([c,i])}function f(){i(function(){a.$broadcast("dashboardResize")},500)}function m(i,e){a.alarmsEventsTimeline=a.alarmsEventsTimeline||{},a.alarmsEventsTimeline.displayedDateFrom=i,a.alarmsEventsTimeline.displayedDateTo=e}function r(i){return _(i).map(function(i){return i.__target.id}).uniq().value().join(",")}a.onUpdateDates=l,a.onUpdateDisplayedDates=m,a.onBoxChanged=function(i){a.chartBox=i},a.onTimelinesChartSizeChanged=function(i){t=i,h(),f()},a.dataPointsGraphHeight=e.height(),a.viewRealtime=a.child&&a.child.config&&a.child.config.realtime,a.onRealtimeToggle=function(){a.viewRealtime=!a.viewRealtime},a.recalculate=d,d(),a.$watch("child.config.datapoints",function(i){i=r(i);a.channel=i?"/measurements/".concat(i):""}),a.$watch("child.config.alarmsEventsConfigs",function(i){i=r(i);a.alarmsChannel=i?"/alarms/".concat(i):"",a.eventsChannel=i?"/events/".concat(i):""}),a.$watchCollection(["child.config.dateFrom","child.config.dateTo"],function(){m(a.child.config.dateFrom,a.child.config.dateTo)}),a.$watch("child.config.date",function(){a.child.config.widgetInstanceGlobalTimeContext&&l(new Date(a.child.config.date[0]),new Date(a.child.config.date[1]))}),a.$watch("child.config.realtime",function(){a.viewRealtime=a.child&&a.child.config&&a.child.config.realtime}),a.$on("dashboardResize",function(i){i.targetScope!==a&&(h(),f())})}i.$inject=["$scope","$timeout","$element","INTERVAL_CONSTANTS","X_AXIS_CONSTANTS"],angular.module("c8y.cockpit.dataPointExplorer").controller("DataPointWidgetCtrl",i)}();
@@ -43,7 +43,7 @@
43
43
  aggregation="child.config.aggregation"
44
44
  show-time="child.config.displayDateSelection"
45
45
  on-data="onData"
46
- on-update-dates="onUpdateDates($dateFrom, $dateTo)"
46
+ on-update-dates="onUpdateDates($dateFrom, $dateTo, $updateTrigger)"
47
47
  on-update-displayed-dates="onUpdateDisplayedDates($dateFrom, $dateTo)"
48
48
  on-realtime-toggle="onRealtimeToggle()"
49
49
  on-box-changed="onBoxChanged(box)"
@@ -1 +1 @@
1
- "use strict";!function(){function t(e,s,t){var n=t.getD3Locales().timeFormat.multi([[".%L",function(t){return t.getMilliseconds()}],[":%S",function(t){return t.getSeconds()}],["%H:%M",function(t){return t.getMinutes()}],["%H:%M",function(t){return t.getHours()}],["%a %d",function(t){return t.getDay()&&1!==t.getDate()}],["%b %d",function(t){return 1!==t.getDate()}],["%B",function(t){return t.getMonth()}],["%Y",function(){return!0}]]);function r(t){(this.chart=t).addItem(this)}return r.prototype={scale:function(){var t=this,e=t.chart.box();return d3.time.scale().domain([t._from,t._to]).range([e.rangeMin,e.rangeMax])},axis:function(){return d3.svg.axis().scale(this.scale()).orient("bottom").ticks(6).tickFormat(n)},canRender:function(){return!(!this._from||!this._to)},updateDates:function(t,e,n){var r=this,t=moment(t).milliseconds(0),e=moment(e).milliseconds(0);t.isSame(r._from)&&e.isSame(r._to)||(r._from=t.toDate(),r._to=e.toDate(),n&&r.onUpdateDates&&r.onUpdateDates(r._from,r._to),r._xDragStart)||r.chart.render()},getDebouncePreference:function(){var t=this,e=moment(t._to).diff(moment(t._from),"seconds");return t.debounceTime!==e?{debounceTime:(t.debounceTime=e)||200,reset:!0}:{debounceTime:e||200,reset:!1}},render:function(){var t,e=this,n=e.axis(),r=e.el,a=e.chart.box(),o=e.chart.margins,a=a.height-o.b;r||(t=e.chart.svg,e.el=t.append("g").attr({class:"xaxis axis",transform:s.translate(o.l,a)}).style({"pointer-events":"all",cursor:"ew-resize"}),(r=e.el).boxHover=r.append("rect").attr({class:"recthover",height:19,fill:"rgba(255,255,255,0.01)",transform:s.translate(o.l,0)}),e.drag=d3.behavior.drag(),t=e.drag,r.call(t),r.boxHover.call(t),e.addEvents()),r.boxHover.attr("width",function(){return e.chart.box().axisXwidth}),e.canRender()&&r.call(n).attr({transform:s.translate(o.l,a)})},onMouseDown:function(){var e=this;return function(){d3.event.sourceEvent.stopPropagation(),e._scale=e.scale();var t=e._scale;e._xDragStart=t.invert(d3.mouse(e.el.node())[0]),e.__from=e._from,e.__to=e._to,e.el.select("path").style("stroke","#CCC")}},onDragEnd:function(){var t=this;return function(){d3.event.sourceEvent.stopPropagation(),_.isUndefined(t._xDragStart)||(t.chart.render(),t.el.select("path").style("stroke",""),t.onUpdateDates&&(t.onUpdateDates(t._from,t._to),e.$apply())),delete t._xDragStart}},updateScaleOnDrag:function(t){var e=this,n=e._scale,n=moment(n.invert(t)).diff(e._xDragStart);e.updateDates(moment(e.__from).subtract(n,"ms"),moment(e.__to).subtract(n,"ms")),e.render()},onDrag:function(){var e=this;return function(){d3.event.sourceEvent.stopPropagation();var t=e.el.node();_.isUndefined(e._xDragStart)||e.updateScaleOnDrag(d3.mouse(t)[0])}},addEvents:function(){this.drag.on("dragstart",this.onMouseDown()).on("drag",this.onDrag()).on("dragend",this.onDragEnd())}},r}t.$inject=["$rootScope","c8yChartCommon","c8yLocales"],angular.module("c8y.core.measurements2").factory("c8yAxisX",t)}();
1
+ "use strict";!function(){function t(e,s,t,n){var r=t.getD3Locales().timeFormat.multi([[".%L",function(t){return t.getMilliseconds()}],[":%S",function(t){return t.getSeconds()}],["%H:%M",function(t){return t.getMinutes()}],["%H:%M",function(t){return t.getHours()}],["%a %d",function(t){return t.getDay()&&1!==t.getDate()}],["%b %d",function(t){return 1!==t.getDate()}],["%B",function(t){return t.getMonth()}],["%Y",function(){return!0}]]);function a(t){(this.chart=t).addItem(this)}return a.prototype={scale:function(){var t=this,e=t.chart.box();return d3.time.scale().domain([t._from,t._to]).range([e.rangeMin,e.rangeMax])},axis:function(){return d3.svg.axis().scale(this.scale()).orient("bottom").ticks(6).tickFormat(r)},canRender:function(){return!(!this._from||!this._to)},updateDates:function(t,e,n){var r=this,t=moment(t).milliseconds(0),e=moment(e).milliseconds(0);t.isSame(r._from)&&e.isSame(r._to)||(r._from=t.toDate(),r._to=e.toDate(),n&&r.onUpdateDates&&r.onUpdateDates(r._from,r._to),r._xDragStart)||r.chart.render()},getDebouncePreference:function(){var t=this,e=moment(t._to).diff(moment(t._from),"seconds");return t.debounceTime!==e?{debounceTime:(t.debounceTime=e)||200,reset:!0}:{debounceTime:e||200,reset:!1}},render:function(){var t,e=this,n=e.axis(),r=e.el,a=e.chart.box(),o=e.chart.margins,a=a.height-o.b;r||(t=e.chart.svg,e.el=t.append("g").attr({class:"xaxis axis",transform:s.translate(o.l,a)}).style({"pointer-events":"all",cursor:"ew-resize"}),(r=e.el).boxHover=r.append("rect").attr({class:"recthover",height:19,fill:"rgba(255,255,255,0.01)",transform:s.translate(o.l,0)}),e.drag=d3.behavior.drag(),t=e.drag,r.call(t),r.boxHover.call(t),e.addEvents()),r.boxHover.attr("width",function(){return e.chart.box().axisXwidth}),e.canRender()&&r.call(n).attr({transform:s.translate(o.l,a)})},onMouseDown:function(){var e=this;return function(){d3.event.sourceEvent.stopPropagation(),e._scale=e.scale();var t=e._scale;e._xDragStart=t.invert(d3.mouse(e.el.node())[0]),e.__from=e._from,e.__to=e._to,e.el.select("path").style("stroke","#CCC")}},onDragEnd:function(){var t=this;return function(){d3.event.sourceEvent.stopPropagation(),_.isUndefined(t._xDragStart)||(t.chart.render(),t.el.select("path").style("stroke",""),t.onUpdateDates&&(t.onUpdateDates(t._from,t._to,n.onDragEnd),e.$apply())),delete t._xDragStart}},updateScaleOnDrag:function(t){var e=this,n=e._scale,n=moment(n.invert(t)).diff(e._xDragStart);e.updateDates(moment(e.__from).subtract(n,"ms"),moment(e.__to).subtract(n,"ms")),e.render()},onDrag:function(){var e=this;return function(){d3.event.sourceEvent.stopPropagation();var t=e.el.node();_.isUndefined(e._xDragStart)||e.updateScaleOnDrag(d3.mouse(t)[0])}},addEvents:function(){this.drag.on("dragstart",this.onMouseDown()).on("drag",this.onDrag()).on("dragend",this.onDragEnd())}},a}t.$inject=["$rootScope","c8yChartCommon","c8yLocales","X_AXIS_CONSTANTS"],angular.module("c8y.core.measurements2").factory("c8yAxisX",t).constant("X_AXIS_CONSTANTS",{onDragEnd:"onDragEnd"})}();
@@ -1 +1 @@
1
- "use strict";!function(){function t(o,t,a,n,e){var i,c,r,d,l,s=_.debounce(f,300,{leading:!1,trailing:!0}),m=12e4,u=!1,e=e("Realtime is active. Deactivate it to edit date and time.");function f(){c&&r.dateFrom&&r.dateTo&&(u=!0,c.loadData(r.dateFrom,r.dateTo,o.aggregation).then(p).finally(function(){u=!1,o.onDataChange({chart:c})}))}function D(t){c.realtimeMeasurement(t)&&(h(),p(),o.selectable())&&(g(i),o.selected)&&c.setSelectPoint(o.selected)}function p(){i=moment()}function h(){!u&&moment().diff(i)>m&&f()}function g(t,e){var e=e||{},t=moment(t),a=moment.duration(moment(r.dateTo).diff(r.dateFrom)),a=moment(t).subtract(a),a=(r.dateFrom=a.toDate(),r.dateTo=t.toDate(),r),t=a.dateFrom,a=a.dateTo;e.notrigger&&(l=!0),c.axisX.updateDates(t,a,!1),e.loadData&&f()}var $={dateFrom:!1,dateTo:!1,aggregation:!1,datapoints:!1};function v(t){t&&($[t]=!0),_.every($,function(t){return!0===t})&&s()}function T(){h(),moment(c.axisX._to).isBefore(moment())&&!c.allowSelectFocusTime&&g(moment(),{notrigger:1})}function w(){return _.map(o.datapoints,function(t,e){return{id:e,name:t.label,datapoint:t,datapointActive:t.__active}})}function F(t){o.seriesSelected=t;t=_.map(o.seriesSelected,"datapoint");c.updateSeries(t,!0)}t.$on("c8yRealtime::connected",function(){f()}),this.init=function(t){c=t,o.chart=c,r={},o.internalDates=r,d=n(T),c.axisX.onUpdateDates=function(t,e){r.dateFrom=t,r.dateTo=e},o.$watch("dateFrom",function(t){moment(o.internalDates.dateFrom).isSame(t)||(o.internalDates.dateFrom=new Date(t),c.axisX.updateDates(t,o.dateTo,!1),v("dateFrom"))}),o.$watch("dateTo",function(t){moment(o.internalDates.dateTo).isSame(t)||(o.internalDates.dateTo=new Date(t),c.axisX.updateDates(o.dateFrom,t,!1),v("dateTo"))}),o.$watch("internalDates",function(t,e){var a=t.dateFrom&&moment(t.dateFrom).toDate(),n=t.dateTo&&moment(t.dateTo).toDate();o.datesValid=a&&n&&a<=n,o.datesValid&&(o.onUpdateDisplayedDates&&o.onUpdateDisplayedDates({$dateFrom:a,$dateTo:n}),l?l=!1:t!==e&&o.onUpdateDates&&(o.onUpdateDates({$dateFrom:a,$dateTo:n}),c.axisX.updateDates(a,n,!1),o.realtime&&new Date(e.dateTo).valueOf()-new Date(e.dateFrom).valueOf()==n.valueOf()-a.valueOf()||s()))},!0),o.$watch("aggregation",function(){return v("aggregation")}),o.$watch("datapoints",function(){o.seriesAvailable=w(),o.seriesSelected?F(_.filter(o.seriesAvailable,"datapointActive")):F(function(){var t=_.filter(w(),"datapointActive"),e=o.datapointsInitialDisplayLimit;if(_.isUndefined(e))return t;return _.take(t,e)}())},!0),o.$watchCollection("datapoints",function(){return v("datapoints")}),o.$watch("realtime",function(t){!t||o.selectable()?d.cancel():(g(moment(),{notrigger:1,loadData:1}),d.start())}),o.$watch("selected",function(t){t?c.setSelectPoint(t):c.clearSelectPoint()}),c.onSelectPoint=function(t){a(function(){o.selected=t})},o.$watch(function(){return o.selectable()},function(t){(c.allowSelectFocusTime=t)&&d.cancel()}),o.$watch("chart.chartBox",function(t,e){_.isEqual(t,e)||o.onBoxChanged({box:t})});var e=_.throttle(c.render.bind(c),500);o.$on("dashboardResize",function(){return e()}),o.$watch("showTime()",function(t){t?c.showDateSelection():c.hideDateSelection()}),o.onData=D,o.$on("$destroy",function(){return d.cancel()}),o.onSeriesSelectionChanged=F},o.data={},o.realtimeActiveInfo=e}t.$inject=["$scope","$rootScope","$timeout","RTAutoMove","gettext"],angular.module("c8y.core.measurements2").controller("c8yChartCtrl",t)}();
1
+ "use strict";!function(){function t(o,t,a,n,e){var i,r,c,d,l,s,u=_.debounce(D,300,{leading:!1,trailing:!0}),m=12e4,f=!1,e=e("Realtime is active. Deactivate it to edit date and time.");function D(){r&&c.dateFrom&&c.dateTo&&(f=!0,r.loadData(c.dateFrom,c.dateTo,o.aggregation).then(g).finally(function(){f=!1,o.onDataChange({chart:r})}))}function p(t){r.realtimeMeasurement(t)&&(h(),g(),o.selectable())&&($(i),o.selected)&&r.setSelectPoint(o.selected)}function g(){i=moment()}function h(){!f&&moment().diff(i)>m&&D()}function $(t,e){var e=e||{},t=moment(t),a=moment.duration(moment(c.dateTo).diff(c.dateFrom)),a=moment(t).subtract(a),a=(c.dateFrom=a.toDate(),c.dateTo=t.toDate(),c),t=a.dateFrom,a=a.dateTo;e.notrigger&&(s=!0),r.axisX.updateDates(t,a,!1),e.loadData&&D()}var T={dateFrom:!1,dateTo:!1,aggregation:!1,datapoints:!1};function v(t){t&&(T[t]=!0),_.every(T,function(t){return!0===t})&&u()}function w(){h(),moment(r.axisX._to).isBefore(moment())&&!r.allowSelectFocusTime&&$(moment(),{notrigger:1})}function F(){return _.map(o.datapoints,function(t,e){return{id:e,name:t.label,datapoint:t,datapointActive:t.__active}})}function S(t){o.seriesSelected=t;t=_.map(o.seriesSelected,"datapoint");r.updateSeries(t,!0)}t.$on("c8yRealtime::connected",function(){D()}),this.init=function(t){r=t,o.chart=r,c={},o.internalDates=c,l=n(w),r.axisX.onUpdateDates=function(t,e,a){d=a,c.dateFrom=t,c.dateTo=e},o.$watch("dateFrom",function(t){moment(o.internalDates.dateFrom).isSame(t)||(o.internalDates.dateFrom=new Date(t),r.axisX.updateDates(t,o.dateTo,!1),v("dateFrom"))}),o.$watch("dateTo",function(t){moment(o.internalDates.dateTo).isSame(t)||(o.internalDates.dateTo=new Date(t),r.axisX.updateDates(o.dateFrom,t,!1),v("dateTo"))}),o.$watch("internalDates",function(t,e){var a=t.dateFrom&&moment(t.dateFrom).toDate(),n=t.dateTo&&moment(t.dateTo).toDate();o.datesValid=a&&n&&a<=n,o.datesValid&&(o.onUpdateDisplayedDates&&o.onUpdateDisplayedDates({$dateFrom:a,$dateTo:n}),s?s=!1:t!==e&&o.onUpdateDates&&(o.onUpdateDates({$dateFrom:a,$dateTo:n,$updateTrigger:d}),d=null,r.axisX.updateDates(a,n,!1),o.realtime&&new Date(e.dateTo).valueOf()-new Date(e.dateFrom).valueOf()==n.valueOf()-a.valueOf()||u()))},!0),o.$watch("aggregation",function(){return v("aggregation")}),o.$watch("datapoints",function(){o.seriesAvailable=F(),o.seriesSelected?S(_.filter(o.seriesAvailable,"datapointActive")):S(function(){var t=_.filter(F(),"datapointActive"),e=o.datapointsInitialDisplayLimit;if(_.isUndefined(e))return t;return _.take(t,e)}())},!0),o.$watchCollection("datapoints",function(){return v("datapoints")}),o.$watch("realtime",function(t){!t||o.selectable()?l.cancel():($(moment(),{notrigger:1,loadData:1}),l.start())}),o.$watch("selected",function(t){t?r.setSelectPoint(t):r.clearSelectPoint()}),r.onSelectPoint=function(t){a(function(){o.selected=t})},o.$watch(function(){return o.selectable()},function(t){(r.allowSelectFocusTime=t)&&l.cancel()}),o.$watch("chart.chartBox",function(t,e){_.isEqual(t,e)||o.onBoxChanged({box:t})});var e=_.throttle(r.render.bind(r),500);o.$on("dashboardResize",function(){return e()}),o.$watch("showTime()",function(t){t?r.showDateSelection():r.hideDateSelection()}),o.onData=p,o.$on("$destroy",function(){return l.cancel()}),o.onSeriesSelectionChanged=S},o.data={},o.realtimeActiveInfo=e}t.$inject=["$scope","$rootScope","$timeout","RTAutoMove","gettext"],angular.module("c8y.core.measurements2").controller("c8yChartCtrl",t)}();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@c8y/ng1-modules",
3
- "version": "1019.24.1",
3
+ "version": "1019.24.2",
4
4
  "license": "Apache-2.0",
5
5
  "author": "Cumulocity",
6
6
  "description": "AngularJS modules for Cumulocity IoT applications.",