text
stringlengths
2
1.05M
// Copyright 2019 Google Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. /** * @fileoverview Hosts all API handlers that Tentacles supports. */ 'use strict'; const gaDataImport = require('./ga_data_import.js'); const gaMeasurementProtocol = require('./ga_measurement_protocol.js'); const cmConversionsUpload = require('./cm_conversions_upload.js'); const sftpUpload = require('./sftp_upload.js'); const sheetsLoadCsv = require('./sheets_load_csv.js'); const saConversionsInsert = require('./sa_conversions_insert.js'); const pubsubMessageSend = require('./pubsub_message_send.js'); const googleAdsClickConversionUpload = require('./google_ads_click_conversions_upload.js'); const googleAdsCustomerMatchUpload = require('./google_ads_customer_match_upload.js'); const {GoogleAnalyticsConfig} = gaDataImport; const {MeasurementProtocolConfig} = gaMeasurementProtocol; const {CampaignManagerConfig} = cmConversionsUpload; const {SftpConfig} = sftpUpload; const {SheetsLoadConfig} = sheetsLoadCsv; const {SearchAdsConfig} = saConversionsInsert; const {PubSubMessageConfig} = pubsubMessageSend; const {GoogleAdsClickConversionConfig} = googleAdsClickConversionUpload; const {GoogleAdsCustomerMatchConfig} = googleAdsCustomerMatchUpload; /** * API configuration types for all APIs that Tentacles supports. * * @typedef {(!GoogleAnalyticsConfig|!CampaignManagerConfig| * !MeasurementProtocolConfig|!SftpConfig|!SheetsLoadConfig| * !SearchAdsConfig|!PubSubMessageConfig| * !GoogleAdsClickConversionConfig|!GoogleAdsCustomerMatchConfig)} */ let ApiConfigItem; /** * Definition of API handler function. It takes three parameters: * {string} Data to send out. * {string} Pub/sub message ID for log. * {!ApiConfigItem} API configuration. * @typedef {function(string,string,!ApiConfigItem):!Promise<boolean>} */ let ApiHandlerFunction; /** * All handlers for the APIs that Tentacles supports. * @type {!Object<string,!ApiHandlerFunction>} */ const API_HANDLERS = Object.freeze({ [gaDataImport.name]: gaDataImport, [gaMeasurementProtocol.name]: gaMeasurementProtocol, [cmConversionsUpload.name]: cmConversionsUpload, [sftpUpload.name]: sftpUpload, [sheetsLoadCsv.name]: sheetsLoadCsv, [saConversionsInsert.name]: saConversionsInsert, [pubsubMessageSend.name]: pubsubMessageSend, [googleAdsClickConversionUpload.name]: googleAdsClickConversionUpload, [googleAdsCustomerMatchUpload.name]: googleAdsCustomerMatchUpload, }); /** * Gets all supported API names. * * @return {!Array<string>} */ const getApiNameList = () => Object.keys(API_HANDLERS); /** * Gets the names of APIs that use Cloud Storage as the default data transfer * infrastructure. * Some APIs are mainly a file uploading process, e.g. Google Analytics Data * Import or SFTP. These APIs suit for Cloud Storage rather than Pub/Sub which * has a limited size for a batch of data transferred. * * @return {!Array<string>} */ const getApiOnGcs = () => getApiNameList().filter((key) => API_HANDLERS[key].defaultOnGcs); /** * Gets the handler for the given API. * * @param {string} api The API name. * @return {(!ApiHandlerFunction|undefined)} */ const getApiHandler = (api) => API_HANDLERS[api] ? API_HANDLERS[api].sendData : undefined; module.exports = { ApiConfigItem, ApiHandlerFunction, getApiNameList, getApiOnGcs, getApiHandler, };
import React from 'react'; import ReactDOM from 'react-dom'; import { mount } from 'enzyme'; import net from '../../../net'; import Data from '../../Data/Data'; import Chart from '../Chart'; import LineChart from './LineChart'; import BarChart from './BarChart'; import ScatterPlot from './ScatterPlot'; const classes = [ BarChart, LineChart, ScatterPlot ]; const testClass = (Visual) => { describe(`the ${Visual.name}`, () => { let data; let chart; let config; beforeEach(() => { return net.fetchEndpoint('/data', 'text').then(rawData => { data = new Data(rawData); config = Chart.config; config.dimensions = { body: { w: 500, h: 500 }, scale: Chart.getScales(500, 500, Chart.config.margin, data.getDomainDay(), data.getDomainSpent()) }; chart = mount(<Visual data={data.getSumByDay()} config={ config.visual } margin={ config.margin } dimensions={ config.dimensions } />); return true; }); }); it('renders without crashing', () => { expect(chart).not.toBeUndefined(); }); it('contains at least one data point', () => { expect(chart.state().node.children.length).toBeGreaterThan(0); }); it('contains a `g` element', () => { const g = chart.find('g'); expect(g.length).toBe(1); }); it('receives a `data` prop', () => { expect(chart.props().data).not.toBeUndefined(); }); it('receives an `config` prop', () => { expect(chart.props().config).not.toBeUndefined(); }); it('receives a `margin` prop', () => { expect(chart.props().margin).not.toBeUndefined(); }); it('receives a `dimensions` prop', () => { expect(chart.props().dimensions).not.toBeUndefined(); }); }); }; for (let i = 0; i < classes.length; i++) { testClass(classes[i]); }
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([[1],{"yP6+":function(t,e,n){(function(e,r){t.exports=r(n("q1tI"))})(0,function(t){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.i=function(t){return t},n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:r})},n.n=function(t){var e=t&&t.__esModule?function(){return t["default"]}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=527)}([function(t,e,n){var r=n(160),i=n(23),a=r.mix({},r,{assign:r.mix,merge:r.deepMix,cloneDeep:r.clone,isFinite:isFinite,isNaN:isNaN,snapEqual:r.isNumberEqual,remove:r.pull,inArray:r.contains,toAllPadding:function(t){var e=0,n=0,r=0,i=0;return a.isNumber(t)||a.isString(t)?e=n=r=i=t:a.isArray(t)?(e=t[0],r=a.isNil(t[1])?t[0]:t[1],i=a.isNil(t[2])?t[0]:t[2],n=a.isNil(t[3])?r:t[3]):a.isObject(t)&&(e=t.top||0,r=t.right||0,i=t.bottom||0,n=t.left||0),[e,r,i,n]},getClipByRange:function(t){var e=t.tl,n=t.br,r=new i.Rect({attrs:{x:e.x,y:e.y,width:n.x-e.x,height:n.y-e.y}});return r}});a.Array={groupToMap:r.groupToMap,group:r.group,merge:r.merge,values:r.valuesOfKey,getRange:r.getRange,firstValue:r.firstValue,remove:r.pull},t.exports=a},function(t,e,n){var r=n(143),i={};r.merge(i,r,{mixin:function(t,e){var n=t.CFG?"CFG":"ATTRS";if(t&&e){t._mixins=e,t[n]=t[n]||{};var r={};i.each(e,function(e){i.augment(t,e);var a=e[n];a&&i.merge(r,a)}),t[n]=i.merge(r,t[n])}}}),t.exports=i},function(t,e,n){var r=n(38),i=n(4),a=function(t,e){if(t){var n=void 0;if(i(t)){for(var a=0,o=t.length;a<o;a++)if(n=e(t[a],a),!1===n)break}else if(r(t))for(var s in t)if(t.hasOwnProperty(s)&&(n=e(t[s],s),!1===n))break}};t.exports=a},function(t,e,n){var r=n(35),i=n(160),a=i.mix({assign:i.mix,isFinite:isFinite,isNaN:isNaN,Group:r.Group,Event:r.Event},i);t.exports=a},function(t,e,n){var r=n(16),i=Array.isArray?Array.isArray:function(t){return r(t,"Array")};t.exports=i},function(t,e,n){var r=n(0),i=n(125),a={version:"3.5.1",renderer:"canvas",trackingInfo:{},animate:!0,widthRatio:{column:.5,rose:.9999999,multiplePie:1/1.3},showSinglePoint:!1,connectNulls:!1,scales:{},registerTheme:function(t,e){i[t]=e},setTheme:function(t){var e={};e=r.isObject(t)?t:-1!==r.indexOf(Object.keys(i),t)?i[t]:i.default,r.deepMix(a,e)}};a.setTheme("default"),t.exports=a},function(t,e){var n=function(t){return null===t||void 0===t};t.exports=n},function(t,e,n){var r=n(1),i=n(315),a=n(126),o=n(70),s=function t(e){t.superclass.constructor.call(this,e)};s.ATTRS={},r.extend(s,a);var u={matrix:"matrix",path:"path",points:"points",lineDash:"lineDash"};function l(t){for(var e=[],n=0;n<t.length;n++)r.isArray(t[n])?e.push([].concat(t[n])):e.push(t[n]);return e}r.augment(s,i,{isShape:!0,drawInner:function(t){var e=this,n=e._attrs;e.createPath(t);var i=t.globalAlpha;if(e.hasFill()){var a=n.fillOpacity;r.isNil(a)||1===a?t.fill():(t.globalAlpha=a,t.fill(),t.globalAlpha=i)}if(e.hasStroke()){var o=e._attrs.lineWidth;if(o>0){var s=n.strokeOpacity;r.isNil(s)||1===s||(t.globalAlpha=s),t.stroke()}}e.afterPath(t)},afterPath:function(){},isHitBox:function(){return!0},isHit:function(t,e){var n=this,r=[t,e,1];if(n.invert(r),n.isHitBox()){var i=n.getBBox();if(i&&!o.box(i.minX,i.maxX,i.minY,i.maxY,r[0],r[1]))return!1}var a=n._attrs.clip;return a?(a.invert(r,n.get("canvas")),!!a.isPointInPath(r[0],r[1])&&n.isPointInPath(r[0],r[1])):n.isPointInPath(r[0],r[1])},calculateBox:function(){return null},getHitLineWidth:function(){var t=this._attrs,e=t.lineAppendWidth||0,n=t.lineWidth||0;return n+e},clearTotalMatrix:function(){this._cfg.totalMatrix=null,this._cfg.region=null},clearBBox:function(){this._cfg.box=null,this._cfg.region=null},getBBox:function(){var t=this._cfg.box;return t||(t=this.calculateBox(),t&&(t.x=t.minX,t.y=t.minY,t.width=t.maxX-t.minX,t.height=t.maxY-t.minY),this._cfg.box=t),t},clone:function(){var t=this,e=null,n=t._attrs,i={};return r.each(n,function(t,e){u[e]&&r.isArray(n[e])?i[e]=l(n[e]):i[e]=n[e]}),e=new t.constructor({attrs:i}),e._cfg.zIndex=t._cfg.zIndex,e}}),t.exports=s},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}function i(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}var a=n(61),o=n(221),s=n(113),u=n(0),l=n(5),c=n(288),h=n(9),f=n(294),p=n(292),d=n(293),g=n(307),v=["color","shape","size"],y="_origin";function m(t){return(u.isString(t)||u.isPlainObject(t))&&(t=[t]),u.each(t,function(e,n){u.isObject(e)||(t[n]={type:e})}),t}var x=function(t){r(n,t);var e=n.prototype;function n(e){var n;return n=t.call(this,e)||this,n.viewTheme=n.get("viewTheme"),u.assign(i(i(n)),f,p,d),n.get("container")&&n._initContainer(),n._initOptions(),n}return e.getDefaultCfg=function(){return{_id:null,type:"base",coord:null,attrs:{},view:null,data:[],scales:{},container:null,labelContainer:null,shapeContainer:null,attrOptions:{},styleOptions:null,selectedOptions:null,activedOptions:null,hasDefaultAdjust:!1,adjusts:null,shapeType:null,generatePoints:!1,sortable:!1,labelCfg:null,shareTooltip:!0,tooltipCfg:null,animate:!0,animateCfg:null,visible:!0}},e._initOptions=function(){var t=this.get("adjusts");t&&(t=m(t),this.set("adjusts",t))},e._createScale=function(t,e){var n=this.get("scales"),r=n[t];return r||(r=this.get("view").createScale(t,e),n[t]=r),r},e._setAttrOptions=function(t,e){var n=this.get("attrOptions");n[t]=e},e._createAttrOption=function(t,e,n,r){var i={};i.field=e,n?u.isFunction(n)?i.callback=n:i.values=n:"color"!==t&&(i.values=r),this._setAttrOptions(t,i)},e.position=function(t){return this._setAttrOptions("position",{field:t}),this},e.color=function(t,e){var n=this.viewTheme||l;return this._createAttrOption("color",t,e,n.colors),this},e.size=function(t,e){var n=this.viewTheme||l;return this._createAttrOption("size",t,e,n.sizes),this},e.shape=function(t,e){var n=this.viewTheme||l,r=this.get("type"),i=n.shapes[r]||[];return this._createAttrOption("shape",t,e,i),this},e.opacity=function(t,e){var n=this.viewTheme||l;return this._createAttrOption("opacity",t,e,n.opacities),this},e.style=function(t,e){var n,r=this.get("styleOptions");return r||(r={},this.set("styleOptions",r)),u.isObject(t)&&(e=t,t=null),t&&(n=g(t)),r.fields=n,r.style=e,this},e.label=function(t,e,n){var r,i=this,a=i.get("labelCfg");return a||(a={},i.set("labelCfg",a)),t&&(r=g(t)),a.fields=r,u.isFunction(e)?(n||(n={}),a.callback=e):u.isObject(e)&&(n=e),a.globalCfg=n,this},e.tooltip=function(t,e){var n,r=this.get("tooltipCfg");(r||(r={}),!1===t)?this.set("tooltipCfg",!1):(t&&(n=g(t)),r.fields=n,r.cfg=e);return this.set("tooltipCfg",r),this},e.animate=function(t){return this.set("animateCfg",t),this},e.active=function(t,e){return!1===t?this.set("allowActive",!1):u.isObject(t)?(this.set("allowActive",!0),this.set("activedOptions",t)):(this.set("allowActive",!0),this.set("activedOptions",e)),this},e.adjust=function(t){return this.get("hasDefaultAdjust")||(t&&(t=m(t)),this.set("adjusts",t)),this},e.select=function(t,e){return!1===t?this.set("allowSelect",!1):u.isObject(t)?(this.set("allowSelect",!0),this.set("selectedOptions",t)):(this.set("allowSelect",!0),this.set("selectedOptions",e)),this},e.hasAdjust=function(t){var e=this,n=e.get("adjusts");if(!t)return!1;var r=!1;return u.each(n,function(e){if(e.type===t)return r=!0,!1}),r},e.hasStack=function(){var t=this.get("isStacked");return u.isNil(t)&&(t=this.hasAdjust("stack"),this.set("isStacked",t)),t},e.isInCircle=function(){var t=this.get("coord");return t&&t.isPolar},e._initContainer=function(){var t=this,e=t.get("shapeContainer");if(!e){var n=t.get("container"),r=t.get("view"),i=r&&r.get("_id");e=n.addGroup({viewId:i,visible:t.get("visible")}),t.set("shapeContainer",e)}},e.init=function(){var t=this;if(t._initContainer(),t._initAttrs(),t.get("tooltipCfg")&&t.get("tooltipCfg").fields){var e=t.get("tooltipCfg").fields;u.each(e,function(e){t._createScale(e)})}var n=t._processData();t.get("adjusts")&&t._adjust(n),t.set("dataArray",n)},e._initAttrs=function(){var t=this,e=t.get("attrs"),n=t.get("attrOptions"),r=t.get("coord"),i=t.viewTheme||l,o=!1;for(var s in n)if(n.hasOwnProperty(s)){var c=n[s],h=u.upperFirst(s),f=g(c.field);"position"===s&&(c.coord=r,1===f.length&&"theta"===r.type&&(f.unshift("1"),o=!0));for(var p=[],d=0;d<f.length;d++){var v=f[d],y=t._createScale(v);"color"===s&&u.isNil(c.values)&&(y.values.length<=8?c.values=o?i.colors_pie:i.colors:y.values.length<=16?c.values=o?i.colors_pie_16:i.colors_16:c.values=i.colors_24,u.isNil(c.values)&&(c.values=i.colors)),p.push(y)}if("theta"===r.type&&"position"===s&&p.length>1){var m=p[1];m.change({nice:!1,min:0,max:Math.max.apply(null,m.values)})}c.scales=p;var x=new a[h](c);e[s]=x}},e._processData=function(){for(var t=this,e=this.get("data"),n=[],r=this._groupData(e),i=0;i<r.length;i++){var a=r[i],o=t._saveOrigin(a);t._numberic(o),n.push(o)}return n},e._groupData=function(t){var e=this._getGroupScales(),n=e.map(function(t){return t.field});return u.Array.group(t,n)},e._saveOrigin=function(t){for(var e=[],n=0;n<t.length;n++){var r=t[n],i={};for(var a in r)i[a]=r[a];i[y]=r,e.push(i)}return e},e._numberic=function(t){for(var e=this.getAttr("position"),n=e.scales,r=0;r<t.length;r++)for(var i=t[r],a=0;a<Math.min(2,n.length);a++){var o=n[a];if(o.isCategory){var s=o.field;i[s]=o.translate(i[s])}}},e._getGroupScales=function(){var t=this,e=t.get("groupScales");if(!e){e=[];var n=t.get("attrs");u.each(n,function(t){if(-1!==v.indexOf(t.type)){var n=t.scales;u.each(n,function(t){t.isCategory&&-1===u.indexOf(e,t)&&e.push(t)})}}),t.set("groupScales",e)}return e},e._updateStackRange=function(t,e,n){for(var r=u.Array.merge(n),i=e.min,a=e.max,o=0;o<r.length;o++){var s=r[o],l=Math.min.apply(null,s[t]),c=Math.max.apply(null,s[t]);l<i&&(i=l),c>a&&(a=c)}(i<e.min||a>e.max)&&e.change({min:i,max:a})},e._adjust=function(t){var e=this,n=e.get("adjusts"),r=this.viewTheme||l,i=e.getYScale(),a=e.getXScale(),s=a.field,c=i?i.field:null;u.each(n,function(n){var l=u.mix({xField:s,yField:c},n),h=u.upperFirst(n.type);if("Dodge"===h){var f=[];if(a.isCategory||a.isIdentity)f.push("x");else{if(i)throw new Error("dodge is not support linear attribute, please use category attribute!");f.push("y")}l.adjustNames=f,l.dodgeRatio=r.widthRatio.column}else if("Stack"===h){var p=e.get("coord");if(!i){l.height=p.getHeight();var d=e.getDefaultValue("size")||3;l.size=d}!p.isTransposed&&u.isNil(l.reverseOrder)&&(l.reverseOrder=!0)}var g=new o[h](l);g.processAdjust(t),"Stack"===h&&i&&e._updateStackRange(c,i,t)})},e.setCoord=function(t){this.set("coord",t);var e=this.getAttr("position"),n=this.get("shapeContainer");n.setMatrix(t.matrix),e&&(e.coord=t)},e.paint=function(){var t=this,e=t.get("dataArray"),n=[],r=t.getShapeFactory();r.setCoord(t.get("coord")),t.set("shapeFactory",r);var i=t.get("shapeContainer");t._beforeMapping(e);for(var a=0;a<e.length;a++){var o=e[a],s=a;o=t._mapping(o),n.push(o),t.draw(o,i,r,s)}t.get("labelCfg")&&t._addLabels(u.union.apply(null,n),i.get("children")),t.get("sortable")?t.set("dataArray",n):t._sort(n)},e._sort=function(t){var e=this,n=e.getXScale(),r=n.field;u.each(t,function(t){t.sort(function(t,e){return n.translate(t[y][r])-n.translate(e[y][r])})}),e.set("dataArray",t)},e._beforeMapping=function(t){var e=this;if(e.get("sortable")){var n=e.getXScale(),r=n.field;u.each(t,function(t){t.sort(function(t,e){return n.translate(t[r])-n.translate(e[r])})})}e.get("generatePoints")&&(u.each(t,function(t){e._generatePoints(t)}),u.each(t,function(e,n){var r=t[n+1];r&&(e[0].nextPoints=r[0].points)}))},e._addLabels=function(t,e){var n=this,r=n.get("type"),i=n.get("viewTheme")||l,a=n.get("coord"),o=c.getLabelsClass(a.type,r),s=n.get("container"),h=u.map(n.get("labelCfg").fields,function(t){return n._createScale(t)}),f=s.addGroup(o,{_id:this.get("_id"),labelCfg:u.mix({scales:h},n.get("labelCfg")),coord:a,geom:n,geomType:r,viewTheme:i,visible:n.get("visible")});f.showLabels(t,e),n.set("labelContainer",f)},e.getShapeFactory=function(){var t=this.get("shapeFactory");if(!t){var e=this.get("shapeType");t=h.getShapeFactory(e),this.set("shapeFactory",t)}return t},e._generatePoints=function(t){for(var e=this,n=e.getShapeFactory(),r=e.getAttr("shape"),i=0;i<t.length;i++){var a=t[i],o=e.createShapePointsCfg(a),s=r?e._getAttrValues(r,a):null,u=n.getShapePoints(s,o);a.points=u}},e.createShapePointsCfg=function(t){var e,n=this.getXScale(),r=this.getYScale(),i=this._normalizeValues(t[n.field],n);return e=r?this._normalizeValues(t[r.field],r):t.y?t.y:.1,{x:i,y:e,y0:r?r.scale(this.getYMinValue()):void 0}},e.getYMinValue=function(){var t,e=this.getYScale(),n=e.min,r=e.max;return t=n>=0?n:r<=0?r:0,t},e._normalizeValues=function(t,e){var n=[];if(u.isArray(t))for(var r=0;r<t.length;r++){var i=t[r];n.push(e.scale(i))}else n=e.scale(t);return n},e._mapping=function(t){for(var e=this,n=e.get("attrs"),r=[],i=0;i<t.length;i++){var a=t[i],o={};for(var s in o[y]=a[y],o.points=a.points,o.nextPoints=a.nextPoints,n)if(n.hasOwnProperty(s)){var l=n[s],c=l.names,h=e._getAttrValues(l,a);if(c.length>1)for(var f=0;f<h.length;f++){var p=h[f],d=c[f];o[d]=u.isArray(p)&&1===p.length?p[0]:p}else o[c[0]]=1===h.length?h[0]:h}r.push(o)}return r},e._getAttrValues=function(t,e){for(var n=t.scales,r=[],i=0;i<n.length;i++){var a=n[i],o=a.field;"identity"===a.type?r.push(a.value):r.push(e[o])}var s=t.mapping.apply(t,r);return s},e.getAttrValue=function(t,e){var n=this.getAttr(t),r=null;if(n){var i=this._getAttrValues(n,e);r=i[0]}return r},e.getDefaultValue=function(t){var e=this.get(t),n=this.getAttr(t);if(n){var r=n.getScale(t);"identity"===r.type&&(e=r.value)}return e},e.draw=function(t,e,n,r){for(var i=this,a=0;a<t.length;a++){var o=t[a];i.drawPoint(o,e,n,r+a)}},e.getCallbackCfg=function(t,e,n){if(!t)return e;var r={},i=t.map(function(t){return n[t]});return u.each(e,function(t,e){u.isFunction(t)?r[e]=t.apply(null,i):r[e]=t}),r},e._getShapeId=function(t){var e=this.get("_id"),n=this.get("keyFields");if(n&&n.length>0)u.each(n,function(n){e+="-"+t[n]});else{var r,i=this.get("type"),a=this.getXScale(),o=this.getYScale(),s=a.field||"x",l=o.field||"y",c=t[l];r=a.isIdentity?a.value:t[s],e+="interval"===i||"schema"===i?"-"+r:"line"===i||"area"===i||"path"===i?"-"+i:"-"+r+"-"+c;var h=this._getGroupScales();u.isEmpty(h)||u.each(h,function(n){var r=n.field;"identity"!==n.type&&(e+="-"+t[r])})}return e},e.getDrawCfg=function(t){var e=this,n={origin:t,x:t.x,y:t.y,color:t.color,size:t.size,shape:t.shape,isInCircle:e.isInCircle(),opacity:t.opacity},r=e.get("styleOptions");return r&&r.style&&(n.style=e.getCallbackCfg(r.fields,r.style,t[y])),e.get("generatePoints")&&(n.points=t.points,n.nextPoints=t.nextPoints),e.get("animate")&&(n._id=e._getShapeId(t[y])),n},e.appendShapeInfo=function(t,e){t&&(t.setSilent("index",e),t.setSilent("coord",this.get("coord")),this.get("animate")&&this.get("animateCfg")&&t.setSilent("animateCfg",this.get("animateCfg")))},e._applyViewThemeShapeStyle=function(t,e,n){var r=this,i=r.viewTheme||l,a=n.name;e?e&&(e.indexOf("hollow")>-1||e.indexOf("liquid")>-1)&&(a="hollow"+u.upperFirst(a)):n.defaultShapeType.indexOf("hollow")>-1&&(a="hollow"+u.upperFirst(a));var o=i.shape[a]||{};t.style=u.mix({},o,t.style)},e.drawPoint=function(t,e,n,r){var i=this,a=t.shape,o=i.getDrawCfg(t);i._applyViewThemeShapeStyle(o,a,n);var s=n.drawShape(a,o,e);i.appendShapeInfo(s,r)},e.getAttr=function(t){return this.get("attrs")[t]},e.getXScale=function(){return this.getAttr("position").scales[0]},e.getYScale=function(){return this.getAttr("position").scales[1]},e.getShapes=function(){var t=[],e=this.get("shapeContainer"),n=e.get("children");return u.each(n,function(e){e.get("origin")&&t.push(e)}),t},e.getAttrsForLegend=function(){var t=this.get("attrs"),e=[];return u.each(t,function(t){-1!==v.indexOf(t.type)&&e.push(t)}),e},e.getFieldsForLegend=function(){var t=[],e=this.get("attrOptions");return u.each(v,function(n){var r=e[n];r&&r.field&&u.isString(r.field)&&(t=t.concat(r.field.split("*")))}),u.uniq(t)},e.changeVisible=function(t,e){var n=this;n.set("visible",t);var r=this.get("shapeContainer");r&&r.set("visible",t);var i=this.get("labelContainer");if(i&&i.set("visible",t),!e&&r){var a=r.get("canvas");a.draw()}},e.reset=function(){this.set("attrOptions",{}),this.clearInner()},e.clearInner=function(){this.clearActivedShapes(),this.clearSelected();var t=this.get("shapeContainer");t&&t.clear();var e=this.get("labelContainer");e&&e.remove(),this.set("attrs",{}),this.set("groupScales",null),this.set("labelContainer",null),this.set("xDistance",null),this.set("isStacked",null)},e.clear=function(){this.clearInner(),this.set("scales",{})},e.destroy=function(){this.clear();var e=this.get("shapeContainer");e&&e.remove(),this.offEvents(),t.prototype.destroy.call(this)},e.bindEvents=function(){this.get("view")&&(this._bindActiveAction(),this._bindSelectedAction())},e.offEvents=function(){this.get("view")&&(this._offActiveAction(),this._offSelectedAction())},n}(s);t.exports=x},function(t,e,n){var r=n(0),i=n(25),a=r.PathUtil,o={},s={_coord:null,draw:function(t,e){return this.drawShape?this.drawShape(t,e):null},setCoord:function(t){this._coord=t},parsePath:function(t,e){var n=this._coord;return t=a.parsePathString(t),t=n.isPolar&&!1!==e?i.convertPolarPath(n,t):i.convertNormalPath(n,t),t},parsePoint:function(t){var e=this._coord;return e.convertPoint(t)},parsePoints:function(t){var e=this._coord,n=[];return r.each(t,function(t){n.push(e.convertPoint(t))}),n}},u={defaultShapeType:null,setCoord:function(t){this._coord=t},getShape:function(t){var e=this;r.isArray(t)&&(t=t[0]);var n=e[t]||e[e.defaultShapeType];return n._coord=e._coord,n},getShapePoints:function(t,e){var n=this.getShape(t),r=n.getPoints||n.getShapePoints||this.getDefaultPoints,i=r(e);return i},getDefaultPoints:function(){return[]},getMarkerCfg:function(t,e){var n=this.getShape(t);if(!n.getMarkerCfg){var r=this.defaultShapeType;n=this.getShape(r)}return n.getMarkerCfg(e)},getSelectedCfg:function(){return{}},drawShape:function(t,e,n){var r=this.getShape(t),i=r.draw(e,n);return i&&(i.setSilent("origin",e.origin),i._id=e.yIndex?e._id+e.yIndex:e._id,i.name=this.name),i}};o.registerFactory=function(t,e){var n=r.upperFirst(t),i=r.assign({},u,e);return o[n]=i,i.name=t,i},o.registerShape=function(t,e,n){var i=r.upperFirst(t),a=o[i],u=r.assign({},s,n);return a[e]=u,u},o.getShapeFactory=function(t){var e=this;t=t||"point";var n=r.upperFirst(t);return e[n]},t.exports=o},function(t,e){function n(t,e){for(var n in e)e.hasOwnProperty(n)&&"constructor"!==n&&void 0!==e[n]&&(t[n]=e[n])}var r=function(t,e,r,i){return e&&n(t,e),r&&n(t,r),i&&n(t,i),t};t.exports=r},function(t,e,n){var r=n(16),i=function(t){return r(t,"Number")};t.exports=i},function(t,e,n){"use strict";var r=n(83);n.d(e,"f",function(){return r["h"]}),n.d(e,"e",function(){return r["g"]}),n.d(e,"d",function(){return r["f"]});var i=n(425);n.d(e,"c",function(){return i["b"]}),n.d(e,"b",function(){return i["a"]});var a=n(424);n.d(e,"a",function(){return a["a"]})},function(t,e,n){"use strict";n.d(e,"d",function(){return u}),n.d(e,"a",function(){return l}),n.d(e,"b",function(){return f}),n.d(e,"c",function(){return p}),e["g"]=d,e["e"]=g,e["f"]=v;var r=n(427),i=n(96),a=n.i(r["a"])("start","end","cancel","interrupt"),o=[],s=0,u=1,l=2,c=3,h=4,f=5,p=6;function d(t,e){var n=v(t,e);if(n.state>s)throw new Error("too late; already scheduled");return n}function g(t,e){var n=v(t,e);if(n.state>c)throw new Error("too late; already running");return n}function v(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function y(t,e,r){var a,o=t.__transition;function s(t){r.state=u,r.timer.restart(d,r.delay,r.time),r.delay<=t&&d(t-r.delay)}function d(s){var f,y,m,x;if(r.state!==u)return v();for(f in o)if(x=o[f],x.name===r.name){if(x.state===c)return n.i(i["timeout"])(d);x.state===h?(x.state=p,x.timer.stop(),x.on.call("interrupt",t,t.__data__,x.index,x.group),delete o[f]):+f<e&&(x.state=p,x.timer.stop(),x.on.call("cancel",t,t.__data__,x.index,x.group),delete o[f])}if(n.i(i["timeout"])(function(){r.state===c&&(r.state=h,r.timer.restart(g,r.delay,r.time),g(s))}),r.state=l,r.on.call("start",t,t.__data__,r.index,r.group),r.state===l){for(r.state=c,a=new Array(m=r.tween.length),f=0,y=-1;f<m;++f)(x=r.tween[f].value.call(t,t.__data__,r.index,r.group))&&(a[++y]=x);a.length=y+1}}function g(e){var n=e<r.duration?r.ease.call(null,e/r.duration):(r.timer.restart(v),r.state=f,1),i=-1,o=a.length;while(++i<o)a[i].call(t,n);r.state===f&&(r.on.call("end",t,t.__data__,r.index,r.group),v())}function v(){for(var n in r.state=p,r.timer.stop(),delete o[e],o)return;delete t.__transition}o[e]=r,r.timer=n.i(i["timer"])(s,0,r.time)}e["h"]=function(t,e,n,r,i,u){var l=t.__transition;if(l){if(n in l)return}else t.__transition={};y(t,n,{name:e,index:r,group:i,on:a,tween:o,time:u.time,delay:u.delay,duration:u.duration,ease:u.ease,timer:null,state:s})}},function(t,e,n){var r=n(16),i=function(t){return r(t,"Function")};t.exports=i},function(t,e,n){var r=n(16),i=function(t){return r(t,"String")};t.exports=i},function(t,e){var n={}.toString,r=function(t,e){return n.call(t)==="[object "+e+"]"};t.exports=r},function(t,e,n){"use strict";n.d(e,"c",function(){return D}),e["b"]=F;var r=n(490),i=n(491),a=n(478),o=n(472),s=n(210),u=n(477),l=n(481),c=n(483),h=n(486),f=n(493),p=n(469),d=n(485),g=n(484),v=n(492),y=n(476),m=n(475),x=n(468),b=n(212),_=n(487),w=n(470),M=n(494),S=n(479),C=n(488),k=n(482),A=n(467),P=n(480),I=n(489),T=n(471),O=n(473),E=n(92),L=n(474),D=[null];function F(t,e){this._groups=t,this._parents=e}function R(){return new F([[document.documentElement]],D)}F.prototype=R.prototype={constructor:F,select:r["a"],selectAll:i["a"],filter:a["a"],data:o["a"],enter:s["a"],exit:u["a"],join:l["a"],merge:c["a"],order:h["a"],sort:f["a"],call:p["a"],nodes:d["a"],node:g["a"],size:v["a"],empty:y["a"],each:m["a"],attr:x["a"],style:b["b"],property:_["a"],classed:w["a"],text:M["a"],html:S["a"],raise:C["a"],lower:k["a"],append:A["a"],insert:P["a"],remove:I["a"],clone:T["a"],datum:O["a"],on:E["c"],dispatch:L["a"]},e["a"]=R},function(t,e){t.exports={FONT_FAMILY:'"-apple-system", BlinkMacSystemFont, "Segoe UI", Roboto,"Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",SimSun, "sans-serif"'}},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(3),a=n(102),o=n(34),s=["min","max","median","start","end"],u=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return i.mix({},e,{xScales:null,yScales:null,el:null})},n.render=function(){},n.clear=function(){var t=this,e=t.get("el");e&&e.remove()},n.changeVisible=function(t){var e=this;e.set("visible",t);var n=e.get("el");n&&(n.set?n.set("visible",t):n.style.display=t?"":"none")},n.parsePoint=function(t,e){var n,r,o=this,s=o.get("xScales"),u=o.get("yScales");if(i.isFunction(e)&&(e=e(s,u)),i.isArray(e)&&i.isString(e[0])&&-1!==e[0].indexOf("%"))return this._parsePercentPoint(t,e);if(i.isArray(e))n=o._getNormalizedValue(e[0],a.getFirstScale(s)),r=o._getNormalizedValue(e[1],a.getFirstScale(u));else for(var l in e){var c=e[l];s[l]&&(n=o._getNormalizedValue(c,s[l])),u[l]&&(r=o._getNormalizedValue(c,u[l],"y"))}return i.isNil(n)||i.isNil(r)?void 0:t.convert({x:n,y:r})},n._getNormalizedValue=function(t,e){var n,r;-1!==i.indexOf(s,t)?"start"===t?n=0:"end"===t?n=1:"median"===t?(r=e.isCategory?(e.values.length-1)/2:(e.min+e.max)/2,n=e.scale(r)):(r=e.isCategory?"min"===t?0:e.values.length-1:e[t],n=e.scale(r)):n=e.scale(t);return n},n._parsePercentPoint=function(t,e){var n=parseFloat(e[0])/100,r=parseFloat(e[1])/100,i=t.start,a=t.end,o={x:Math.min(i.x,a.x),y:Math.min(i.y,a.y)},s=t.width*n+o.x,u=t.height*r+o.y;return{x:s,y:u}},e}(o);t.exports=u},function(t,e){var n=function(t){return null!==t&&"function"!==typeof t&&isFinite(t.length)};t.exports=n},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(463);n.d(e,"create",function(){return r["a"]});var i=n(57);n.d(e,"creator",function(){return i["a"]});var a=n(464);n.d(e,"local",function(){return a["a"]});var o=n(208);n.d(e,"matcher",function(){return o["a"]});var s=n(465);n.d(e,"mouse",function(){return s["a"]});var u=n(90);n.d(e,"namespace",function(){return u["a"]});var l=n(91);n.d(e,"namespaces",function(){return l["a"]});var c=n(58);n.d(e,"clientPoint",function(){return c["a"]});var h=n(209);n.d(e,"select",function(){return h["a"]});var f=n(466);n.d(e,"selectAll",function(){return f["a"]});var p=n(17);n.d(e,"selection",function(){return p["a"]});var d=n(93);n.d(e,"selector",function(){return d["a"]});var g=n(213);n.d(e,"selectorAll",function(){return g["a"]});var v=n(212);n.d(e,"style",function(){return v["a"]});var y=n(495);n.d(e,"touch",function(){return y["a"]});var m=n(496);n.d(e,"touches",function(){return m["a"]});var x=n(95);n.d(e,"window",function(){return x["a"]});var b=n(92);n.d(e,"event",function(){return b["a"]}),n.d(e,"customEvent",function(){return b["b"]})},function(t,e,n){var r=n(0),i={splitPoints:function(t){var e=[],n=t.x,i=t.y;return i=r.isArray(i)?i:[i],r.each(i,function(t,i){var a={x:r.isArray(n)?n[i]:n,y:t};e.push(a)}),e},addFillAttrs:function(t,e){e.color&&(t.fill=e.color),r.isNumber(e.opacity)&&(t.opacity=t.fillOpacity=e.opacity)},addStrokeAttrs:function(t,e){e.color&&(t.stroke=e.color),r.isNumber(e.opacity)&&(t.opacity=t.strokeOpacity=e.opacity)}};t.exports=i},function(t,e,n){var r=n(35);t.exports=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),i=n(41),a=u(i),o=n(28),s=u(o);function u(t){return t&&t.__esModule?t:{default:t}}function l(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function c(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!==typeof e&&"function"!==typeof e?t:e}function h(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var f=function(t){function e(t,n){l(this,e);var r=c(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return r.getParentInfo=function(){return{id:r.id,name:r.name}},r.name=n,r}return h(e,t),r(e,[{key:"getChildContext",value:function(){return{addElement:this.context.addElement,updateElement:this.context.updateElement,deleteElement:this.context.deleteElement,createId:this.context.createId,getParentInfo:this.getParentInfo,getViewId:this.context.getViewId}}},{key:"componentWillMount",value:function(){var t=this.context;this.id=t.createId(),t.addElement(this.name,this.id,this.props,t.getParentInfo(),t.getViewId())}},{key:"componentWillReceiveProps",value:function(t){this.context.updateElement(this.name,this.id,t,this.context.getParentInfo(),this.context.getViewId())}},{key:"componentWillUnmount",value:function(){this.context.deleteElement(this.name,this.id)}},{key:"render",value:function(){var t=this.props.children;return t?t.length&&(t=a.default.createElement("div",null,t)):t=null,t}}]),e}(i.Component);function p(t){var e=function(e){function n(e){return l(this,n),c(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,e,t))}return h(n,e),r(n,[{key:"getChildContext",value:function(){return{addElement:this.context.addElement,updateElement:this.context.updateElement,deleteElement:this.context.deleteElement,createId:this.context.createId,getParentInfo:this.getParentInfo,getViewId:this.context.getViewId}}}]),n}(f);return e.contextTypes={addElement:s.default.func,updateElement:s.default.func,deleteElement:s.default.func,createId:s.default.func,getParentInfo:s.default.func,getViewId:s.default.func},e.childContextTypes={addElement:s.default.func,updateElement:s.default.func,deleteElement:s.default.func,createId:s.default.func,getParentInfo:s.default.func,getViewId:s.default.func},e}f.contextTypes={addElement:s.default.func,updateElement:s.default.func,deleteElement:s.default.func,createId:s.default.func,getParentInfo:s.default.func,getViewId:s.default.func},f.childContextTypes={addElement:s.default.func,updateElement:s.default.func,deleteElement:s.default.func,createId:s.default.func,getParentInfo:s.default.func,getViewId:s.default.func},f.generateBaseTypedComponent=p,e.default=f},function(t,e,n){var r=n(0),i=n(308);function a(t,e){if(!t.length)return[];for(var n=[],r=0,i=t.length;r<i;r++){var a=t[r];0===r?n.push(["M",a.x,a.y]):n.push(["L",a.x,a.y])}return e&&n.push(["Z"]),n}function o(t,e){var n=t.getCenter(),r=Math.sqrt(Math.pow(e.x-n.x,2)+Math.pow(e.y-n.y,2));return r}function s(t,e){for(var n=t.length,r=[t[0]],i=1;i<n;i+=2){var a=e.convertPoint({x:t[i],y:t[i+1]});r.push(a.x,a.y)}return r}function u(t,e,n){var r=n.isTransposed,i=n.startAngle,a=n.endAngle,s={x:t[1],y:t[2]},u={x:e[1],y:e[2]},l=[],c=r?"y":"x",h=Math.abs(u[c]-s[c])*(a-i),f=u[c]>=s[c]?1:0,p=h>Math.PI?1:0,d=n.convertPoint(u),g=o(n,d);if(g>=.5)if(h===2*Math.PI){var v={x:(u.x+s.x)/2,y:(u.y+s.y)/2},y=n.convertPoint(v);l.push(["A",g,g,0,p,f,y.x,y.y]),l.push(["A",g,g,0,p,f,d.x,d.y])}else l.push(["A",g,g,0,p,f,d.x,d.y]);return l}function l(t){r.each(t,function(e,n){var r=e;if("a"===r[0].toLowerCase()){var i=t[n-1],a=t[n+1];a&&"a"===a[0].toLowerCase()?i&&"l"===i[0].toLowerCase()&&(i[0]="M"):i&&"a"===i[0].toLowerCase()&&a&&"l"===a[0].toLowerCase()&&(a[0]="M")}})}var c={getLinePath:function(t,e){return a(t,e)},getSplinePath:function(t,e,n){var a=[],o=t[0],s=null;if(t.length<=2)return c.getLinePath(t,e);r.each(t,function(t){s&&s.x===t.x&&s.y===t.y||(a.push(t.x),a.push(t.y),s=t)}),n=n||[[0,0],[1,1]];var u=i.catmullRom2bezier(a,e,n);return u.unshift(["M",o.x,o.y]),u},getPointRadius:function(t,e){var n=o(t,e);return n},getPointAngle:function(t,e){var n=t.getCenter(),r=Math.atan2(e.y-n.y,e.x-n.x);return r},convertNormalPath:function(t,e){var n=[];return r.each(e,function(e){var r=e[0];switch(r.toLowerCase()){case"m":case"l":case"c":n.push(s(e,t));break;case"z":default:n.push(e);break}}),n},convertPolarPath:function(t,e){var n,i,a,o,c=[];return r.each(e,function(r,l){var h=r[0];switch(h.toLowerCase()){case"m":case"c":case"q":c.push(s(r,t));break;case"l":n=e[l-1],i=r,a=t.isTransposed,o=a?n[n.length-2]===i[1]:n[n.length-1]===i[2],o?c=c.concat(u(n,i,t)):c.push(s(r,t));break;case"z":default:c.push(r);break}}),l(c),c}};t.exports=c},function(t,e,n){var r=n(10),i=n(2),a=n(38),o=n(6),s=function(){var t=e.prototype;function e(t){this._initDefaultCfg(),r(this,t),this.init()}return t._initDefaultCfg=function(){this.type="base",this.formatter=null,this.range=[0,1],this.ticks=null,this.values=[]},t.init=function(){},t.getTicks=function(){var t=this,e=t.ticks,n=[];return i(e,function(e){var r;r=a(e)?e:{text:t.getText(e),tickValue:e,value:t.scale(e)},n.push(r)}),n},t.getText=function(t,e){var n=this.formatter;return t=n?n(t,e):t,!o(t)&&t.toString||(t=""),t.toString()},t.rangeMin=function(){return this.range[0]},t.rangeMax=function(){var t=this.range;return t[t.length-1]},t.invert=function(t){return t},t.translate=function(t){return t},t.scale=function(t){return t},t.clone=function(){var t=this,e=t.constructor,n={};return i(t,function(e,r){n[r]=t[r]}),new e(n)},t.change=function(t){return this.ticks=null,r(this,t),this.init(),this},e}();t.exports=s},function(t,e,n){"use strict";e["b"]=M,e["a"]=S,e["c"]=C;var r=n(21),i=n(504),a=n(505),o=n(506),s=n(507),u=n(508),l=n(510),c=n(511),h=n(512),f=n(513),p=n(514),d=n(515),g=n(516),v=n(517),y=n(518),m=n(519),x=n(520),b=n(59),_=n(509),w=0;function M(t,e,n,r){this._groups=t,this._parents=e,this._name=n,this._id=r}function S(t){return n.i(r["selection"])().transition(t)}function C(){return++w}var k=r["selection"].prototype;M.prototype=S.prototype={constructor:M,select:p["a"],selectAll:d["a"],filter:l["a"],merge:c["a"],selection:g["a"],transition:x["a"],call:k.call,nodes:k.nodes,node:k.node,size:k.size,empty:k.empty,each:k.each,on:h["a"],attr:i["a"],attrTween:a["a"],style:v["a"],styleTween:y["a"],text:m["a"],remove:f["a"],tween:b["a"],delay:o["a"],duration:s["a"],ease:u["a"],end:_["a"]}},function(t,e,n){var r=n(218),i=!0;t.exports=n(524)(r.isElement,i)},function(t,e,n){t.exports={Axis:n(234),Component:n(62),Guide:n(242),Label:n(246),Legend:n(252),Tooltip:n(257)}},function(t,e,n){"use strict";e["b"]=o,e["c"]=s,e["a"]=u;var r=n(203);function i(t,e){return function(n){return t+n*e}}function a(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}function o(t,e){var a=e-t;return a?i(t,a>180||a<-180?a-360*Math.round(a/360):a):n.i(r["a"])(isNaN(t)?e:t)}function s(t){return 1===(t=+t)?u:function(e,i){return i-e?a(e,i,t):n.i(r["a"])(isNaN(e)?i:e)}}function u(t,e){var a=e-t;return a?i(t,a):n.i(r["a"])(isNaN(t)?e:t)}},function(t,e,n){var r=n(10),i=function(){var t=e.prototype;function e(t){this._initDefaultCfg(),r(this,t)}return t._initDefaultCfg=function(){this.adjustNames=["x","y"]},t.processAdjust=function(){},e}();t.exports=i},function(t,e,n){var r=n(15),i=n(4),a=n(6),o=n(10),s=n(2);function u(t,e){return r(e)?e:t.invert(t.scale(e))}var l=function(){function t(t){var e=this;this.type="base",this.name=null,this.method=null,this.values=[],this.scales=[],this.linear=null;var n=null,r=this.callback;if(t.callback){var i=t.callback;n=function(){for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];var s=i.apply(void 0,n);return a(s)&&(s=r.apply(e,n)),s}}o(this,t),n&&o(this,{callback:n})}var e=t.prototype;return e._getAttrValue=function(t,e){var n=this.values;if(t.isCategory&&!this.linear){var r=t.translate(e);return n[r%n.length]}var i=t.scale(e);return this.getLinearValue(i)},e.getLinearValue=function(t){var e=this.values,n=e.length-1,r=Math.floor(n*t),i=n*t-r,a=e[r],o=r===n?a:e[r+1],s=a+(o-a)*i;return s},e.callback=function(t){var e=this,n=e.scales[0],r=null;return r="identity"===n.type?n.value:e._getAttrValue(n,t),r},e.getNames=function(){for(var t=this.scales,e=this.names,n=Math.min(t.length,e.length),r=[],i=0;i<n;i++)r.push(e[i]);return r},e.getFields=function(){var t=this.scales,e=[];return s(t,function(t){e.push(t.field)}),e},e.getScale=function(t){var e=this.scales,n=this.names,r=n.indexOf(t);return e[r]},e.mapping=function(){for(var t=this.scales,e=this.callback,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];var a=r;if(e){for(var o=0,s=r.length;o<s;o++)r[o]=this._toOriginParam(r[o],t[o]);a=e.apply(this,r)}return a=[].concat(a),a},e._toOriginParam=function(t,e){var n=t;if(!e.isLinear)if(i(t)){n=[];for(var r=0,a=t.length;r<a;r++)n.push(u(e,t[r]))}else n=u(e,t);return n},t}();t.exports=l},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(34),a=n(3),o=n(101),s=n(103),u=n(18),l=u.FONT_FAMILY,c=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return a.mix({},e,{_id:null,zIndex:4,ticks:null,line:null,tickLine:null,subTickCount:0,subTickLine:null,grid:null,label:{offset:0,offsetX:0,offsetY:0,textStyle:{},autoRotate:!0,autoHide:!1,formatter:null},labelItems:[],title:{autoRotate:!0,textStyle:{}},autoPaint:!0})},n.beforeRender=function(){var t=this,e=t.get("title"),n=t.get("label"),r=t.get("grid");e&&t.set("title",a.deepMix({autoRotate:!0,textStyle:{fontSize:12,fill:"#ccc",textBaseline:"middle",fontFamily:l,textAlign:"center"},offset:48},e)),n&&t.set("label",a.deepMix({autoRotate:!0,autoHide:!0,textStyle:{fontSize:12,fill:"#ccc",textBaseline:"middle",fontFamily:l},offset:10},n)),r&&t.set("grid",a.deepMix({lineStyle:{lineWidth:1,stroke:"#C0D0E0"}},r))},n.render=function(){var t=this;t.beforeRender();var e=t.get("label");e&&t.renderLabels(),t.get("autoPaint")&&t.paint(),a.isNil(t.get("title"))||t.renderTitle(),t.get("group").sort()},n.renderLabels=function(){var t=this,e=t.get("group"),n=t.get("label"),r=new s;t.set("labelRenderer",r),r.set("labelCfg",n);var i=["formatter","htmlTemplate","labelLine","textStyle","useHtml"];a.each(i,function(t){n[t]&&r.set(t,n[t])}),r.set("coord",t.get("coord")),r.set("group",e.addGroup()),r.set("canvas",t.get("canvas"))},n._parseTicks=function(t){t=t||[];for(var e=t.length,n=0;n<e;n++){var r=t[n];a.isObject(r)||(t[n]=this.parseTick(r,n,e))}return this.set("ticks",t),t},n._addTickItem=function(t,e,n,r){void 0===r&&(r="");var i=this.get("tickItems"),a=this.get("subTickItems"),o=this.getTickEnd(e,n,t),s={x1:e.x,y1:e.y,x2:o.x,y2:o.y};i||(i=[]),a||(a=[]),"sub"===r?a.push(s):i.push(s),this.set("tickItems",i),this.set("subTickItems",a)},n._renderLine=function(){var t,e=this,n=e.get("line");if(n){t=e.getLinePath(),n=a.mix({path:t},n);var r=e.get("group"),i=r.addShape("path",{attrs:n});i.name="axis-line",e.get("appendInfo")&&i.setSilent("appendInfo",e.get("appendInfo")),e.set("lineShape",i)}},n._processCatTicks=function(){var t=this,e=t.get("label"),n=t.get("tickLine"),r=t.get("ticks");r=t._parseTicks(r);for(var i=t._getNormalizedTicks(r),a=0;a<i.length;a+=3){var o=t.getTickPoint(i[a]),s=t.getTickPoint(i[a+1]),u=t.getTickPoint(i[a+2]),l=Math.floor(a/3),c=r[l];n&&(0===l&&t._addTickItem(l,s,n.length),t._addTickItem(l,u,n.length)),e&&t.addLabel(c,o,l)}},n._getNormalizedTicks=function(t){var e=0;t.length>1&&(e=(t[1].value-t[0].value)/2);for(var n=[],r=0;r<t.length;r++){var i=t[r],o=i.value,s=i.value-e,u=i.value+e;n.push(o,s,u)}var l=a.arrayUtil.getRange(n);return n.map(function(t){var e=(t-l.min)/(l.max-l.min);return e})},n.addLabel=function(t,e,n){var r,i=this,o=i.get("labelItems"),s=i.get("labelRenderer"),u=a.deepMix({},i.get("label"));if(s){var l=i.get("_labelOffset");a.isNil(i.get("label").offset)||(l=i.get("label").offset);var c=i.getSideVector(l,e,n);e={x:e.x+c[0]+u.offsetX,y:e.y+c[1]+u.offsetY},u.text=t.text,u.x=e.x,u.y=e.y,u.point=e,u.textAlign=i.getTextAnchor(c),e.rotate&&(u.rotate=e.rotate),o.push(u)}return r},n._processTicks=function(){var t=this,e=t.get("label"),n=t.get("subTickCount"),r=t.get("tickLine"),i=t.get("ticks");if(i=t._parseTicks(i),a.each(i,function(n,i){var a=t.getTickPoint(n.value,i);r&&t._addTickItem(i,a,r.length),e&&t.addLabel(n,a,i)}),n){var o=t.get("subTickLine");a.each(i,function(e,a){if(a>0){var s=e.value-i[a-1].value;s/=t.get("subTickCount")+1;for(var u=1;u<=n;u++){var l={text:"",value:a?i[a-1].value+u*s:u*s},c=t.getTickPoint(l.value),h=void 0;h=o&&o.length?o.length:parseInt(.6*r.length,10),t._addTickItem(u-1,c,h,"sub")}}})}},n._addTickLine=function(t,e){var n=this,r=a.mix({},e),i=[];a.each(t,function(t){i.push(["M",t.x1,t.y1]),i.push(["L",t.x2,t.y2])}),delete r.length,r.path=i;var o=n.get("group"),s=o.addShape("path",{attrs:r});s.name="axis-ticks",s._id=n.get("_id")+"-ticks",s.set("coord",n.get("coord")),n.get("appendInfo")&&s.setSilent("appendInfo",n.get("appendInfo"))},n._renderTicks=function(){var t=this,e=t.get("tickItems"),n=t.get("subTickItems");if(!a.isEmpty(e)){var r=t.get("tickLine");t._addTickLine(e,r)}if(!a.isEmpty(n)){var i=t.get("subTickLine")||t.get("tickLine");t._addTickLine(n,i)}},n._renderGrid=function(){var t=this.get("grid");if(t){t.coord=this.get("coord"),t.appendInfo=this.get("appendInfo");var e=this.get("group");this.set("gridGroup",e.addGroup(o,t))}},n._renderLabels=function(){var t=this,e=t.get("labelRenderer"),n=t.get("labelItems");e&&(e.set("items",n),e._dryDraw())},n.paint=function(){var t=this,e=t.get("tickLine"),n=!0;e&&e.hasOwnProperty("alignWithLabel")&&(n=e.alignWithLabel),t._renderLine();var r=t.get("type"),i="cat"===r||"timeCat"===r;i&&!1===n?t._processCatTicks():t._processTicks(),t._renderTicks(),t._renderGrid(),t._renderLabels();var a=this.get("label");a&&a.autoRotate&&t.autoRotateLabels(),a&&a.autoHide&&t.autoHideLabels()},n.parseTick=function(t,e,n){return{text:t,value:e/(n-1)}},n.getTextAnchor=function(t){var e,n=Math.abs(t[1]/t[0]);return e=n>=1?"center":t[0]>0?"start":"end",e},n.getMaxLabelWidth=function(t){var e=t.getLabels(),n=0;return a.each(e,function(t){var e=t.getBBox(),r=e.width;n<r&&(n=r)}),n},n.getMaxLabelHeight=function(t){var e=t.getLabels(),n=0;return a.each(e,function(t){var e=t.getBBox(),r=e.height;n<r&&(n=r)}),n},n.destroy=function(){var e=this;if(!e.destroyed){t.prototype.destroy.call(this);var n=e.get("gridGroup");n&&n.remove();var r=this.get("labelRenderer");r&&r.destroy();var i=e.get("group");i.destroy(),e.destroyed=!0}},n.clear=function(){var t=this,e=t.get("group");if(!e.get("destroyed")&&e.get("children").length){var n=t.get("gridGroup");n&&n.clear();var r=this.get("labelRenderer");r&&r.clear();var i=t.get("group");i.clear()}},n.autoRotateLabels=function(){},n.autoHideLabels=function(){},n.renderTitle=function(){},n.getLinePath=function(){},n.getTickPoint=function(){},n.getTickEnd=function(){},n.getSideVector=function(){},e}(i);t.exports=c},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(62),a=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.getDefaultCfg=function(){return{_id:null,canvas:null,container:null,group:null,capture:!1,coord:null,offset:[0,0],plotRange:null,position:[0,0],visible:!0,zIndex:1}},n._init=function(){},n.clear=function(){},n.destroy=function(){},n.beforeRender=function(){},n.render=function(){},n.afterRender=function(){},n.beforeDraw=function(){},n.draw=function(){},n.afterDraw=function(){},n.show=function(){},n.hide=function(){},n.setOffset=function(){},n.setPosition=function(){},n.setVisible=function(){},n.setZIndex=function(){},e}(i);t.exports=a},function(t,e,n){t.exports={Canvas:n(312),Group:n(127),Shape:n(7),Arc:n(129),Circle:n(130),Dom:n(131),Ellipse:n(132),Fan:n(133),Image:n(134),Line:n(135),Marker:n(68),Path:n(138),Polygon:n(139),Polyline:n(140),Rect:n(141),Text:n(142),PathSegment:n(47),PathUtil:n(71),Event:n(128),version:"3.3.6"}},function(t,e,n){var r=n(1),i=/[MLHVQTCSAZ]([^MLHVQTCSAZ]*)/gi,a=/[^\s\,]+/gi,o={};t.exports={parseRadius:function(t){var e=0,n=0,i=0,a=0;return r.isArray(t)?1===t.length?e=n=i=a=t[0]:2===t.length?(e=i=t[0],n=a=t[1]):3===t.length?(e=t[0],n=a=t[1],i=t[2]):(e=t[0],n=t[1],i=t[2],a=t[3]):e=n=i=a=t,{r1:e,r2:n,r3:i,r4:a}},parsePath:function(t){return t=t||[],r.isArray(t)?t:r.isString(t)?(t=t.match(i),r.each(t,function(e,n){if(e=e.match(a),e[0].length>1){var i=e[0].charAt(0);e.splice(1,0,e[0].substr(1)),e[0]=i}r.each(e,function(t,n){isNaN(t)||(e[n]=+t)}),t[n]=e}),t):void 0},numberToColor:function(t){var e=o[t];if(!e){for(var n=t.toString(16),r=n.length;r<6;r++)n="0"+n;e="#"+n,o[t]=e}return e}}},function(t,e,n){var r=n(6);function i(t){return r(t)?"":t.toString()}t.exports=i},function(t,e){var n="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r=function(t){var e="undefined"===typeof t?"undefined":n(t);return null!==t&&"object"===e||"function"===e};t.exports=r},function(t,e,n){var r=n(80),i=n(16),a=function(t){if(!r(t)||!i(t,"Object"))return!1;if(null===Object.getPrototypeOf(t))return!0;var e=t;while(null!==Object.getPrototypeOf(e))e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e};t.exports=a},function(t,e,n){"use strict";e["b"]=o,e["c"]=s,e["a"]=u;var r=n(196);function i(t,e){return function(n){return t+n*e}}function a(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}function o(t,e){var a=e-t;return a?i(t,a>180||a<-180?a-360*Math.round(a/360):a):n.i(r["a"])(isNaN(t)?e:t)}function s(t){return 1===(t=+t)?u:function(e,i){return i-e?a(e,i,t):n.i(r["a"])(isNaN(e)?i:e)}}function u(t,e){var a=e-t;return a?i(t,a):n.i(r["a"])(isNaN(t)?e:t)}},function(e,n){e.exports=t},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function a(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t}var o=n(52),s=n(10),u=o.mat3,l=o.vec3,c=function(){function t(e){r(this,t);var n=this.getDefaultCfg();s(this,n,e),this.init()}return a(t,[{key:"getDefaultCfg",value:function(){return{isTransposed:!1,matrix:[1,0,0,0,1,0,0,0,1]}}}]),a(t,[{key:"init",value:function(){var t=this.start,e=this.end,n={x:(t.x+e.x)/2,y:(t.y+e.y)/2};this.center=n,this.width=Math.abs(e.x-t.x),this.height=Math.abs(e.y-t.y)}},{key:"_swapDim",value:function(t){var e=this[t];if(e){var n=e.start;e.start=e.end,e.end=n}}},{key:"getCenter",value:function(){return this.center}},{key:"getWidth",value:function(){return this.width}},{key:"getHeight",value:function(){return this.height}},{key:"convertDim",value:function(t,e){var n=this[e],r=n.start,i=n.end;return r+t*(i-r)}},{key:"invertDim",value:function(t,e){var n=this[e],r=n.start,i=n.end;return(t-r)/(i-r)}},{key:"convertPoint",value:function(t){return t}},{key:"invertPoint",value:function(t){return t}},{key:"applyMatrix",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=this.matrix,i=[t,e,n];return l.transformMat3(i,i,r),i}},{key:"invertMatrix",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=this.matrix,i=u.invert([],r),a=[t,e,n];return l.transformMat3(a,a,i),a}},{key:"convert",value:function(t){var e=this.convertPoint(t),n=e.x,r=e.y,i=this.applyMatrix(n,r,1);return{x:i[0],y:i[1]}}},{key:"invert",value:function(t){var e=this.invertMatrix(t.x,t.y,1);return this.invertPoint({x:e[0],y:e[1]})}},{key:"rotate",value:function(t){var e=this.matrix,n=this.center;return u.translate(e,e,[-n.x,-n.y]),u.rotate(e,e,t),u.translate(e,e,[n.x,n.y]),this}},{key:"reflect",value:function(t){switch(t){case"x":this._swapDim("x");break;case"y":this._swapDim("y");break;default:this._swapDim("y")}return this}},{key:"scale",value:function(t,e){var n=this.matrix,r=this.center;return u.translate(n,n,[-r.x,-r.y]),u.scale(n,n,[t,e]),u.translate(n,n,[r.x,r.y]),this}},{key:"translate",value:function(t,e){var n=this.matrix;return u.translate(n,n,[t,e]),this}},{key:"transpose",value:function(){return this.isTransposed=!this.isTransposed,this}}]),t}();t.exports=c},function(t,e,n){var r=n(5),i=n(0),a=i.assign,o=i.isNil,s=i.isArray,u=i.cloneDeep,l=i.wrapBehavior,c=i.getWrapBehavior,h=function(){var t=e.prototype;function e(t){var e=this.getDefaultCfg();a(this,e,t),this.init()}return t.getDefaultCfg=function(){return{chart:null,group:null,showTitle:!0,autoSetAxis:!0,padding:10,eachView:null,fields:[],colTitle:{offsetY:-15,style:{fontSize:14,textAlign:"center",fill:"#666",fontFamily:r.fontFamily}},rowTitle:{offsetX:15,style:{fontSize:14,textAlign:"center",rotate:90,fill:"#666",fontFamily:r.fontFamily}}}},t.init=function(){if(!this.chart)throw new Error("Facets Error: please specify the chart!");this._bindEvent(),this.initContainer(),this.chart.get("data")&&this.initViews()},t.initContainer=function(){var t=this.chart,e=t.get("frontPlot"),n=e.addGroup();this.group=n},t.initViews=function(){for(var t=this.chart,e=t.get("data"),n=this.eachView,r=this.generateFacets(e),i=0;i<r.length;i++){var a=r[i],o=a.region,s=t.view({start:o.start,end:o.end,padding:this.padding});s.source(a.data),this.beforeProcessView(s,a),n&&n(s,a),this.afterProcessView(s,a),a.view=s}this.facets=r},t.beforeProcessView=function(){},t.afterProcessView=function(t,e){this.autoSetAxis&&this.processAxis(t,e)},t.processAxis=function(t,e){var n=t.get("options"),r=t.get("geoms");if((!n.coord.type||"rect"===n.coord.type)&&r.length){var i=r[0].get("attrOptions").position.field,a=s(i)?i:i.split("*").map(function(t){return t.trim()}),u=a[0],l=a[1];o(n.axes)&&(n.axes={});var c=n.axes;!1!==c&&(u&&!1!==c[u]&&(c[u]=c[u]||{},this.setXAxis(u,c,e)),l&&!1!==c[l]&&(c[l]=c[l]||{},this.setYAxis(l,c,e)))}},t.setXAxis=function(){},t.setYAxis=function(){},t.renderTitle=function(t,e){this.drawColTitle(t,e)},t.getScaleText=function(t,e,n){var r;if(t){var i=n.get("scales"),a=i[t];a||(a=n.createScale(t)),r=a.getText(e)}else r=e;return r},t.drawColTitle=function(t,e){var n=this.getScaleText(e.colField,e.colValue,t),r=a({position:["50%","0%"],content:n},this.colTitle);t.guide().text(r)},t.drawRowTitle=function(t,e){var n=this.getScaleText(e.rowField,e.rowValue,t),r=a({position:["100%","50%"],content:n},u(this.rowTitle));t.guide().text(r)},t.getFilter=function(t){var e=function(e){var n=!0;return t.forEach(function(t){var r=t.field,i=t.value,a=!0;!o(i)&&r&&(a=e[r]===i),n=n&&a}),n};return e},t.getFieldValues=function(t,e){for(var n=[],r={},i=0;i<e.length;i++){var a=e[i],s=a[t];o(s)||r[s]||(n.push(s),r[s]=!0)}return n},t.getRegion=function(t,e,n,r){var i=1/e,a=1/t,o={x:i*n,y:a*r},s={x:o.x+i,y:o.y+a};return{start:o,end:s}},t.generateFacets=function(){return[]},t._bindEvent=function(){var t=this.chart;t.on("afterchangedata",l(this,"onDataChange")),t.on("beforeclear",l(this,"onClear")),t.on("beforedestroy",l(this,"destroy")),t.on("beforepaint",l(this,"onPaint")),t.on("setdata",l(this,"onDataChange"))},t._clearEvent=function(){var t=this.chart;t&&(t.off("afterchangedata",c(this,"onDataChange")),t.off("beforeclear",c(this,"onClear")),t.off("beforedestroy",c(this,"destroy")),t.off("beforepaint",c(this,"onPaint")),t.off("setdata",c(this,"onDataChange")))},t._clearFacets=function(){var t=this.facets,e=this.chart;if(t)for(var n=0;n<t.length;n++){var r=t[n];e.removeView(r.view)}this.facets=null},t.onClear=function(){this.onRemove()},t.onPaint=function(){if(this.showTitle)for(var t=this.facets,e=0;e<t.length;e++){var n=t[e],r=n.view;this.renderTitle(r,n)}},t.onDataChange=function(){this._clearFacets(),this.initViews()},t.onRemove=function(){this._clearFacets(),this._clearEvent(),this.group&&this.group.remove(),this.chart=null,this.facets=null,this.group=null},t.destroy=function(){this.onRemove(),this.destroyed=!0},e}();t.exports=h},function(t,e,n){var r=n(1);function i(t,e,n,r){return{x:Math.cos(r)*n+t,y:Math.sin(r)*n+e}}function a(t,e,n,r){var i,a;return r?t<e?(i=e-t,a=2*Math.PI-n+t):t>n&&(i=2*Math.PI-t+e,a=t-n):(i=t-e,a=n-t),i>a?n:e}function o(t,e,n,i){var o=0;return n-e>=2*Math.PI&&(o=2*Math.PI),e=r.mod(e,2*Math.PI),n=r.mod(n,2*Math.PI)+o,t=r.mod(t,2*Math.PI),i?e>=n?t>n&&t<e?t:a(t,n,e,!0):t<e||t>n?t:a(t,e,n):e<=n?e<t&&t<n?t:a(t,e,n,!0):t>e||t<n?t:a(t,n,e)}function s(t,e,n,i,a,s,u,l,c){var h=[u,l],f=[t,e],p=[1,0],d=r.vec2.subtract([],h,f),g=r.vec2.angleTo(p,d);g=o(g,i,a,s);var v=[n*Math.cos(g)+t,n*Math.sin(g)+e];c&&(c.x=v[0],c.y=v[1]);var y=r.vec2.distance(v,h);return y}function u(t,e,n,a,s,u){var l=0,c=Math.PI/2,h=Math.PI,f=3*Math.PI/2,p=[],d=o(l,a,s,u);d===l&&p.push(i(t,e,n,l)),d=o(c,a,s,u),d===c&&p.push(i(t,e,n,c)),d=o(h,a,s,u),d===h&&p.push(i(t,e,n,h)),d=o(f,a,s,u),d===f&&p.push(i(t,e,n,f)),p.push(i(t,e,n,a)),p.push(i(t,e,n,s));var g=1/0,v=-1/0,y=1/0,m=-1/0;return r.each(p,function(t){g>t.x&&(g=t.x),v<t.x&&(v=t.x),y>t.y&&(y=t.y),m<t.y&&(m=t.y)}),{minX:g,minY:y,maxX:v,maxY:m}}t.exports={nearAngle:o,projectPoint:function(t,e,n,r,i,a,o,u){var l={};return s(t,e,n,r,i,a,o,u,l),l},pointDistance:s,box:u}},function(t,e,n){var r=n(1).vec2;t.exports={at:function(t,e,n){return(e-t)*n+t},pointDistance:function(t,e,n,i,a,o){var s=[n-t,i-e];if(r.exactEquals(s,[0,0]))return NaN;var u=[-s[1],s[0]];r.normalize(u,u);var l=[a-t,o-e];return Math.abs(r.dot(l,u))},box:function(t,e,n,r,i){var a=i/2,o=Math.min(t,n),s=Math.max(t,n),u=Math.min(e,r),l=Math.max(e,r);return{minX:o-a,minY:u-a,maxX:s+a,maxY:l+a}},len:function(t,e,n,r){return Math.sqrt((n-t)*(n-t)+(r-e)*(r-e))}}},function(t,e,n){var r=n(36),i=n(47),a=Math.PI,o=Math.sin,s=Math.cos,u=Math.atan2,l=10,c=a/3;function h(t,e,n,r,i,h,f){var p,d,g,v,y,m,x;if(!e.fill){var b=e.arrowLength||l,_=e.arrowAngle?e.arrowAngle*a/180:c;x=u(r-h,n-i),y=Math.abs(e.lineWidth*s(x))/2,m=Math.abs(e.lineWidth*o(x))/2,f&&(y=-y,m=-m),p=i+b*s(x+_/2),d=h+b*o(x+_/2),g=i+b*s(x-_/2),v=h+b*o(x-_/2),t.beginPath(),t.moveTo(p-y,d-m),t.lineTo(i-y,h-m),t.lineTo(g-y,v-m),t.moveTo(i-y,h-m),t.lineTo(i+y,h+m),t.moveTo(i,h),t.stroke()}}function f(t){var e,n=[],a=r.parsePath(t.path);if(!Array.isArray(a)||0===a.length||"M"!==a[0][0]&&"m"!==a[0][0])return!1;for(var o=a.length,s=0;s<a.length;s++){var u=a[s];e=new i(u,e,s===o-1),n.push(e)}return n}function p(t,e,n,r,i,a,o){var s=o?e.startArrow:e.endArrow,u=s.d,l=0,c=i-n,h=a-r,p=Math.atan(c/h);0===h&&c<0?l=Math.PI:c>0&&h>0?l=Math.PI/2-p:c<0&&h<0?l=-Math.PI/2-p:c>=0&&h<0?l=-p-Math.PI/2:c<=0&&h>0&&(l=Math.PI/2-p);var d=f(s);if(d){u&&(o?(i+=Math.sin(Math.abs(p))*u,a=a+Math.cos(Math.abs(p))*u-.5*t.lineWidth):(i-=Math.sin(Math.abs(p))*u,a=a-Math.cos(Math.abs(p))*u+.5*t.lineWidth)),t.save(),t.beginPath(),t.translate(i,a),t.rotate(l);for(var g=0;g<d.length;g++)d[g].draw(t);t.setTransform(1,0,0,1,0,0),t.fillStyle=t.strokeStyle,t.fill(),t.restore()}}t.exports={addStartArrow:function(t,e,n,r,i,a){"object"===typeof e.startArrow?p(t,e,n,r,i,a,!0):e.startArrow&&h(t,e,n,r,i,a,!0)},addEndArrow:function(t,e,n,r,i,a){"object"===typeof e.endArrow?p(t,e,n,r,i,a,!1):e.endArrow&&h(t,e,n,r,i,a,!1)}}},function(t,e,n){var r=n(1),i=n(70),a=n(69),o=n(137),s=n(136),u=r.vec3,l=r.mat3,c=["m","l","c","a","q","h","v","t","s","z"];function h(t,e,n){return{x:n.x+t,y:n.y+e}}function f(t,e){return{x:e.x+(e.x-t.x),y:e.y+(e.y-t.y)}}function p(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function d(t,e){return(t[0]*e[0]+t[1]*e[1])/(p(t)*p(e))}function g(t,e){return(t[0]*e[1]<t[1]*e[0]?-1:1)*Math.acos(d(t,e))}function v(t,e,n,i,a,o,s){var u=r.mod(r.toRadian(s),2*Math.PI),l=t.x,c=t.y,h=e.x,f=e.y,p=Math.cos(u)*(l-h)/2+Math.sin(u)*(c-f)/2,v=-1*Math.sin(u)*(l-h)/2+Math.cos(u)*(c-f)/2,y=p*p/(a*a)+v*v/(o*o);y>1&&(a*=Math.sqrt(y),o*=Math.sqrt(y));var m=a*a*(v*v)+o*o*(p*p),x=Math.sqrt((a*a*(o*o)-m)/m);n===i&&(x*=-1),isNaN(x)&&(x=0);var b=x*a*v/o,_=x*-o*p/a,w=(l+h)/2+Math.cos(u)*b-Math.sin(u)*_,M=(c+f)/2+Math.sin(u)*b+Math.cos(u)*_,S=g([1,0],[(p-b)/a,(v-_)/o]),C=[(p-b)/a,(v-_)/o],k=[(-1*p-b)/a,(-1*v-_)/o],A=g(C,k);return d(C,k)<=-1&&(A=Math.PI),d(C,k)>=1&&(A=0),0===i&&A>0&&(A-=2*Math.PI),1===i&&A<0&&(A+=2*Math.PI),[t,w,M,a,o,S,A,u,i]}var y=function(t,e,n){this.preSegment=e,this.isLast=n,this.init(t,e)};r.augment(y,{init:function(t,e){var n=t[0];e=e||{endPoint:{x:0,y:0}};var i,a,o,s,u=c.indexOf(n)>=0,l=u?n.toUpperCase():n,p=t,d=e.endPoint,g=p[1],y=p[2];switch(l){default:break;case"M":s=u?h(g,y,d):{x:g,y:y},this.command="M",this.params=[d,s],this.subStart=s,this.endPoint=s;break;case"L":s=u?h(g,y,d):{x:g,y:y},this.command="L",this.params=[d,s],this.subStart=e.subStart,this.endPoint=s,this.endTangent=function(){return[s.x-d.x,s.y-d.y]},this.startTangent=function(){return[d.x-s.x,d.y-s.y]};break;case"H":s=u?h(g,0,d):{x:g,y:d.y},this.command="L",this.params=[d,s],this.subStart=e.subStart,this.endPoint=s,this.endTangent=function(){return[s.x-d.x,s.y-d.y]},this.startTangent=function(){return[d.x-s.x,d.y-s.y]};break;case"V":s=u?h(0,g,d):{x:d.x,y:g},this.command="L",this.params=[d,s],this.subStart=e.subStart,this.endPoint=s,this.endTangent=function(){return[s.x-d.x,s.y-d.y]},this.startTangent=function(){return[d.x-s.x,d.y-s.y]};break;case"Q":u?(i=h(g,y,d),a=h(p[3],p[4],d)):(i={x:g,y:y},a={x:p[3],y:p[4]}),this.command="Q",this.params=[d,i,a],this.subStart=e.subStart,this.endPoint=a,this.endTangent=function(){return[a.x-i.x,a.y-i.y]},this.startTangent=function(){return[d.x-i.x,d.y-i.y]};break;case"T":a=u?h(g,y,d):{x:g,y:y},"Q"===e.command?(i=f(e.params[1],d),this.command="Q",this.params=[d,i,a],this.subStart=e.subStart,this.endPoint=a,this.endTangent=function(){return[a.x-i.x,a.y-i.y]},this.startTangent=function(){return[d.x-i.x,d.y-i.y]}):(this.command="TL",this.params=[d,a],this.subStart=e.subStart,this.endPoint=a,this.endTangent=function(){return[a.x-d.x,a.y-d.y]},this.startTangent=function(){return[d.x-a.x,d.y-a.y]});break;case"C":u?(i=h(g,y,d),a=h(p[3],p[4],d),o=h(p[5],p[6],d)):(i={x:g,y:y},a={x:p[3],y:p[4]},o={x:p[5],y:p[6]}),this.command="C",this.params=[d,i,a,o],this.subStart=e.subStart,this.endPoint=o,this.endTangent=function(){return[o.x-a.x,o.y-a.y]},this.startTangent=function(){return[d.x-i.x,d.y-i.y]};break;case"S":u?(a=h(g,y,d),o=h(p[3],p[4],d)):(a={x:g,y:y},o={x:p[3],y:p[4]}),"C"===e.command?(i=f(e.params[2],d),this.command="C",this.params=[d,i,a,o],this.subStart=e.subStart,this.endPoint=o,this.endTangent=function(){return[o.x-a.x,o.y-a.y]},this.startTangent=function(){return[d.x-i.x,d.y-i.y]}):(this.command="SQ",this.params=[d,a,o],this.subStart=e.subStart,this.endPoint=o,this.endTangent=function(){return[o.x-a.x,o.y-a.y]},this.startTangent=function(){return[d.x-a.x,d.y-a.y]});break;case"A":var m=g,x=y,b=p[3],_=p[4],w=p[5];s=u?h(p[6],p[7],d):{x:p[6],y:p[7]},this.command="A";var M=v(d,s,_,w,m,x,b);this.params=M;var S=e.subStart;this.subStart=S,this.endPoint=s;var C=M[5]%(2*Math.PI);r.isNumberEqual(C,2*Math.PI)&&(C=0);var k=M[6]%(2*Math.PI);r.isNumberEqual(k,2*Math.PI)&&(k=0);var A=.001;this.startTangent=function(){0===w&&(A*=-1);var t=M[3]*Math.cos(C-A)+M[1],e=M[4]*Math.sin(C-A)+M[2];return[t-S.x,e-S.y]},this.endTangent=function(){var t=M[6];t-2*Math.PI<1e-4&&(t=0);var e=M[3]*Math.cos(C+t+A)+M[1],n=M[4]*Math.sin(C+t-A)+M[2];return[d.x-e,d.y-n]};break;case"Z":this.command="Z",this.params=[d,e.subStart],this.subStart=e.subStart,this.endPoint=e.subStart}},isInside:function(t,e,n){var r=this,a=r.command,o=r.params,s=r.box;if(s&&!i.box(s.minX,s.maxX,s.minY,s.maxY,t,e))return!1;switch(a){default:break;case"M":return!1;case"TL":case"L":case"Z":return i.line(o[0].x,o[0].y,o[1].x,o[1].y,n,t,e);case"SQ":case"Q":return i.quadraticline(o[0].x,o[0].y,o[1].x,o[1].y,o[2].x,o[2].y,n,t,e);case"C":return i.cubicline(o[0].x,o[0].y,o[1].x,o[1].y,o[2].x,o[2].y,o[3].x,o[3].y,n,t,e);case"A":var c=o,h=c[1],f=c[2],p=c[3],d=c[4],g=c[5],v=c[6],y=c[7],m=c[8],x=p>d?p:d,b=p>d?1:p/d,_=p>d?d/p:1;c=[t,e,1];var w=[1,0,0,0,1,0,0,0,1];return l.translate(w,w,[-h,-f]),l.rotate(w,w,-y),l.scale(w,w,[1/b,1/_]),u.transformMat3(c,c,w),i.arcline(0,0,x,g,g+v,1-m,n,c[0],c[1])}return!1},draw:function(t){var e,n,r,i=this.command,a=this.params;switch(i){default:break;case"M":t.moveTo(a[1].x,a[1].y);break;case"TL":case"L":t.lineTo(a[1].x,a[1].y);break;case"SQ":case"Q":e=a[1],n=a[2],t.quadraticCurveTo(e.x,e.y,n.x,n.y);break;case"C":e=a[1],n=a[2],r=a[3],t.bezierCurveTo(e.x,e.y,n.x,n.y,r.x,r.y);break;case"A":var o=a,s=o[1],u=o[2],l=s,c=u,h=o[3],f=o[4],p=o[5],d=o[6],g=o[7],v=o[8],y=h>f?h:f,m=h>f?1:h/f,x=h>f?f/h:1;t.translate(l,c),t.rotate(g),t.scale(m,x),t.arc(0,0,y,p,p+d,1-v),t.scale(1/m,1/x),t.rotate(-g),t.translate(-l,-c);break;case"Z":t.closePath();break}},getBBox:function(t){var e,n,r,i,u=t/2,l=this.params;switch(this.command){default:case"M":case"Z":break;case"TL":case"L":this.box={minX:Math.min(l[0].x,l[1].x)-u,maxX:Math.max(l[0].x,l[1].x)+u,minY:Math.min(l[0].y,l[1].y)-u,maxY:Math.max(l[0].y,l[1].y)+u};break;case"SQ":case"Q":for(n=o.extrema(l[0].x,l[1].x,l[2].x),r=0,i=n.length;r<i;r++)n[r]=o.at(l[0].x,l[1].x,l[2].x,n[r]);for(n.push(l[0].x,l[2].x),e=o.extrema(l[0].y,l[1].y,l[2].y),r=0,i=e.length;r<i;r++)e[r]=o.at(l[0].y,l[1].y,l[2].y,e);e.push(l[0].y,l[2].y),this.box={minX:Math.min.apply(Math,n)-u,maxX:Math.max.apply(Math,n)+u,minY:Math.min.apply(Math,e)-u,maxY:Math.max.apply(Math,e)+u};break;case"C":for(n=a.extrema(l[0].x,l[1].x,l[2].x,l[3].x),r=0,i=n.length;r<i;r++)n[r]=a.at(l[0].x,l[1].x,l[2].x,l[3].x,n[r]);for(e=a.extrema(l[0].y,l[1].y,l[2].y,l[3].y),r=0,i=e.length;r<i;r++)e[r]=a.at(l[0].y,l[1].y,l[2].y,l[3].y,e[r]);n.push(l[0].x,l[3].x),e.push(l[0].y,l[3].y),this.box={minX:Math.min.apply(Math,n)-u,maxX:Math.max.apply(Math,n)+u,minY:Math.min.apply(Math,e)-u,maxY:Math.max.apply(Math,e)+u};break;case"A":var c=l,h=c[1],f=c[2],p=c[3],d=c[4],g=c[5],v=c[6],y=c[7],m=c[8],x=g,b=g+v,_=s.xExtrema(y,p,d),w=1/0,M=-1/0,S=[x,b];for(r=2*-Math.PI;r<=2*Math.PI;r+=Math.PI){var C=_+r;1===m?x<C&&C<b&&S.push(C):b<C&&C<x&&S.push(C)}for(r=0,i=S.length;r<i;r++){var k=s.xAt(y,p,d,h,S[r]);k<w&&(w=k),k>M&&(M=k)}var A=s.yExtrema(y,p,d),P=1/0,I=-1/0,T=[x,b];for(r=2*-Math.PI;r<=2*Math.PI;r+=Math.PI){var O=A+r;1===m?x<O&&O<b&&T.push(O):b<O&&O<x&&T.push(O)}for(r=0,i=T.length;r<i;r++){var E=s.yAt(y,p,d,f,T[r]);E<P&&(P=E),E>I&&(I=E)}this.box={minX:w-u,maxX:M+u,minY:P-u,maxY:I+u};break}}}),t.exports=y},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(6),a=n(2),o=n(26),s=n(335),u=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n._initDefaultCfg=function(){t.prototype._initDefaultCfg.call(this);var e=this;e.type="linear",e.isLinear=!0,e.nice=!1,e.min=null,e.minLimit=null,e.max=null,e.maxLimit=null,e.tickCount=null,e.tickInterval=null,e.minTickInterval=null,e.snapArray=null},n.init=function(){var t=this;if(t.ticks){var e=t.ticks,n=t.translate(e[0]),r=t.translate(e[e.length-1]);(i(t.min)||t.min>n)&&(t.min=n),(i(t.max)||t.max<r)&&(t.max=r)}else t.min=t.translate(t.min),t.max=t.translate(t.max),t.initTicks()},n.calculateTicks=function(){var t=this.min,e=this.max,n=this.minLimit,r=this.maxLimit,i=this.tickCount,a=this.tickInterval,o=this.minTickInterval,u=this.snapArray;if(1===i)throw new Error("linear scale'tickCount should not be 1");if(e<t)throw new Error("max: "+e+" should not be less than min: "+t);var l=s({min:t,max:e,minLimit:n,maxLimit:r,minCount:i,maxCount:i,interval:a,minTickInterval:o,snapArray:u});return l.ticks},n.initTicks=function(){var t=this,e=t.calculateTicks();if(t.nice)t.ticks=e,t.min=e[0],t.max=e[e.length-1];else{var n=[];a(e,function(e){e>=t.min&&e<=t.max&&n.push(e)}),n.length||(n.push(t.min),n.push(t.max)),t.ticks=n}},n.scale=function(t){if(i(t))return NaN;var e=this.max,n=this.min;if(e===n)return 0;var r=(t-n)/(e-n),a=this.rangeMin(),o=this.rangeMax();return a+r*(o-a)},n.invert=function(t){var e=(t-this.rangeMin())/(this.rangeMax()-this.rangeMin());return this.min+e*(this.max-this.min)},e}(o);o.Linear=u,t.exports=u},function(t,e,n){var r=n(20),i=Array.prototype.indexOf,a=function(t,e){return!!r(t)&&i.call(t,e)>-1};t.exports=a},function(t,e){var n=function(t){for(var e=[],n=0;n<t.length;n++)e=e.concat(t[n]);return e};t.exports=n},function(t,e){var n=1e-5;t.exports=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:n;return Math.abs(t-e)<r}},function(t,e,n){t.exports={mat3:n(79),vec2:n(168),vec3:n(169),transform:n(167)}},function(t,e,n){var r=n(20);function i(t){return r(t)?Array.prototype.slice.call(t):[]}t.exports=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i=n(65);function a(t,e){return t===e?0!==t||0!==e||1/t===1/e:t!==t&&e!==e}function o(t){return i.Util.isArray(t)?t.length:i.Util.isObject(t)?Object.keys(t).length:0}e.default=i.Util.mix({},i.Util,{shallowEqual:function(t,e){if(a(t,e))return!0;if("object"!==("undefined"===typeof t?"undefined":r(t))||null===t||"object"!==("undefined"===typeof e?"undefined":r(e))||null===e)return!1;if(i.Util.isArray(t)!==i.Util.isArray(e))return!1;if(o(t)!==o(e))return!1;var n=!0;return i.Util.each(t,function(t,r){return!!a(t,e[r])||(n=!1,n)}),n},without:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n={};return i.Util.each(t,function(t,r){-1===i.Util.indexOf(e,r)&&(n[r]=t)}),n},length:o})},function(t,e,n){"use strict";e["a"]=function(t,e){return t=+t,e-=t,function(n){return t+e*n}}},function(t,e,n){"use strict";e["a"]=function(t,e){return t=+t,e-=t,function(n){return t+e*n}}},function(t,e,n){"use strict";var r=n(90),i=n(91);function a(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===i["b"]&&e.documentElement.namespaceURI===i["b"]?e.createElement(t):e.createElementNS(n,t)}}function o(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}e["a"]=function(t){var e=n.i(r["a"])(t);return(e.local?o:a)(e)}},function(t,e,n){"use strict";e["a"]=function(t,e){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}},function(t,e,n){"use strict";e["b"]=o;var r=n(13);function i(t,e){var i,a;return function(){var o=n.i(r["e"])(this,t),s=o.tween;if(s!==i){a=i=s;for(var u=0,l=a.length;u<l;++u)if(a[u].name===e){a=a.slice(),a.splice(u,1);break}}o.tween=a}}function a(t,e,i){var a,o;if("function"!==typeof i)throw new Error;return function(){var s=n.i(r["e"])(this,t),u=s.tween;if(u!==a){o=(a=u).slice();for(var l={name:e,value:i},c=0,h=o.length;c<h;++c)if(o[c].name===e){o[c]=l;break}c===h&&o.push(l)}s.tween=o}}function o(t,e,i){var a=t._id;return t.each(function(){var t=n.i(r["e"])(this,a);(t.value||(t.value={}))[e]=i.apply(this,arguments)}),function(t){return n.i(r["f"])(t,a).value[e]}}e["a"]=function(t,e){var o=this._id;if(t+="",arguments.length<2){for(var s,u=n.i(r["f"])(this.node(),o).tween,l=0,c=u.length;l<c;++l)if((s=u[l]).name===t)return s.value;return null}return this.each((null==e?i:a)(o,t,e))}},function(t,e,n){"use strict";var r=n(65),i=f(r),a=n(54),o=f(a),s=n(423),u=f(s),l=n(417),c=h(l);function h(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function f(t){return t&&t.__esModule?t:{default:t}}var p=o.default.mix(c,{G2:i.default,Util:o.default,Shape:r.Shape,Animate:r.Animate,PathUtil:r.PathUtil,track:function(){},setTheme:function(t){var e=t;"string"===typeof t&&u.default[t]&&(e=u.default[t]),i.default.Global.setTheme(e)}});e.default=p,t.exports=p},function(t,e,n){t.exports={Position:n(229),Color:n(227),Shape:n(230),Size:n(231),Opacity:n(228),ColorUtil:n(100)}},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}function i(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}var a=n(98),o=n(3),s=function(t){r(n,t);var e=n.prototype;function n(e){var n;n=t.call(this)||this;var r=i(i(n)),a={visible:!0},s=r.getDefaultCfg();return r._attrs=a,o.deepMix(a,s,e),n}return e.getDefaultCfg=function(){return{}},e.get=function(t){return this._attrs[t]},e.set=function(t,e){this._attrs[t]=e},e.changeVisible=function(){},e.destroy=function(){var t=this;t._attrs={},t.removeAllListeners(),t.destroyed=!0},n}(a);t.exports=s},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(3),a=n(105),o=n(255),s=n(18),u=s.FONT_FAMILY,l=8,c=i.Event,h=i.Group,f=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return i.mix({},e,{type:"continuous-legend",items:null,layout:"vertical",width:20,height:156,textStyle:{fill:"#333",textAlign:"center",textBaseline:"middle",stroke:"#fff",lineWidth:5,fontFamily:u},hoverTextStyle:{fill:"rgba(0,0,0,0.25)"},slidable:!0,triggerAttr:{fill:"#fff",shadowBlur:10,shadowColor:"rgba(0,0,0,0.65)",radius:2},_range:[0,100],middleBackgroundStyle:{fill:"#D9D9D9"},textOffset:4,lineStyle:{lineWidth:1,stroke:"#fff"},pointerStyle:{fill:"rgb(230, 230, 230)"}})},n._calStartPoint=function(){var t={x:10,y:this.get("titleGap")-l},e=this.get("titleShape");if(e){var n=e.getBBox();t.y+=n.height}return t},n.beforeRender=function(){var e=this.get("items");i.isArray(e)&&!i.isEmpty(e)&&(t.prototype.beforeRender.call(this),this.set("firstItem",e[0]),this.set("lastItem",e[e.length-1]))},n._formatItemValue=function(t){var e=this.get("formatter")||this.get("itemFormatter");return e&&(t=e.call(this,t)),t},n.render=function(){t.prototype.render.call(this),this.get("slidable")?this._renderSlider():this._renderUnslidable()},n._renderSlider=function(){var t=new h,e=new h,n=new h,r=this._calStartPoint(),i=this.get("group"),a=i.addGroup(o,{minHandleElement:t,maxHandleElement:e,backgroundElement:n,layout:this.get("layout"),range:this.get("_range"),width:this.get("width"),height:this.get("height")});a.translate(r.x,r.y),this.set("slider",a);var s=this._renderSliderShape();s.attr("clip",a.get("middleHandleElement")),this._renderTrigger()},n._addMiddleBar=function(t,e,n){return t.addShape(e,{attrs:i.mix({},n,this.get("middleBackgroundStyle"))}),t.addShape(e,{attrs:n})},n._renderTrigger=function(){var t=this.get("firstItem"),e=this.get("lastItem"),n=this.get("layout"),r=this.get("textStyle"),a=this.get("triggerAttr"),o=i.mix({},a),s=i.mix({},a),u=i.mix({text:this._formatItemValue(t.value)+""},r),l=i.mix({text:this._formatItemValue(e.value)+""},r);"vertical"===n?(this._addVerticalTrigger("min",o,u),this._addVerticalTrigger("max",s,l)):(this._addHorizontalTrigger("min",o,u),this._addHorizontalTrigger("max",s,l))},n._addVerticalTrigger=function(t,e,n){var r=this.get("slider"),a=r.get(t+"HandleElement"),o=this.get("width"),s=a.addShape("rect",{attrs:i.mix({x:o/2-l-2,y:"min"===t?0:-l,width:2*l+2,height:l},e)}),u=a.addShape("text",{attrs:i.mix(n,{x:o+this.get("textOffset"),y:"max"===t?-4:4,textAlign:"start",lineHeight:1,textBaseline:"middle"})}),c=this.get("layout"),h="vertical"===c?"ns-resize":"ew-resize";s.attr("cursor",h),u.attr("cursor",h),this.set(t+"ButtonElement",s),this.set(t+"TextElement",u)},n._addHorizontalTrigger=function(t,e,n){var r=this.get("slider"),a=r.get(t+"HandleElement"),o=a.addShape("rect",{attrs:i.mix({x:"min"===t?-l:0,y:-l-this.get("height")/2,width:l,height:2*l},e)}),s=a.addShape("text",{attrs:i.mix(n,{x:"min"===t?-l-4:l+4,y:l/2+this.get("textOffset")+10,textAlign:"min"===t?"end":"start",textBaseline:"middle"})}),u=this.get("layout"),c="vertical"===u?"ns-resize":"ew-resize";o.attr("cursor",c),s.attr("cursor",c),this.set(t+"ButtonElement",o),this.set(t+"TextElement",s)},n._bindEvents=function(){var t=this;if(this.get("slidable")){var e=this.get("slider");e.on("sliderchange",function(e){var n=e.range,r=t.get("firstItem").value,i=t.get("lastItem").value,a=r+n[0]/100*(i-r),o=r+n[1]/100*(i-r);t._updateElement(a,o);var s=new c("itemfilter",e,!0,!0);s.range=[a,o],t.emit("itemfilter",s)})}this.get("hoverable")&&(this.get("group").on("mousemove",i.wrapBehavior(this,"_onMouseMove")),this.get("group").on("mouseleave",i.wrapBehavior(this,"_onMouseLeave")))},n._updateElement=function(t,e){var n=this.get("minTextElement"),r=this.get("maxTextElement");e>1&&(t=parseInt(t,10),e=parseInt(e,10)),n.attr("text",this._formatItemValue(t)+""),r.attr("text",this._formatItemValue(e)+"")},n._onMouseLeave=function(){var t=this.get("group").findById("hoverPointer");t&&t.destroy();var e=this.get("group").findById("hoverText");e&&e.destroy(),this.get("canvas").draw()},n._onMouseMove=function(t){var e,n=this.get("height"),r=this.get("width"),i=this.get("items"),a=this.get("canvas").get("el"),o=a.getBoundingClientRect(),s=this.get("group").getBBox();if("vertical"===this.get("layout")){var u=5;"color-legend"===this.get("type")&&(u=30);var l=this.get("titleGap"),c=this.get("titleShape");c&&(l+=c.getBBox().maxY-c.getBBox().minY);var h=t.clientY||t.event.clientY;h=h-o.y-this.get("group").attr("matrix")[7]+s.y-u+l,e=i[0].value+(1-h/n)*(i[i.length-1].value-i[0].value)}else{var f=t.clientX||t.event.clientX;f=f-o.x-this.get("group").attr("matrix")[6],e=i[0].value+f/r*(i[i.length-1].value-i[0].value)}e=e.toFixed(2),this.activate(e),this.emit("mousehover",{value:e})},n.activate=function(t){if(t){var e=this.get("group").findById("hoverPointer"),n=this.get("group").findById("hoverText"),r=this.get("items");if(!(t<r[0].value||t>r[r.length-1].value)){var a,o=this.get("height"),s=this.get("width"),u=this.get("titleShape"),l=this.get("titleGap"),c=[],h=(t-r[0].value)/(r[r.length-1].value-r[0].value);if("vertical"===this.get("layout")){var f=0,p=0;"color-legend"===this.get("type")&&(f=l,u&&(f+=u.getBBox().height)),this.get("slidable")&&("color-legend"===this.get("type")?f-=13:(f=l-15,u&&(f+=u.getBBox().height)),p+=10),h=(1-h)*o,c=[[p,h+f],[p-10,h+f-5],[p-10,h+f+5]],a=i.mix({},{x:s+this.get("textOffset")/2+p,y:h+f,text:this._formatItemValue(t)+""},this.get("textStyle"),{textAlign:"start"})}else{var d=0,g=0;"color-legend"===this.get("type")&&(d=l,u&&(d+=u.getBBox().height)),this.get("slidable")&&("color-legend"===this.get("type")?d-=7:(d=l,u||(d-=7)),g+=10),h*=s,c=[[h+g,d],[h+g-5,d-10],[h+g+5,d-10]],a=i.mix({},{x:h-5,y:o+this.get("textOffset")+d,text:this._formatItemValue(t)+""},this.get("textStyle"))}var v=i.mix(a,this.get("hoverTextStyle"));n?n.attr(v):(n=this.get("group").addShape("text",{attrs:v}),n.set("id","hoverText")),e?e.attr(i.mix({points:c},this.get("pointerStyle"))):(e=this.get("group").addShape("Polygon",{attrs:i.mix({points:c},this.get("pointerStyle"))}),e.set("id","hoverPointer")),this.get("canvas").draw()}}},n.deactivate=function(){var t=this.get("group").findById("hoverPointer");t&&t.destroy();var e=this.get("group").findById("hoverText");e&&e.destroy(),this.get("canvas").draw()},e}(a);t.exports=f},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(62),a=n(3),o=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return a.mix({},e,{x:0,y:0,items:null,titleContent:null,showTitle:!0,plotRange:null,offset:10,timeStamp:0,inPlot:!0,crosshairs:null})},n.isContentChange=function(t,e){var n=this.get("titleContent"),r=this.get("items"),i=!(t===n&&r.length===e.length);return i||a.each(e,function(t,e){var n=r[e];for(var o in t)if(t.hasOwnProperty(o)&&!a.isObject(t[o])&&t[o]!==n[o]){i=!0;break}if(i)return!1}),i},n.setContent=function(t,e){var n=(new Date).valueOf();return this.set("items",e),this.set("titleContent",t),this.set("timeStamp",n),this.render(),this},n.setPosition=function(t,e){this.set("x",t),this.set("y",e)},n.render=function(){},n.clear=function(){},n.show=function(){this.set("visible",!0)},n.hide=function(){this.set("visible",!1)},n.destroy=function(){},e}(i);t.exports=o},function(t,e,n){var r=n(147),i=n(23),a=n(112),o=n(114),s=n(5),u=n(9),l=n(0),c={version:s.version,Animate:a,Chart:o,Global:s,Scale:r,Shape:u,Util:l,G:i,DomUtil:l.DomUtil,MatrixUtil:l.MatrixUtil,PathUtil:l.PathUtil,track:function(){console.warn("G2 tracks nothing ;-)")}};"undefined"!==typeof window&&(window.G2?console.warn("There are multiple versions of G2. Version "+c.version+"'s reference is 'window.G2_3'"):window.G2=c),t.exports=c},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(23),a=i.Group,o=n(29),s=o.Label,u=n(5),l=n(0),c=["line","point","path"],h="_origin";function f(t){var e=0;return l.each(t,function(t){e+=t}),e/t.length}function p(t,e){if(l.isNumber(t)&&l.isNumber(e))return[t,e];var n,r,i=-1,a=0,o=0,s=t.length-1,u=0;while(++i<t.length)n=s,s=i,u+=r=t[n]*e[s]-t[s]*e[n],a+=(t[n]+t[s])*r,o+=(e[n]+e[s])*r;return u*=3,[a/u,o/u]}var d=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.getDefaultCfg=function(){return{label:u.label,labelCfg:null,coord:null,geomType:null,zIndex:6}},n._renderUI=function(){t.prototype._renderUI.call(this),this.initLabelsCfg();var e=this.addGroup(),n=this.addGroup({elCls:"x-line-group"}),r=this.get("labelRenderer");this.set("labelsGroup",e),this.set("lineGroup",n),this.get("labelRenderer").set("group",e),r.set("group",e),r.set("lineGroup",n)},n.initLabelsCfg=function(){var t=this,e=new s,n=t.getDefaultLabelCfg(),r=t.get("labelCfg");l.deepMix(n,r.globalCfg||r.cfg),e.set("config",!1),n.labelLine&&e.set("labelLine",n.labelLine),e.set("coord",t.get("coord")),this.set("labelRenderer",e),t.set("label",n)},n.getDefaultLabelCfg=function(){var t=this,e=t.get("labelCfg").cfg||t.get("labelCfg").globalCfg,n=t.get("geomType"),r=t.get("viewTheme")||u;return"polygon"===n||e&&e.offset<0&&-1===l.indexOf(c,n)?l.deepMix({},t.get("label"),r.innerLabels,e):l.deepMix({},t.get("label"),r.label,e)},n.getLabelsItems=function(t,e){var n=this,r=[],i=n.get("geom"),a=n.get("coord");n._getLabelCfgs(t,e);var o=n.get("labelItemCfgs");return l.each(t,function(t,e){var s=t[h],u=o[e];if(u){l.isArray(u.text)||(u.text=[u.text]);var c=u.length;l.each(u.text,function(e,o){if(l.isNil(e)||""===e)r.push(null);else{var h=n.getLabelPoint(u,t,o);h=l.mix({},u,h),h.textAlign||(h.textAlign=n.getLabelAlign(h,o,c)),i&&(h._id=i._getShapeId(s)+"-glabel-"+o+"-"+h.text),h.coord=a,r.push(h)}})}else r.push(null)}),r},n.adjustItems=function(t){return l.each(t,function(t){t&&(t.offsetX&&(t.x+=t.offsetX),t.offsetY&&(t.y+=t.offsetY))}),t},n.drawLines=function(t){var e=this;l.each(t,function(t){t&&t.offset>0&&e.lineToLabel(t)})},n.lineToLabel=function(){},n.getLabelPoint=function(t,e,n){var r=this,i=r.get("coord"),a=t.text.length;function o(e,n){return l.isArray(e)&&(e=1===t.text.length?e.length<=2?e[e.length-1]:f(e):e[n]),e}var s={text:t.text[n]};if(e&&"polygon"===this.get("geomType")){var u=p(e.x,e.y);s.x=u[0],s.y=u[1]}else s.x=o(e.x,n),s.y=o(e.y,n);if(e&&e.nextPoints&&("funnel"===e.shape||"pyramid"===e.shape)){var c=-1/0;e.nextPoints.forEach(function(t){t=i.convert(t),t.x>c&&(c=t.x)}),s.x=(s.x+c)/2}"pyramid"===e.shape&&!e.nextPoints&&e.points&&e.points.forEach(function(t){t=i.convert(t),(l.isArray(t.x)&&-1===e.x.indexOf(t.x)||l.isNumber(t.x)&&e.x!==t.x)&&(s.x=(s.x+t.x)/2)}),t.position&&r.setLabelPosition(s,e,n,t.position);var h=r.getLabelOffset(t,n,a);return t.offsetX&&(h.x+=t.offsetX),t.offsetY&&(h.y+=t.offsetY),r.transLabelPoint(s),s.start={x:s.x,y:s.y},s.x+=h.x,s.y+=h.y,s.color=e.color,s},n.setLabelPosition=function(){},n.transLabelPoint=function(t){var e=this,n=e.get("coord"),r=n.applyMatrix(t.x,t.y,1);t.x=r[0],t.y=r[1]},n.getOffsetVector=function(t){var e,n=this,r=t.offset||0,i=n.get("coord");return e=i.isTransposed?i.applyMatrix(r,0):i.applyMatrix(0,r),e},n.getDefaultOffset=function(t){var e=this,n=0,r=e.get("coord"),i=e.getOffsetVector(t);return n=r.isTransposed?i[0]:i[1],n},n.getLabelOffset=function(t,e,n){var r=this,i=r.getDefaultOffset(t),a=r.get("coord"),o=a.isTransposed,s=o?"x":"y",u=o?1:-1,l={x:0,y:0};return l[s]=e>0||1===n?i*u:i*u*-1,l},n.getLabelAlign=function(t,e,n){var r=this,i="center",a=r.get("coord");if(a.isTransposed){var o=r.getDefaultOffset(t);i=o<0?"right":0===o?"center":"left",n>1&&0===e&&("right"===i?i="left":"left"===i&&(i="right"))}return i},n._getLabelValue=function(t,e){l.isArray(e)||(e=[e]);var n=[];return l.each(e,function(e){var r=t[e.field];if(l.isArray(r)){var i=[];l.each(r,function(t){i.push(e.getText(t))}),r=i}else r=e.getText(r);(l.isNil(r)||""===r)&&n.push(null),n.push(r)}),n},n._getLabelCfgs=function(t){var e=this,n=this.get("labelCfg"),r=n.scales,i=this.get("label"),a=e.get("viewTheme")||u,o=[];n.globalCfg&&n.globalCfg.type&&e.set("type",n.globalCfg.type),l.each(t,function(t,s){var u={},c=t[h],f=e._getLabelValue(c,r);if(n.callback){var p=r.map(function(t){return c[t.field]});u=n.callback.apply(null,p)}if(u||0===u){if(l.isString(u)||l.isNumber(u)?u={text:u}:(u.text=u.content||f[0],delete u.content),u=l.mix({},i,n.globalCfg||{},u),t.point=c,u.htmlTemplate&&(u.useHtml=!0,u.text=u.htmlTemplate.call(null,u.text,t,s),delete u.htmlTemplate),u.formatter&&(u.text=u.formatter.call(null,u.text,t,s),delete u.formatter),u.label){var d=u.label;delete u.label,u=l.mix(u,d)}if(u.textStyle){delete u.textStyle.offset;var g=u.textStyle;l.isFunction(g)&&(u.textStyle=g.call(null,u.text,t,s))}u.labelLine&&(u.labelLine=l.mix({},i.labelLine,u.labelLine)),u.textStyle=l.mix({},i.textStyle,a.label.textStyle,u.textStyle),delete u.items,o.push(u)}else o.push(null)}),this.set("labelItemCfgs",o)},n.showLabels=function(t,e){var n=this,r=n.get("labelRenderer"),i=n.getLabelsItems(t,e);e=[].concat(e);var a=n.get("type");i=n.adjustItems(i,e),n.drawLines(i),r.set("items",i.filter(function(t,n){return!!t||(e.splice(n,1),!1)})),a&&(r.set("shapes",e),r.set("type",a),r.set("points",t)),r.set("canvas",this.get("canvas")),r.draw()},n.destroy=function(){this.get("labelRenderer").destroy(),t.prototype.destroy.call(this)},e}(a);t.exports=d},function(t,e,n){var r=n(5),i=n(0);function a(t,e){var n=t.length;i.isString(t[0])&&(t=t.map(function(t){return e.translate(t)}));for(var r=t[1]-t[0],a=2;a<n;a++){var o=t[a]-t[a-1];r>o&&(r=o)}return r}var o={getDefaultSize:function(){var t=this.get("defaultSize"),e=this.get("viewTheme")||r;if(!t){var n,i=this.get("coord"),o=this.getXScale(),s=o.values,u=this.get("dataArray");if(o.isLinear&&s.length>1){s.sort();var l=a(s,o);n=(o.max-o.min)/l,s.length>n&&(n=s.length)}else n=s.length;var c=o.range,h=1/n,f=1;if(this.isInCircle()?f=i.isTransposed&&n>1?e.widthRatio.multiplePie:e.widthRatio.rose:(o.isLinear&&(h*=c[1]-c[0]),f=e.widthRatio.column),h*=f,this.hasAdjust("dodge")){var p=this._getDodgeCount(u);h/=p}t=h,this.set("defaultSize",t)}return t},_getDodgeCount:function(t){var e,n=this.get("adjusts"),r=t.length;if(i.each(n,function(t){"dodge"===t.type&&(e=t.dodgeBy)}),e){var a=i.Array.merge(t),o=i.Array.values(a,e);r=o.length}return r},getDimWidth:function(t){var e=this.get("coord"),n=e.convertPoint({x:0,y:0}),r=e.convertPoint({x:"x"===t?1:0,y:"x"===t?0:1}),i=0;return n&&r&&(i=Math.sqrt(Math.pow(r.x-n.x,2)+Math.pow(r.y-n.y,2))),i},_getWidth:function(){var t,e=this.get("coord");return t=this.isInCircle()&&!e.isTransposed?(e.endAngle-e.startAngle)*e.radius:this.getDimWidth("x"),t},_toNormalizedSize:function(t){var e=this._getWidth();return t/e},_toCoordSize:function(t){var e=this._getWidth();return e*t},getNormalizedSize:function(t){var e=this.getAttrValue("size",t);return e=i.isNil(e)?this.getDefaultSize():this._toNormalizedSize(e),e},getSize:function(t){var e=this.getAttrValue("size",t);if(i.isNil(e)){var n=this.getDefaultSize();e=this._toCoordSize(n)}return e}};t.exports=o},function(t,e,n){var r=n(1),i=n(7),a=n(36),o=n(47),s=function t(e){t.superclass.constructor.call(this,e)};s.Symbols={circle:function(t,e,n){return[["M",t,e],["m",-n,0],["a",n,n,0,1,0,2*n,0],["a",n,n,0,1,0,2*-n,0]]},square:function(t,e,n){return[["M",t-n,e-n],["L",t+n,e-n],["L",t+n,e+n],["L",t-n,e+n],["Z"]]},diamond:function(t,e,n){return[["M",t-n,e],["L",t,e-n],["L",t+n,e],["L",t,e+n],["Z"]]},triangle:function(t,e,n){var r=n*Math.sin(1/3*Math.PI);return[["M",t-n,e+r],["L",t,e-r],["L",t+n,e+r],["z"]]},"triangle-down":function(t,e,n){var r=n*Math.sin(1/3*Math.PI);return[["M",t-n,e-r],["L",t+n,e-r],["L",t,e+r],["Z"]]}},s.ATTRS={path:null,lineWidth:1},r.extend(s,i),r.augment(s,{type:"marker",canFill:!0,canStroke:!0,getDefaultAttrs:function(){return{x:0,y:0,lineWidth:1}},calculateBox:function(){var t=this._attrs,e=t.x,n=t.y,r=t.radius,i=this.getHitLineWidth(),a=i/2+r;return{minX:e-a,minY:n-a,maxX:e+a,maxY:n+a}},_getPath:function(){var t,e=this._attrs,n=e.x,i=e.y,a=e.radius||e.r,o=e.symbol||"circle";return t=r.isFunction(o)?o:s.Symbols[o],t?t(n,i,a):(console.warn(o+" marker is not supported."),null)},createPath:function(t){var e=this._cfg.segments;if(!e||this._cfg.hasUpdate){var n,r=a.parsePath(this._getPath());t.beginPath(),e=[];for(var i=0;i<r.length;i++){var s=r[i];n=new o(s,n,i===r.length-1),e.push(n),n.draw(t)}this._cfg.segments=e,this._cfg.hasUpdate=!1}else{t.beginPath();for(var u=0;u<e.length;u++)e[u].draw(t)}}}),t.exports=s},function(t,e,n){var r=n(1),i=r.vec2;function a(t,e,n,r,i){var a=1-i;return a*a*(a*r+3*i*n)+i*i*(i*t+3*a*e)}function o(t,e,n,r,i){var a=1-i;return 3*(((e-t)*a+2*(n-e)*i)*a+(r-n)*i*i)}function s(t,e,n,r,o,s,u,l,c,h,f){var p,d,g,v,y,m,x,b,_=.005,w=1/0,M=1e-4,S=[c,h];for(d=0;d<1;d+=.05)g=[a(t,n,o,u,d),a(e,r,s,l,d)],v=i.squaredDistance(S,g),v<w&&(p=d,w=v);w=1/0;for(var C=0;C<32;C++){if(_<M)break;x=p-_,b=p+_,g=[a(t,n,o,u,x),a(e,r,s,l,x)],v=i.squaredDistance(S,g),x>=0&&v<w?(p=x,w=v):(m=[a(t,n,o,u,b),a(e,r,s,l,b)],y=i.squaredDistance(S,m),b<=1&&y<w?(p=b,w=y):_*=.5)}return f&&(f.x=a(t,n,o,u,p),f.y=a(e,r,s,l,p)),Math.sqrt(w)}function u(t,e,n,i){var a,o,s,u=3*t-9*e+9*n-3*i,l=6*e-12*n+6*i,c=3*n-3*i,h=[];if(r.isNumberEqual(u,0))r.isNumberEqual(l,0)||(a=-c/l,a>=0&&a<=1&&h.push(a));else{var f=l*l-4*u*c;r.isNumberEqual(f,0)?h.push(-l/(2*u)):f>0&&(s=Math.sqrt(f),a=(-l+s)/(2*u),o=(-l-s)/(2*u),a>=0&&a<=1&&h.push(a),o>=0&&o<=1&&h.push(o))}return h}function l(t,e,n,r,i){var a=-3*e+9*n-9*r+3*i,o=t*a+6*e-12*n+6*r;return t*o-3*e+3*n}function c(t,e,n,i,a,o,s,u,c){r.isNil(c)&&(c=1),c=c>1?1:c<0?0:c;for(var h=c/2,f=12,p=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],d=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],g=0,v=0;v<f;v++){var y=h*p[v]+h,m=l(y,t,n,a,s),x=l(y,e,i,o,u),b=m*m+x*x;g+=d[v]*Math.sqrt(b)}return h*g}t.exports={at:a,derivativeAt:o,projectPoint:function(t,e,n,r,i,a,o,u,l,c){var h={};return s(t,e,n,r,i,a,o,u,l,c,h),h},pointDistance:s,extrema:u,len:c}},function(t,e,n){var r=n(45),i=n(137),a=n(69),o=n(44);t.exports={line:function(t,e,n,i,a,o,s){var u=r.box(t,e,n,i,a);if(!this.box(u.minX,u.maxX,u.minY,u.maxY,o,s))return!1;var l=r.pointDistance(t,e,n,i,o,s);return!isNaN(l)&&l<=a/2},polyline:function(t,e,n,r){var i=t.length-1;if(i<1)return!1;for(var a=0;a<i;a++){var o=t[a][0],s=t[a][1],u=t[a+1][0],l=t[a+1][1];if(this.line(o,s,u,l,e,n,r))return!0}return!1},cubicline:function(t,e,n,r,i,o,s,u,l,c,h){return a.pointDistance(t,e,n,r,i,o,s,u,c,h)<=l/2},quadraticline:function(t,e,n,r,a,o,s,u,l){return i.pointDistance(t,e,n,r,a,o,u,l)<=s/2},arcline:function(t,e,n,r,i,a,s,u,l){return o.pointDistance(t,e,n,r,i,a,u,l)<=s/2},rect:function(t,e,n,r,i,a){return t<=i&&i<=t+n&&e<=a&&a<=e+r},circle:function(t,e,n,r,i){return Math.pow(r-t,2)+Math.pow(i-e,2)<=Math.pow(n,2)},box:function(t,e,n,r,i,a){return t<=i&&i<=e&&n<=a&&a<=r}}},function(t,e,n){var r=n(143),i="\t\n\v\f\r \xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029",a=new RegExp("([a-z])["+i+",]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?["+i+"]*,?["+i+"]*)+)","ig"),o=new RegExp("(-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?)["+i+"]*,?["+i+"]*","ig"),s=function(t){if(!t)return null;if(typeof t===typeof[])return t;var e={a:7,c:6,o:2,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,u:3,z:0},n=[];return String(t).replace(a,function(t,r,i){var a=[],s=r.toLowerCase();if(i.replace(o,function(t,e){e&&a.push(+e)}),"m"===s&&a.length>2&&(n.push([r].concat(a.splice(0,2))),s="l",r="m"===r?"l":"L"),"o"===s&&1===a.length&&n.push([r,a[0]]),"r"===s)n.push([r].concat(a));else while(a.length>=e[s])if(n.push([r].concat(a.splice(0,e[s]))),!e[s])break}),n},u=function(t,e){for(var n=[],r=0,i=t.length;i-2*!e>r;r+=2){var a=[{x:+t[r-2],y:+t[r-1]},{x:+t[r],y:+t[r+1]},{x:+t[r+2],y:+t[r+3]},{x:+t[r+4],y:+t[r+5]}];e?r?i-4===r?a[3]={x:+t[0],y:+t[1]}:i-2===r&&(a[2]={x:+t[0],y:+t[1]},a[3]={x:+t[2],y:+t[3]}):a[0]={x:+t[i-2],y:+t[i-1]}:i-4===r?a[3]=a[2]:r||(a[0]={x:+t[r],y:+t[r+1]}),n.push(["C",(-a[0].x+6*a[1].x+a[2].x)/6,(-a[0].y+6*a[1].y+a[2].y)/6,(a[1].x+6*a[2].x-a[3].x)/6,(a[1].y+6*a[2].y-a[3].y)/6,a[2].x,a[2].y])}return n},l=function(t,e,n,r,i){var a=[];if(null===i&&null===r&&(r=n),t=+t,e=+e,n=+n,r=+r,null!==i){var o=Math.PI/180,s=t+n*Math.cos(-r*o),u=t+n*Math.cos(-i*o),l=e+n*Math.sin(-r*o),c=e+n*Math.sin(-i*o);a=[["M",s,l],["A",n,n,0,+(i-r>180),0,u,c]]}else a=[["M",t,e],["m",0,-r],["a",n,r,0,1,1,0,2*r],["a",n,r,0,1,1,0,-2*r],["z"]];return a},c=function(t){if(t=s(t),!t||!t.length)return[["M",0,0]];var e,n,r=[],i=0,a=0,o=0,c=0,h=0;"M"===t[0][0]&&(i=+t[0][1],a=+t[0][2],o=i,c=a,h++,r[0]=["M",i,a]);for(var f,p,d=3===t.length&&"M"===t[0][0]&&"R"===t[1][0].toUpperCase()&&"Z"===t[2][0].toUpperCase(),g=h,v=t.length;g<v;g++){if(r.push(f=[]),p=t[g],e=p[0],e!==e.toUpperCase())switch(f[0]=e.toUpperCase(),f[0]){case"A":f[1]=p[1],f[2]=p[2],f[3]=p[3],f[4]=p[4],f[5]=p[5],f[6]=+p[6]+i,f[7]=+p[7]+a;break;case"V":f[1]=+p[1]+a;break;case"H":f[1]=+p[1]+i;break;case"R":n=[i,a].concat(p.slice(1));for(var y=2,m=n.length;y<m;y++)n[y]=+n[y]+i,n[++y]=+n[y]+a;r.pop(),r=r.concat(u(n,d));break;case"O":r.pop(),n=l(i,a,p[1],p[2]),n.push(n[0]),r=r.concat(n);break;case"U":r.pop(),r=r.concat(l(i,a,p[1],p[2],p[3])),f=["U"].concat(r[r.length-1].slice(-2));break;case"M":o=+p[1]+i,c=+p[2]+a;break;default:for(var x=1,b=p.length;x<b;x++)f[x]=+p[x]+(x%2?i:a)}else if("R"===e)n=[i,a].concat(p.slice(1)),r.pop(),r=r.concat(u(n,d)),f=["R"].concat(p.slice(-2));else if("O"===e)r.pop(),n=l(i,a,p[1],p[2]),n.push(n[0]),r=r.concat(n);else if("U"===e)r.pop(),r=r.concat(l(i,a,p[1],p[2],p[3])),f=["U"].concat(r[r.length-1].slice(-2));else for(var _=0,w=p.length;_<w;_++)f[_]=p[_];if(e=e.toUpperCase(),"O"!==e)switch(f[0]){case"Z":i=+o,a=+c;break;case"H":i=f[1];break;case"V":a=f[1];break;case"M":o=f[f.length-2],c=f[f.length-1];break;default:i=f[f.length-2],a=f[f.length-1]}}return r},h=function(t,e,n,r){return[t,e,n,r,n,r]},f=function(t,e,n,r,i,a){var o=1/3,s=2/3;return[o*t+s*n,o*e+s*r,o*i+s*n,o*a+s*r,i,a]},p=function t(e,n,r,i,a,o,s,u,l,c){r===i&&(r+=1);var h,f,p,d,g,v=120*Math.PI/180,y=Math.PI/180*(+a||0),m=[],x=function(t,e,n){var r=t*Math.cos(n)-e*Math.sin(n),i=t*Math.sin(n)+e*Math.cos(n);return{x:r,y:i}};if(c)f=c[0],p=c[1],d=c[2],g=c[3];else{h=x(e,n,-y),e=h.x,n=h.y,h=x(u,l,-y),u=h.x,l=h.y,e===u&&n===l&&(u+=1,l+=1);var b=(e-u)/2,_=(n-l)/2,w=b*b/(r*r)+_*_/(i*i);w>1&&(w=Math.sqrt(w),r*=w,i*=w);var M=r*r,S=i*i,C=(o===s?-1:1)*Math.sqrt(Math.abs((M*S-M*_*_-S*b*b)/(M*_*_+S*b*b)));d=C*r*_/i+(e+u)/2,g=C*-i*b/r+(n+l)/2,f=Math.asin(((n-g)/i).toFixed(9)),p=Math.asin(((l-g)/i).toFixed(9)),f=e<d?Math.PI-f:f,p=u<d?Math.PI-p:p,f<0&&(f=2*Math.PI+f),p<0&&(p=2*Math.PI+p),s&&f>p&&(f-=2*Math.PI),!s&&p>f&&(p-=2*Math.PI)}var k=p-f;if(Math.abs(k)>v){var A=p,P=u,I=l;p=f+v*(s&&p>f?1:-1),u=d+r*Math.cos(p),l=g+i*Math.sin(p),m=t(u,l,r,i,a,0,s,P,I,[p,A,d,g])}k=p-f;var T=Math.cos(f),O=Math.sin(f),E=Math.cos(p),L=Math.sin(p),D=Math.tan(k/4),F=4/3*r*D,R=4/3*i*D,j=[e,n],B=[e+F*O,n-R*T],N=[u+F*L,l-R*E],z=[u,l];if(B[0]=2*j[0]-B[0],B[1]=2*j[1]-B[1],c)return[B,N,z].concat(m);m=[B,N,z].concat(m).join().split(",");for(var G=[],V=0,Y=m.length;V<Y;V++)G[V]=V%2?x(m[V-1],m[V],y).y:x(m[V],m[V+1],y).x;return G},d=function(t,e){var n,r=c(t),i=e&&c(e),a={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},o={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},s=[],u=[],l="",d="",g=function(t,e,n){var r,i;if(!t)return["C",e.x,e.y,e.x,e.y,e.x,e.y];switch(!(t[0]in{T:1,Q:1})&&(e.qx=e.qy=null),t[0]){case"M":e.X=t[1],e.Y=t[2];break;case"A":t=["C"].concat(p.apply(0,[e.x,e.y].concat(t.slice(1))));break;case"S":"C"===n||"S"===n?(r=2*e.x-e.bx,i=2*e.y-e.by):(r=e.x,i=e.y),t=["C",r,i].concat(t.slice(1));break;case"T":"Q"===n||"T"===n?(e.qx=2*e.x-e.qx,e.qy=2*e.y-e.qy):(e.qx=e.x,e.qy=e.y),t=["C"].concat(f(e.x,e.y,e.qx,e.qy,t[1],t[2]));break;case"Q":e.qx=t[1],e.qy=t[2],t=["C"].concat(f(e.x,e.y,t[1],t[2],t[3],t[4]));break;case"L":t=["C"].concat(h(e.x,e.y,t[1],t[2]));break;case"H":t=["C"].concat(h(e.x,e.y,t[1],e.y));break;case"V":t=["C"].concat(h(e.x,e.y,e.x,t[1]));break;case"Z":t=["C"].concat(h(e.x,e.y,e.X,e.Y));break;default:break}return t},v=function(t,e){if(t[e].length>7){t[e].shift();var a=t[e];while(a.length)s[e]="A",i&&(u[e]="A"),t.splice(e++,0,["C"].concat(a.splice(0,6)));t.splice(e,1),n=Math.max(r.length,i&&i.length||0)}},y=function(t,e,a,o,s){t&&e&&"M"===t[s][0]&&"M"!==e[s][0]&&(e.splice(s,0,["M",o.x,o.y]),a.bx=0,a.by=0,a.x=t[s][1],a.y=t[s][2],n=Math.max(r.length,i&&i.length||0))};n=Math.max(r.length,i&&i.length||0);for(var m=0;m<n;m++){r[m]&&(l=r[m][0]),"C"!==l&&(s[m]=l,m&&(d=s[m-1])),r[m]=g(r[m],a,d),"A"!==s[m]&&"C"===l&&(s[m]="C"),v(r,m),i&&(i[m]&&(l=i[m][0]),"C"!==l&&(u[m]=l,m&&(d=u[m-1])),i[m]=g(i[m],o,d),"A"!==u[m]&&"C"===l&&(u[m]="C"),v(i,m)),y(r,i,a,o,m),y(i,r,o,a,m);var x=r[m],b=i&&i[m],_=x.length,w=i&&b.length;a.x=x[_-2],a.y=x[_-1],a.bx=parseFloat(x[_-4])||a.x,a.by=parseFloat(x[_-3])||a.y,o.bx=i&&(parseFloat(b[w-4])||o.x),o.by=i&&(parseFloat(b[w-3])||o.y),o.x=i&&b[w-2],o.y=i&&b[w-1]}return i?[r,i]:r},g=/,?([a-z]),?/gi,v=function(t){return t.join(",").replace(g,"$1")},y=function(t,e,n,r,i){var a=-3*e+9*n-9*r+3*i,o=t*a+6*e-12*n+6*r;return t*o-3*e+3*n},m=function(t,e,n,r,i,a,o,s,u){null===u&&(u=1),u=u>1?1:u<0?0:u;for(var l=u/2,c=12,h=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],f=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],p=0,d=0;d<c;d++){var g=l*h[d]+l,v=y(g,t,n,i,o),m=y(g,e,r,a,s),x=v*v+m*m;p+=f[d]*Math.sqrt(x)}return l*p},x=function(t,e,n,r,i,a,o,s){for(var u,l,c,h,f=[],p=[[],[]],d=0;d<2;++d)if(0===d?(l=6*t-12*n+6*i,u=-3*t+9*n-9*i+3*o,c=3*n-3*t):(l=6*e-12*r+6*a,u=-3*e+9*r-9*a+3*s,c=3*r-3*e),Math.abs(u)<1e-12){if(Math.abs(l)<1e-12)continue;h=-c/l,h>0&&h<1&&f.push(h)}else{var g=l*l-4*c*u,v=Math.sqrt(g);if(!(g<0)){var y=(-l+v)/(2*u);y>0&&y<1&&f.push(y);var m=(-l-v)/(2*u);m>0&&m<1&&f.push(m)}}var x,b=f.length,_=b;while(b--)h=f[b],x=1-h,p[0][b]=x*x*x*t+3*x*x*h*n+3*x*h*h*i+h*h*h*o,p[1][b]=x*x*x*e+3*x*x*h*r+3*x*h*h*a+h*h*h*s;return p[0][_]=t,p[1][_]=e,p[0][_+1]=o,p[1][_+1]=s,p[0].length=p[1].length=_+2,{min:{x:Math.min.apply(0,p[0]),y:Math.min.apply(0,p[1])},max:{x:Math.max.apply(0,p[0]),y:Math.max.apply(0,p[1])}}},b=function(t,e,n,r,i,a,o,s){if(!(Math.max(t,n)<Math.min(i,o)||Math.min(t,n)>Math.max(i,o)||Math.max(e,r)<Math.min(a,s)||Math.min(e,r)>Math.max(a,s))){var u=(t*r-e*n)*(i-o)-(t-n)*(i*s-a*o),l=(t*r-e*n)*(a-s)-(e-r)*(i*s-a*o),c=(t-n)*(a-s)-(e-r)*(i-o);if(c){var h=u/c,f=l/c,p=+h.toFixed(2),d=+f.toFixed(2);if(!(p<+Math.min(t,n).toFixed(2)||p>+Math.max(t,n).toFixed(2)||p<+Math.min(i,o).toFixed(2)||p>+Math.max(i,o).toFixed(2)||d<+Math.min(e,r).toFixed(2)||d>+Math.max(e,r).toFixed(2)||d<+Math.min(a,s).toFixed(2)||d>+Math.max(a,s).toFixed(2)))return{x:h,y:f}}}},_=function(t,e,n){return e>=t.x&&e<=t.x+t.width&&n>=t.y&&n<=t.y+t.height},w=function(t,e,n,r,i){if(i)return[["M",+t+ +i,e],["l",n-2*i,0],["a",i,i,0,0,1,i,i],["l",0,r-2*i],["a",i,i,0,0,1,-i,i],["l",2*i-n,0],["a",i,i,0,0,1,-i,-i],["l",0,2*i-r],["a",i,i,0,0,1,i,-i],["z"]];var a=[["M",t,e],["l",n,0],["l",0,r],["l",-n,0],["z"]];return a.parsePathArray=v,a},M=function(t,e,n,r){return null===t&&(t=e=n=r=0),null===e&&(e=t.y,n=t.width,r=t.height,t=t.x),{x:t,y:e,width:n,w:n,height:r,h:r,x2:t+n,y2:e+r,cx:t+n/2,cy:e+r/2,r1:Math.min(n,r)/2,r2:Math.max(n,r)/2,r0:Math.sqrt(n*n+r*r)/2,path:w(t,e,n,r),vb:[t,e,n,r].join(" ")}},S=function(t,e){return t=M(t),e=M(e),_(e,t.x,t.y)||_(e,t.x2,t.y)||_(e,t.x,t.y2)||_(e,t.x2,t.y2)||_(t,e.x,e.y)||_(t,e.x2,e.y)||_(t,e.x,e.y2)||_(t,e.x2,e.y2)||(t.x<e.x2&&t.x>e.x||e.x<t.x2&&e.x>t.x)&&(t.y<e.y2&&t.y>e.y||e.y<t.y2&&e.y>t.y)},C=function(t,e,n,i,a,o,s,u){r.isArray(t)||(t=[t,e,n,i,a,o,s,u]);var l=x.apply(null,t);return M(l.min.x,l.min.y,l.max.x-l.min.x,l.max.y-l.min.y)},k=function(t,e,n,r,i,a,o,s,u){var l=1-u,c=Math.pow(l,3),h=Math.pow(l,2),f=u*u,p=f*u,d=c*t+3*h*u*n+3*l*u*u*i+p*o,g=c*e+3*h*u*r+3*l*u*u*a+p*s,v=t+2*u*(n-t)+f*(i-2*n+t),y=e+2*u*(r-e)+f*(a-2*r+e),m=n+2*u*(i-n)+f*(o-2*i+n),x=r+2*u*(a-r)+f*(s-2*a+r),b=l*t+u*n,_=l*e+u*r,w=l*i+u*o,M=l*a+u*s,S=90-180*Math.atan2(v-m,y-x)/Math.PI;return{x:d,y:g,m:{x:v,y:y},n:{x:m,y:x},start:{x:b,y:_},end:{x:w,y:M},alpha:S}},A=function(t,e,n){var r=C(t),i=C(e);if(!S(r,i))return n?0:[];for(var a=m.apply(0,t),o=m.apply(0,e),s=~~(a/8),u=~~(o/8),l=[],c=[],h={},f=n?0:[],p=0;p<s+1;p++){var d=k.apply(0,t.concat(p/s));l.push({x:d.x,y:d.y,t:p/s})}for(var g=0;g<u+1;g++){var v=k.apply(0,e.concat(g/u));c.push({x:v.x,y:v.y,t:g/u})}for(var y=0;y<s;y++)for(var x=0;x<u;x++){var _=l[y],w=l[y+1],M=c[x],A=c[x+1],P=Math.abs(w.x-_.x)<.001?"y":"x",I=Math.abs(A.x-M.x)<.001?"y":"x",T=b(_.x,_.y,w.x,w.y,M.x,M.y,A.x,A.y);if(T){if(h[T.x.toFixed(4)]===T.y.toFixed(4))continue;h[T.x.toFixed(4)]=T.y.toFixed(4);var O=_.t+Math.abs((T[P]-_[P])/(w[P]-_[P]))*(w.t-_.t),E=M.t+Math.abs((T[I]-M[I])/(A[I]-M[I]))*(A.t-M.t);O>=0&&O<=1&&E>=0&&E<=1&&(n?f++:f.push({x:T.x,y:T.y,t1:O,t2:E}))}}return f},P=function(t,e,n){var r,i,a,o,s,u,l,c,h,f;t=d(t),e=d(e);for(var p=n?0:[],g=0,v=t.length;g<v;g++){var y=t[g];if("M"===y[0])r=s=y[1],i=u=y[2];else{"C"===y[0]?(h=[r,i].concat(y.slice(1)),r=h[6],i=h[7]):(h=[r,i,r,i,s,u,s,u],r=s,i=u);for(var m=0,x=e.length;m<x;m++){var b=e[m];if("M"===b[0])a=l=b[1],o=c=b[2];else{"C"===b[0]?(f=[a,o].concat(b.slice(1)),a=f[6],o=f[7]):(f=[a,o,a,o,l,c,l,c],a=l,o=c);var _=A(h,f,n);if(n)p+=_;else{for(var w=0,M=_.length;w<M;w++)_[w].segment1=g,_[w].segment2=m,_[w].bez1=h,_[w].bez2=f;p=p.concat(_)}}}}}return p},I=function(t,e){return P(t,e)};function T(t,e){var n=[],r=[];function i(t,e){if(1===t.length)n.push(t[0]),r.push(t[0]);else{for(var a=[],o=0;o<t.length-1;o++)0===o&&n.push(t[0]),o===t.length-2&&r.push(t[o+1]),a[o]=[(1-e)*t[o][0]+e*t[o+1][0],(1-e)*t[o][1]+e*t[o+1][1]];i(a,e)}}return t.length&&i(t,e),{left:n,right:r.reverse()}}function O(t,e,n){var r=[[t[1],t[2]]];n=n||2;var i=[];"A"===e[0]?(r.push(e[6]),r.push(e[7])):"C"===e[0]?(r.push([e[1],e[2]]),r.push([e[3],e[4]]),r.push([e[5],e[6]])):"S"===e[0]||"Q"===e[0]?(r.push([e[1],e[2]]),r.push([e[3],e[4]])):r.push([e[1],e[2]]);for(var a=r,o=1/n,s=0;s<n-1;s++){var u=o/(1-o*s),l=T(a,u);i.push(l.left),a=l.right}i.push(a);var c=i.map(function(t){var e=[];return 4===t.length&&(e.push("C"),e=e.concat(t[2])),t.length>=3&&(3===t.length&&e.push("Q"),e=e.concat(t[1])),2===t.length&&e.push("L"),e=e.concat(t[t.length-1]),e});return c}var E=function(t,e,n){if(1===n)return[[].concat(t)];var r=[];if("L"===e[0]||"C"===e[0]||"Q"===e[0])r=r.concat(O(t,e,n));else{var i=[].concat(t);"M"===i[0]&&(i[0]="L");for(var a=0;a<=n-1;a++)r.push(i)}return r},L=function(t,e){if(1===t.length)return t;var n=t.length-1,r=e.length-1,i=n/r,a=[];if(1===t.length&&"M"===t[0][0]){for(var o=0;o<r-n;o++)t.push(t[0]);return t}for(var s=0;s<r;s++){var u=Math.floor(i*s);a[u]=(a[u]||0)+1}var l=a.reduce(function(e,r,i){return i===n?e.concat(t[n]):e.concat(E(t[i],t[i+1],r))},[]);return l.unshift(t[0]),"Z"!==e[r]&&"z"!==e[r]||l.push("Z"),l},D=function(t,e){if(t.length!==e.length)return!1;var n=!0;return r.each(t,function(t,r){if(t!==e[r])return n=!1,!1}),n};function F(t,e,n){var r=null,i=n;return e<i&&(i=e,r="add"),t<i&&(i=t,r="del"),{type:r,min:i}}var R=function(t,e){var n,r,i=t.length,a=e.length,o=0;if(0===i||0===a)return null;for(var s=[],u=0;u<=i;u++)s[u]=[],s[u][0]={min:u};for(var l=0;l<=a;l++)s[0][l]={min:l};for(var c=1;c<=i;c++){n=t[c-1];for(var h=1;h<=a;h++){r=e[h-1],o=D(n,r)?0:1;var f=s[c-1][h].min+1,p=s[c][h-1].min+1,d=s[c-1][h-1].min+o;s[c][h]=F(f,p,d)}}return s},j=function(t,e){var n=R(t,e),r=t.length,i=e.length,a=[],o=1,s=1;if(n[r][i]!==r){for(var u=1;u<=r;u++){var l=n[u][u].min;s=u;for(var c=o;c<=i;c++)n[u][c].min<l&&(l=n[u][c].min,s=c);o=s,n[u][o].type&&a.push({index:u-1,type:n[u][o].type})}for(var h=a.length-1;h>=0;h--)o=a[h].index,"add"===a[h].type?t.splice(o,0,[].concat(t[o])):t.splice(o,1)}r=t.length;var f=i-r;if(r<i)for(var p=0;p<f;p++)"z"===t[r-1][0]||"Z"===t[r-1][0]?t.splice(r-2,0,t[r-2]):t.push(t[r-1]),r+=1;return t};function B(t,e,n){for(var r,i=[].concat(t),a=1/(n+1),o=N(e)[0],s=1;s<=n;s++)a*=s,r=Math.floor(t.length*a),0===r?i.unshift([o[0]*a+t[r][0]*(1-a),o[1]*a+t[r][1]*(1-a)]):i.splice(r,0,[o[0]*a+t[r][0]*(1-a),o[1]*a+t[r][1]*(1-a)]);return i}function N(t){var e=[];switch(t[0]){case"M":e.push([t[1],t[2]]);break;case"L":e.push([t[1],t[2]]);break;case"A":e.push([t[6],t[7]]);break;case"Q":e.push([t[3],t[4]]),e.push([t[1],t[2]]);break;case"T":e.push([t[1],t[2]]);break;case"C":e.push([t[5],t[6]]),e.push([t[1],t[2]]),e.push([t[3],t[4]]);break;case"S":e.push([t[3],t[4]]),e.push([t[1],t[2]]);break;case"H":e.push([t[1],t[1]]);break;case"V":e.push([t[1],t[1]]);break;default:}return e}var z=function(t,e){if(t.length<=1)return t;for(var n,r=0;r<e.length;r++)if(t[r][0]!==e[r][0])switch(n=N(t[r]),e[r][0]){case"M":t[r]=["M"].concat(n[0]);break;case"L":t[r]=["L"].concat(n[0]);break;case"A":t[r]=[].concat(e[r]),t[r][6]=n[0][0],t[r][7]=n[0][1];break;case"Q":if(n.length<2){if(!(r>0)){t[r]=e[r];break}n=B(n,t[r-1],1)}t[r]=["Q"].concat(n.reduce(function(t,e){return t.concat(e)},[]));break;case"T":t[r]=["T"].concat(n[0]);break;case"C":if(n.length<3){if(!(r>0)){t[r]=e[r];break}n=B(n,t[r-1],2)}t[r]=["C"].concat(n.reduce(function(t,e){return t.concat(e)},[]));break;case"S":if(n.length<2){if(!(r>0)){t[r]=e[r];break}n=B(n,t[r-1],1)}t[r]=["S"].concat(n.reduce(function(t,e){return t.concat(e)},[]));break;default:t[r]=e[r]}return t};t.exports={parsePathString:s,parsePathArray:v,pathTocurve:d,pathToAbsolute:c,catmullRomToBezier:u,rectPath:w,fillPath:L,fillPathByDiff:j,formatPath:z,intersection:I}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.setMatrixArrayType=i,e.toRadian=o,e.equals=s;var r=e.EPSILON=1e-6;e.ARRAY_TYPE="undefined"!==typeof Float32Array?Float32Array:Array,e.RANDOM=Math.random;function i(t){e.ARRAY_TYPE=t}var a=Math.PI/180;function o(t){return t*a}function s(t,e){return Math.abs(t-e)<=r*Math.max(1,Math.abs(t),Math.abs(e))}},function(t,e,n){var r=n(6),i=n(4),a=n(2);t.exports=function(t,e){for(var n=[],o={},s=0;s<t.length;s++){var u=t[s],l=u[e];r(l)||(i(l)||(l=[l]),a(l,function(t){o[t]||(n.push(t),o[t]=!0)}))}return n}},function(t,e,n){var r="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i=n(4),a=function t(e){if("object"!==("undefined"===typeof e?"undefined":r(e))||null===e)return e;var n=void 0;if(i(e)){n=[];for(var a=0,o=e.length;a<o;a++)"object"===r(e[a])&&null!=e[a]?n[a]=t(e[a]):n[a]=e[a]}else for(var s in n={},e)"object"===r(e[s])&&null!=e[s]?n[s]=t(e[s]):n[s]=e[s];return n};t.exports=a},function(t,e,n){var r=n(39),i=n(4),a=5;function o(t,e,n,s){for(var u in n=n||0,s=s||a,e)if(e.hasOwnProperty(u)){var l=e[u];null!==l&&r(l)?(r(t[u])||(t[u]={}),n<s?o(t[u],l,n+1,s):t[u]=e[u]):i(l)?(t[u]=[],t[u]=t[u].concat(l)):void 0!==l&&(t[u]=l)}}var s=function(){for(var t=new Array(arguments.length),e=t.length,n=0;n<e;n++)t[n]=arguments[n];for(var r=t[0],i=1;i<e;i++)o(r,t[i]);return r};t.exports=s},function(t,e,n){var r=n(2),i=n(20),a=function(t,e){if(!i(t))return t;var n=[];return r(t,function(t,r){e(t,r)&&n.push(t)}),n};t.exports=a},function(t,e,n){var r=n(80),i=n(20),a=n(15),o=function t(e,n){if(e===n)return!0;if(!e||!n)return!1;if(a(e)||a(n))return!1;if(i(e)||i(n)){if(e.length!==n.length)return!1;for(var o=!0,s=0;s<e.length;s++)if(o=t(e[s],n[s]),!o)break;return o}if(r(e)||r(n)){var u=Object.keys(e),l=Object.keys(n);if(u.length!==l.length)return!1;for(var c=!0,h=0;h<u.length;h++)if(c=t(e[u[h]],n[u[h]]),!c)break;return c}return!1};t.exports=o},function(t,e){var n=function(t,e,n){return t<e?e:t>n?n:t};t.exports=n},function(t,e,n){var r=n(332);r.translate=function(t,e,n){var i=new Array(9);return r.fromTranslation(i,n),r.multiply(t,i,e)},r.rotate=function(t,e,n){var i=new Array(9);return r.fromRotation(i,n),r.multiply(t,i,e)},r.scale=function(t,e,n){var i=new Array(9);return r.fromScaling(i,n),r.multiply(t,i,e)},t.exports=r},function(t,e){var n="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r=function(t){return"object"===("undefined"===typeof t?"undefined":n(t))&&null!==t};t.exports=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r={Chart:"deleteChart",Coord:"deleteCoord",Geom:"deleteGeom",Axis:"deleteAxis",Tooltip:"deleteTooltip",Legend:"deleteLegend",Label:"deleteLabel",View:"deleteView",Guide:"deleteGuide",GuideLine:"deleteTypedGuide",GuideImage:"deleteTypedGuide",GuideText:"deleteTypedGuide",GuideRegion:"deleteTypedGuide",GuideHtml:"deleteTypedGuide",GuideArc:"deleteTypedGuide",GuideRegionFilter:"deleteTypedGuide",GuideDataMarker:"deleteTypedGuide",GuideDataRegion:"deleteTypedGuide",Facet:"deleteFacet"},i={merge:function(t,e,n,r){this.mergeDelete(t,e,n),this.mergeUpdate(t,r)},mergeDelete:function(t,e,n){var i=this;Object.keys(e).forEach(function(e){var a=r[n[e].name],o=t;n[e].viewId&&(o=t.views[n[e].viewId]),i[a]&&i[a](o,e,n[e].parentInfo.id)})},deleteAxis:function(t,e){t&&delete t.axises[e]},deleteTooltip:function(t){t&&delete t.tooltip},deleteCoord:function(t){t&&delete t.coord},deleteLegend:function(t,e){t&&delete t.legends[e]},deleteGuide:function(t){t&&delete t.guide},deleteGeom:function(t,e){t&&t.geoms&&delete t.geoms[e]},deleteLabel:function(t,e,n){t&&t.geoms&&t.geoms[n]&&delete t.geoms[n].label},deleteFacet:function(t){t&&delete t.facet},deleteTypedGuide:function(t,e){t&&t.guide&&delete t.guide.elements[e]},deleteView:function(t,e){t&&delete t.views[e]},mergeUpdate:function(t,e){this.mergeChart(t,e),this.mergeAxises(t,e),this.mergeCoord(t,e),this.mergeGeoms(t.geoms,e),this.mergeLegends(t.legends,e),this.mergeTooltip(t,e),this.mergeViews(t.views,e),this.mergeGuide(t.guide,e)},mergeChart:function(t,e){t.chart&&t.chart.updateProps&&(t.chart.props=t.chart.updateProps),e&&delete t.chart.g2Instance},mergeAxises:function(t,e){var n=t.axises;if(null!=!n)for(var r in n)n[r]&&n[r].updateProps&&(n[r].props=n[r].updateProps),e&&delete n[r].g2Instance},mergeTooltip:function(t,e){t.tooltip&&(e&&delete t.tooltip.g2Instance,t.tooltip.updateProps&&(t.tooltip.props=t.tooltip.updateProps))},mergeCoord:function(t,e){t.coord&&(e&&delete t.coord.g2Instance,t.coord.updateProps&&(t.coord.props=t.coord.updateProps))},mergeLegends:function(t,e){if(t)for(var n in t)if(t[n]){var r=t[n];e&&delete r.g2Instance,r.updateProps&&(r.props=r.updateProps)}},mergeGeoms:function(t,e){if(null!=t)for(var n in t)t[n]&&(e&&(delete t[n].g2Instance,t[n].label&&t[n].label.g2Instance&&(t[n].label.updateProps&&(t[n].label.props=t[n].label.updateProps),delete t[n].label.g2Instance)),t[n].updateProps&&(t[n].props=t[n].updateProps))},mergeGuide:function(t,e){if(null!=t){var n=t.elements;for(var r in n)n[r]&&(e&&delete n[r].g2Instance,n[r].updateProps&&(n[r].props=n[r].updateProps))}},mergeView:function(t,e){t&&(e&&t.g2Instance&&delete t.g2Instance,t.updateProps&&(t.props=t.updateProps),this.mergeCoord(t,e),this.mergeAxises(t,e),this.mergeGeoms(t.geoms,e),this.mergeGuide(t.guide,e))},mergeViews:function(t,e){if(null!=t)for(var n in t)t[n]&&this.mergeView(t[n],e)}};e.default=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Prop=e.Util=void 0;var r=n(54),i=s(r),a=n(422),o=s(a);function s(t){return t&&t.__esModule?t:{default:t}}e.Util=i.default,e.Prop=o.default},function(t,e,n){"use strict";e["c"]=i,n.d(e,"e",function(){return a}),n.d(e,"d",function(){return o}),e["h"]=x,e["b"]=w,e["g"]=M,e["a"]=S,e["f"]=P;var r=n(84);function i(){}var a=.7,o=1/a,s="\\s*([+-]?\\d+)\\s*",u="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",l="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",c=/^#([0-9a-f]{3})$/,h=/^#([0-9a-f]{6})$/,f=new RegExp("^rgb\\("+[s,s,s]+"\\)$"),p=new RegExp("^rgb\\("+[l,l,l]+"\\)$"),d=new RegExp("^rgba\\("+[s,s,s,u]+"\\)$"),g=new RegExp("^rgba\\("+[l,l,l,u]+"\\)$"),v=new RegExp("^hsl\\("+[u,l,l]+"\\)$"),y=new RegExp("^hsla\\("+[u,l,l,u]+"\\)$"),m={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function x(t){var e;return t=(t+"").trim().toLowerCase(),(e=c.exec(t))?(e=parseInt(e[1],16),new S(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1)):(e=h.exec(t))?b(parseInt(e[1],16)):(e=f.exec(t))?new S(e[1],e[2],e[3],1):(e=p.exec(t))?new S(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=d.exec(t))?_(e[1],e[2],e[3],e[4]):(e=g.exec(t))?_(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=v.exec(t))?k(e[1],e[2]/100,e[3]/100,1):(e=y.exec(t))?k(e[1],e[2]/100,e[3]/100,e[4]):m.hasOwnProperty(t)?b(m[t]):"transparent"===t?new S(NaN,NaN,NaN,0):null}function b(t){return new S(t>>16&255,t>>8&255,255&t,1)}function _(t,e,n,r){return r<=0&&(t=e=n=NaN),new S(t,e,n,r)}function w(t){return t instanceof i||(t=x(t)),t?(t=t.rgb(),new S(t.r,t.g,t.b,t.opacity)):new S}function M(t,e,n,r){return 1===arguments.length?w(t):new S(t,e,n,null==r?1:r)}function S(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function C(t){return t=Math.max(0,Math.min(255,Math.round(t)||0)),(t<16?"0":"")+t.toString(16)}function k(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new I(t,e,n,r)}function A(t){if(t instanceof I)return new I(t.h,t.s,t.l,t.opacity);if(t instanceof i||(t=x(t)),!t)return new I;if(t instanceof I)return t;t=t.rgb();var e=t.r/255,n=t.g/255,r=t.b/255,a=Math.min(e,n,r),o=Math.max(e,n,r),s=NaN,u=o-a,l=(o+a)/2;return u?(s=e===o?(n-r)/u+6*(n<r):n===o?(r-e)/u+2:(e-n)/u+4,u/=l<.5?o+a:2-o-a,s*=60):u=l>0&&l<1?0:s,new I(s,u,l,t.opacity)}function P(t,e,n,r){return 1===arguments.length?A(t):new I(t,e,n,null==r?1:r)}function I(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function T(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}n.i(r["a"])(i,x,{displayable:function(){return this.rgb().displayable()},hex:function(){return this.rgb().hex()},toString:function(){return this.rgb()+""}}),n.i(r["a"])(S,M,n.i(r["b"])(i,{brighter:function(t){return t=null==t?o:Math.pow(o,t),new S(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?a:Math.pow(a,t),new S(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return 0<=this.r&&this.r<=255&&0<=this.g&&this.g<=255&&0<=this.b&&this.b<=255&&0<=this.opacity&&this.opacity<=1},hex:function(){return"#"+C(this.r)+C(this.g)+C(this.b)},toString:function(){var t=this.opacity;return t=isNaN(t)?1:Math.max(0,Math.min(1,t)),(1===t?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}})),n.i(r["a"])(I,P,n.i(r["b"])(i,{brighter:function(t){return t=null==t?o:Math.pow(o,t),new I(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?a:Math.pow(a,t),new I(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new S(T(t>=240?t-240:t+120,i,r),T(t,i,r),T(t<120?t+240:t-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1}}))},function(t,e,n){"use strict";function r(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}e["b"]=r,e["a"]=function(t,e,n){t.prototype=e.prototype=n,n.constructor=t}},function(t,e,n){"use strict";function r(t,e,n,r,i){var a=t*t,o=a*t;return((1-3*t+3*a-o)*e+(4-6*a+3*o)*n+(1+3*t+3*a-3*o)*r+o*i)/6}e["b"]=r,e["a"]=function(t){var e=t.length-1;return function(n){var i=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),a=t[i],o=t[i+1],s=i>0?t[i-1]:2*a-o,u=i<e-1?t[i+2]:2*o-a;return r((n-i/e)*e,s,a,o,u)}}},function(t,e,n){"use strict";var r=n(12),i=n(199),a=n(194),o=n(197),s=n(55),u=n(198),l=n(200),c=n(196);e["a"]=function(t,e){var h,f=typeof e;return null==e||"boolean"===f?n.i(c["a"])(e):("number"===f?s["a"]:"string"===f?(h=n.i(r["f"])(e))?(e=h,i["a"]):l["a"]:e instanceof r["f"]?i["a"]:e instanceof Date?o["a"]:Array.isArray(e)?a["a"]:"function"!==typeof e.valueOf&&"function"!==typeof e.toString||isNaN(e)?u["a"]:s["a"])(t,e)}},function(t,e,n){"use strict";function r(t,e,n,r,i){var a=t*t,o=a*t;return((1-3*t+3*a-o)*e+(4-6*a+3*o)*n+(1+3*t+3*a-3*o)*r+o*i)/6}e["b"]=r,e["a"]=function(t){var e=t.length-1;return function(n){var i=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),a=t[i],o=t[i+1],s=i>0?t[i-1]:2*a-o,u=i<e-1?t[i+2]:2*o-a;return r((n-i/e)*e,s,a,o,u)}}},function(t,e,n){"use strict";n(89),n(201),n(87),n(202),n(204),n(450),n(453);var r=n(56);n.d(e,"b",function(){return r["a"]});n(205),n(457);var i=n(207);n.d(e,"d",function(){return i["a"]});var a=n(459);n.d(e,"a",function(){return a["a"]}),n.d(e,"e",function(){return a["b"]});n(461);var o=n(206);n.d(e,"c",function(){return o["a"]});n(452),n(454),n(451),n(449),n(455),n(456)},function(t,e,n){"use strict";var r=n(12),i=n(206),a=n(201),o=n(204),s=n(56),u=n(205),l=n(207),c=n(203);e["a"]=function(t,e){var h,f=typeof e;return null==e||"boolean"===f?n.i(c["a"])(e):("number"===f?s["a"]:"string"===f?(h=n.i(r["f"])(e))?(e=h,i["a"]):l["a"]:e instanceof r["f"]?i["a"]:e instanceof Date?o["a"]:Array.isArray(e)?a["a"]:"function"!==typeof e.valueOf&&"function"!==typeof e.toString||isNaN(e)?u["a"]:s["a"])(t,e)}},function(t,e,n){"use strict";var r=n(91);e["a"]=function(t){var e=t+="",n=e.indexOf(":");return n>=0&&"xmlns"!==(e=t.slice(0,n))&&(t=t.slice(n+1)),r["a"].hasOwnProperty(e)?{space:r["a"][e],local:t}:t}},function(t,e,n){"use strict";n.d(e,"b",function(){return r});var r="http://www.w3.org/1999/xhtml";e["a"]={svg:"http://www.w3.org/2000/svg",xhtml:r,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"}},function(t,e,n){"use strict";n.d(e,"a",function(){return i}),e["b"]=h;var r={},i=null;if("undefined"!==typeof document){var a=document.documentElement;"onmouseenter"in a||(r={mouseenter:"mouseover",mouseleave:"mouseout"})}function o(t,e,n){return t=s(t,e,n),function(e){var n=e.relatedTarget;n&&(n===this||8&n.compareDocumentPosition(this))||t.call(this,e)}}function s(t,e,n){return function(r){var a=i;i=r;try{t.call(this,this.__data__,e,n)}finally{i=a}}}function u(t){return t.trim().split(/^|\s+/).map(function(t){var e="",n=t.indexOf(".");return n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),{type:t,name:e}})}function l(t){return function(){var e=this.__on;if(e){for(var n,r=0,i=-1,a=e.length;r<a;++r)n=e[r],t.type&&n.type!==t.type||n.name!==t.name?e[++i]=n:this.removeEventListener(n.type,n.listener,n.capture);++i?e.length=i:delete this.__on}}}function c(t,e,n){var i=r.hasOwnProperty(t.type)?o:s;return function(r,a,o){var s,u=this.__on,l=i(e,a,o);if(u)for(var c=0,h=u.length;c<h;++c)if((s=u[c]).type===t.type&&s.name===t.name)return this.removeEventListener(s.type,s.listener,s.capture),this.addEventListener(s.type,s.listener=l,s.capture=n),void(s.value=e);this.addEventListener(t.type,l,n),s={type:t.type,name:t.name,value:e,listener:l,capture:n},u?u.push(s):this.__on=[s]}}function h(t,e,n,r){var a=i;t.sourceEvent=i,i=t;try{return e.apply(n,r)}finally{i=a}}e["c"]=function(t,e,n){var r,i,a=u(t+""),o=a.length;if(!(arguments.length<2)){for(s=e?c:l,null==n&&(n=!1),r=0;r<o;++r)this.each(s(a[r],e,n));return this}var s=this.node().__on;if(s)for(var h,f=0,p=s.length;f<p;++f)for(r=0,h=s[f];r<o;++r)if((i=a[r]).type===h.type&&i.name===h.name)return h.value}},function(t,e,n){"use strict";function r(){}e["a"]=function(t){return null==t?r:function(){return this.querySelector(t)}}},function(t,e,n){"use strict";var r=n(92);e["a"]=function(){var t,e=r["a"];while(t=e.sourceEvent)e=t;return e}},function(t,e,n){"use strict";e["a"]=function(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(97);n.d(e,"now",function(){return r["a"]}),n.d(e,"timer",function(){return r["b"]}),n.d(e,"timerFlush",function(){return r["c"]});var i=n(498);n.d(e,"timeout",function(){return i["a"]});var a=n(497);n.d(e,"interval",function(){return a["a"]})},function(t,e,n){"use strict";e["a"]=d,e["d"]=v,e["b"]=y,e["c"]=m;var r,i,a=0,o=0,s=0,u=1e3,l=0,c=0,h=0,f="object"===typeof performance&&performance.now?performance:Date,p="object"===typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function d(){return c||(p(g),c=f.now()+h)}function g(){c=0}function v(){this._call=this._time=this._next=null}function y(t,e,n){var r=new v;return r.restart(t,e,n),r}function m(){d(),++a;var t,e=r;while(e)(t=c-e._time)>=0&&e._call.call(null,t),e=e._next;--a}function x(){c=(l=f.now())+h,a=o=0;try{m()}finally{a=0,_(),c=0}}function b(){var t=f.now(),e=t-l;e>u&&(h-=e,l=t)}function _(){var t,e,n=r,a=1/0;while(n)n._call?(a>n._time&&(a=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:r=e);i=t,w(a)}function w(t){if(!a){o&&(o=clearTimeout(o));var e=t-c;e>24?(t<1/0&&(o=setTimeout(x,t-f.now()-h)),s&&(s=clearInterval(s))):(s||(l=f.now(),s=setInterval(b,u)),a=1,p(x))}}v.prototype=y.prototype={constructor:v,restart:function(t,e,n){if("function"!==typeof t)throw new TypeError("callback is not a function");n=(null==n?d():+n)+(null==e?0:+e),this._next||i===this||(i?i._next=this:r=this,i=this),this._call=t,this._time=n,w()},stop:function(){this._call&&(this._call=null,this._time=1/0,w())}}},function(t,e,n){var r;(function(e){"use strict";function i(){}var a=i.prototype,o=e.EventEmitter;function s(t,e){var n=t.length;while(n--)if(t[n].listener===e)return n;return-1}function u(t){return function(){return this[t].apply(this,arguments)}}function l(t){return"function"===typeof t||t instanceof RegExp||!(!t||"object"!==typeof t)&&l(t.listener)}a.getListeners=function(t){var e,n,r=this._getEvents();if(t instanceof RegExp)for(n in e={},r)r.hasOwnProperty(n)&&t.test(n)&&(e[n]=r[n]);else e=r[t]||(r[t]=[]);return e},a.flattenListeners=function(t){var e,n=[];for(e=0;e<t.length;e+=1)n.push(t[e].listener);return n},a.getListenersAsObject=function(t){var e,n=this.getListeners(t);return n instanceof Array&&(e={},e[t]=n),e||n},a.addListener=function(t,e){if(!l(e))throw new TypeError("listener must be a function");var n,r=this.getListenersAsObject(t),i="object"===typeof e;for(n in r)r.hasOwnProperty(n)&&-1===s(r[n],e)&&r[n].push(i?e:{listener:e,once:!1});return this},a.on=u("addListener"),a.addOnceListener=function(t,e){return this.addListener(t,{listener:e,once:!0})},a.once=u("addOnceListener"),a.defineEvent=function(t){return this.getListeners(t),this},a.defineEvents=function(t){for(var e=0;e<t.length;e+=1)this.defineEvent(t[e]);return this},a.removeListener=function(t,e){var n,r,i=this.getListenersAsObject(t);for(r in i)i.hasOwnProperty(r)&&(n=s(i[r],e),-1!==n&&i[r].splice(n,1));return this},a.off=u("removeListener"),a.addListeners=function(t,e){return this.manipulateListeners(!1,t,e)},a.removeListeners=function(t,e){return this.manipulateListeners(!0,t,e)},a.manipulateListeners=function(t,e,n){var r,i,a=t?this.removeListener:this.addListener,o=t?this.removeListeners:this.addListeners;if("object"!==typeof e||e instanceof RegExp){r=n.length;while(r--)a.call(this,e,n[r])}else for(r in e)e.hasOwnProperty(r)&&(i=e[r])&&("function"===typeof i?a.call(this,r,i):o.call(this,r,i));return this},a.removeEvent=function(t){var e,n=typeof t,r=this._getEvents();if("string"===n)delete r[t];else if(t instanceof RegExp)for(e in r)r.hasOwnProperty(e)&&t.test(e)&&delete r[e];else delete this._events;return this},a.removeAllListeners=u("removeEvent"),a.emitEvent=function(t,e){var n,r,i,a,o,s=this.getListenersAsObject(t);for(a in s)if(s.hasOwnProperty(a))for(n=s[a].slice(0),i=0;i<n.length;i++)r=n[i],!0===r.once&&this.removeListener(t,r.listener),o=r.listener.apply(this,e||[]),o===this._getOnceReturnValue()&&this.removeListener(t,r.listener);return this},a.trigger=u("emitEvent"),a.emit=function(t){var e=Array.prototype.slice.call(arguments,1);return this.emitEvent(t,e)},a.setOnceReturnValue=function(t){return this._onceReturnValue=t,this},a._getOnceReturnValue=function(){return!this.hasOwnProperty("_onceReturnValue")||this._onceReturnValue},a._getEvents=function(){return this._events||(this._events={})},i.noConflict=function(){return e.EventEmitter=o,i},r=function(){return i}.call(e,n,e,t),void 0===r||(t.exports=r)})(this||{})},function(t,e,n){var r=0,i=n(2),a={values:n(73)};t.exports={isAdjust:function(t){return this.adjustNames.indexOf(t)>=0},_getDimValues:function(t){var e=this,n={},o=[];if(e.xField&&e.isAdjust("x")&&o.push(e.xField),e.yField&&e.isAdjust("y")&&o.push(e.yField),i(o,function(e){var r=a.values(t,e);r.sort(function(t,e){return t-e}),n[e]=r}),!e.yField&&e.isAdjust("y")){var s="y",u=[r,1];n[s]=u}return n},adjustData:function(t,e){var n=this,r=n._getDimValues(e);i(t,function(e,a){i(r,function(r,i){n.adjustDim(i,r,e,t.length,a)})})},getAdjustRange:function(t,e,n){var r,i,a=this,o=n.indexOf(e),s=n.length;return!a.yField&&a.isAdjust("y")?(r=0,i=1):s>1?(r=0===o?n[0]:n[o-1],i=o===s-1?n[s-1]:n[o+1],0!==o?r+=(e-r)/2:r-=(i-e)/2,o!==s-1?i-=(i-e)/2:i+=(e-n[s-2])/2):(r=0===e?0:e-.5,i=0===e?1:e+.5),{pre:r,next:i}},groupData:function(t,e){var n={};return i(t,function(t){var i=t[e];void 0===i&&(i=t[e]=r),n[i]||(n[i]=[]),n[i].push(t)}),n}}},function(t,e,n){var r=n(11),i=n(15),a=n(2),o=/rgba?\(([\s.,0-9]+)\)/;function s(){var t=document.createElement("i");return t.title="Web Colour Picker",t.style.display="none",document.body.appendChild(t),t}function u(t,e,n,r){var i=t[r]+(e[r]-t[r])*n;return i}function l(t){return"#"+c(t[0])+c(t[1])+c(t[2])}function c(t){return t=Math.round(t),t=t.toString(16),1===t.length&&(t="0"+t),t}function h(t,e){(isNaN(e)||!r(e)||e<0)&&(e=0),e>1&&(e=1);var n=t.length-1,i=Math.floor(n*e),a=n*e-i,o=t[i],s=i===n?o:t[i+1],c=l([u(o,s,a,0),u(o,s,a,1),u(o,s,a,2)]);return c}function f(t){var e=[];return e.push(parseInt(t.substr(1,2),16)),e.push(parseInt(t.substr(3,2),16)),e.push(parseInt(t.substr(5,2),16)),e}var p={},d=null,g={toRGB:function(t){if("#"===t[0]&&7===t.length)return t;var e;if(d||(d=s()),p[t])e=p[t];else{d.style.color=t,e=document.defaultView.getComputedStyle(d,"").getPropertyValue("color");var n=o.exec(e),r=n[1].split(/\s*,\s*/);e=l(r),p[t]=e}return e},rgb2arr:f,gradient:function(t){var e=[];return i(t)&&(t=t.split("-")),a(t,function(t){-1===t.indexOf("#")&&(t=g.toRGB(t)),e.push(f(t))}),function(t){return h(e,t)}}};t.exports=g},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(35),a=i.Group,o=n(3),s=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.getDefaultCfg=function(){return{zIndex:1,type:"line",lineStyle:null,items:null,alternateColor:null,matrix:null,hideFirstLine:!1,hideLastLine:!1,hightLightZero:!1,zeroLineStyle:{stroke:"#595959",lineDash:[0,0]}}},n._renderUI=function(){t.prototype._renderUI.call(this),this._drawLines()},n._drawLines=function(){var t=this,e=t.get("lineStyle"),n=t.get("items");n&&n.length&&(t._precessItems(n),t._drawGridLines(n,e))},n._precessItems=function(t){var e,n=this;o.each(t,function(t,r){e&&n.get("alternateColor")&&n._drawAlternativeBg(t,e,r),e=t})},n._drawGridLines=function(t,e){var n,r,i,a,s=this,u=this.get("type"),l=t.length;"line"===u||"polygon"===u?o.each(t,function(t,c){s.get("hideFirstLine")&&0===c||s.get("hideLastLine")&&c===l-1||(a=t.points,r=[],"line"===u?(r.push(["M",a[0].x,a[0].y]),r.push(["L",a[a.length-1].x,a[a.length-1].y])):o.each(a,function(t,e){0===e?r.push(["M",t.x,t.y]):r.push(["L",t.x,t.y])}),i=s._drawZeroLine(u,c)?o.mix({},s.get("zeroLineStyle"),{path:r}):o.mix({},e,{path:r}),n=s.addShape("path",{attrs:i}),n.name="axis-grid",n._id=t._id,n.set("coord",s.get("coord")),s.get("appendInfo")&&n.setSilent("appendInfo",s.get("appendInfo")))}):o.each(t,function(t,u){s.get("hideFirstLine")&&0===u||s.get("hideLastLine")&&u===l-1||(a=t.points,r=[],o.each(a,function(t,e){var n=t.radius;0===e?r.push(["M",t.x,t.y]):r.push(["A",n,n,0,0,t.flag,t.x,t.y])}),i=o.mix({},e,{path:r}),n=s.addShape("path",{attrs:i}),n.name="axis-grid",n._id=t._id,n.set("coord",s.get("coord")),s.get("appendInfo")&&n.setSilent("appendInfo",s.get("appendInfo")))})},n._drawZeroLine=function(t,e){var n=this,r=n.get("tickValues");return!("line"!==t||!r||0!==r[e]||!n.get("hightLightZero"))},n._drawAlternativeBg=function(t,e,n){var r,i,a,s=this,u=s.get("alternateColor");o.isString(u)?i=u:o.isArray(u)&&(i=u[0],a=u[1]),n%2===0?a&&(r=s._getBackItem(e.points,t.points,a)):i&&(r=s._getBackItem(e.points,t.points,i));var l=s.addShape("Path",{attrs:r});l.name="axis-grid-rect",l._id=t._id&&t._id.replace("grid","grid-rect"),l.set("coord",s.get("coord")),s.get("appendInfo")&&l.setSilent("appendInfo",s.get("appendInfo"))},n._getBackItem=function(t,e,n){var r=[],i=this.get("type");if("line"===i)r.push(["M",t[0].x,t[0].y]),r.push(["L",t[t.length-1].x,t[t.length-1].y]),r.push(["L",e[e.length-1].x,e[e.length-1].y]),r.push(["L",e[0].x,e[0].y]),r.push(["Z"]);else if("polygon"===i){o.each(t,function(t,e){0===e?r.push(["M",t.x,t.y]):r.push(["L",t.x,t.y])});for(var a=e.length-1;a>=0;a--)r.push(["L",e[a].x,e[a].y]);r.push(["Z"])}else{var s=t[0].flag;o.each(t,function(t,e){var n=t.radius;0===e?r.push(["M",t.x,t.y]):r.push(["A",n,n,0,0,t.flag,t.x,t.y])});for(var u=e.length-1;u>=0;u--){var l=e[u],c=l.radius;u===e.length-1?r.push(["M",l.x,l.y]):r.push(["A",c,c,0,0,1===s?0:1,l.x,l.y])}}return{fill:n,path:r}},e}(a);t.exports=s},function(t,e,n){var r=n(3);t.exports={getFirstScale:function(t){var e;return r.each(t,function(t){if(t)return e=t,!1}),e}}},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(3),a=i.DomUtil,o=n(34),s=n(248),u=n(249),l=n(247),c={scatter:s,map:u,treemap:l},h=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return i.mix({},e,{name:"label",type:"default",textStyle:null,formatter:null,items:null,useHtml:!1,containerTpl:'<div class="g-labels" style="position:absolute;top:0;left:0;"></div>',itemTpl:'<div class="g-label" style="position:absolute;">{text}</div>',labelLine:!1,lineGroup:null,shapes:null,config:!0,capture:!0})},n.clear=function(){var e=this.get("group"),n=this.get("container");e&&!e.get("destroyed")&&e.clear(),n&&(n.innerHTML=""),t.prototype.clear.call(this)},n.destroy=function(){var t=this.get("group"),e=this.get("container");t.destroy||t.destroy(),e&&(e.innerHTML="")},n.render=function(){this.clear(),this._init(),this.beforeDraw(),this.draw(),this.afterDraw()},n._dryDraw=function(){var t=this,e=t.get("items"),n=t.getLabels(),r=n.length;i.each(e,function(e,i){if(i<r){var a=n[i];t.changeLabel(a,e)}else{var o=t._addLabel(e,i);o&&(o._id=e._id,o.set("coord",e.coord))}});for(var a=r-1;a>=e.length;a--)n[a].remove();t._adjustLabels(),!t.get("labelLine")&&t.get("config")||t.drawLines()},n.draw=function(){this._dryDraw(),this.get("canvas").draw()},n.changeLabel=function(t,e){if(t)if(t.tagName){var n=this._createDom(e);t.innerHTML=n.innerHTML,this._setCustomPosition(e,t)}else t._id=e._id,t.attr("text",e.text),t.attr("x")===e.x&&t.attr("y")===e.y||(t.resetMatrix(),e.textStyle.rotate&&(t.rotateAtStart(e.textStyle.rotate),delete e.textStyle.rotate),t.attr(e))},n.show=function(){var t=this.get("group"),e=this.get("container");t&&t.show(),e&&(e.style.opacity=1)},n.hide=function(){var t=this.get("group"),e=this.get("container");t&&t.hide(),e&&(e.style.opacity=0)},n.drawLines=function(){var t=this,e=t.get("labelLine");"boolean"===typeof e&&t.set("labelLine",{});var n=t.get("lineGroup");!n||n.get("destroyed")?(n=t.get("group").addGroup({elCls:"x-line-group"}),t.set("lineGroup",n)):n.clear(),i.each(t.get("items"),function(e){t.lineToLabel(e,n)})},n.lineToLabel=function(t,e){var n=this;if(n.get("config")||t.labelLine){var r=t.labelLine||n.get("labelLine"),a="undefined"===typeof t.capture?n.get("capture"):t.capture,o=r.path;if(o&&i.isFunction(r.path)&&(o=r.path(t)),!o){var s=t.start||{x:t.x-t._offset.x,y:t.y-t._offset.y};o=[["M",s.x,s.y],["L",t.x,t.y]]}var u=t.color;u||(u=t.textStyle&&t.textStyle.fill?t.textStyle.fill:"#000");var l=e.addShape("path",{attrs:i.mix({path:o,fill:null,stroke:u},r),capture:a});l.name=n.get("name"),l._id=t._id&&t._id.replace("glabel","glabelline"),l.set("coord",n.get("coord"))}},n._adjustLabels=function(){var t=this,e=t.get("type"),n=t.getLabels(),r=t.get("shapes"),i=c[e];"default"!==e&&i&&i(n,r)},n.getLabels=function(){var t=this.get("container");return t?i.toArray(t.childNodes):this.get("group").get("children")},n._addLabel=function(t,e){var n=t;return this.get("config")&&(n=this._getLabelCfg(t,e)),this._createText(n)},n._getLabelCfg=function(t,e){var n=this.get("textStyle")||{},r=this.get("formatter"),a=this.get("htmlTemplate");if(!i.isObject(t)){var o=t;t={},t.text=o}i.isFunction(n)&&(n=n(t.text,t,e)),r&&(t.text=r(t.text,t,e)),a&&(t.useHtml=!0,i.isFunction(a)&&(t.text=a(t.text,t,e))),i.isNil(t.text)&&(t.text=""),t.text=t.text+"";var s=i.mix({},t,{textStyle:n},{x:t.x||0,y:t.y||0});return s},n._init=function(){if(!this.get("group")){var t=this.get("canvas").addGroup({id:"label-group"});this.set("group",t)}},n.initHtmlContainer=function(){var t=this.get("container");if(t)i.isString(t)&&(t=document.getElementById(t),t&&this.set("container",t));else{var e=this.get("containerTpl"),n=this.get("canvas").get("el").parentNode;t=a.createDom(e),n.style.position="relative",n.appendChild(t),this.set("container",t)}return t},n._createText=function(t){var e,n=this.get("container"),r="undefined"===typeof t.capture?this.get("capture"):t.capture;if(!t.useHtml&&!t.htmlTemplate){var a=this.get("name"),o=t.point,s=this.get("group");delete t.point;var u=t.rotate;return t.textStyle&&(t.textStyle.rotate&&(u=t.textStyle.rotate,delete t.textStyle.rotate),t=i.mix({x:t.x,y:t.y,textAlign:t.textAlign,text:t.text},t.textStyle)),e=s.addShape("text",{attrs:t,capture:r}),u&&(Math.abs(u)>2*Math.PI&&(u=u/180*Math.PI),e.transform([["t",-t.x,-t.y],["r",u],["t",t.x,t.y]])),e.setSilent("origin",o||t),e.name=a,this.get("appendInfo")&&e.setSilent("appendInfo",this.get("appendInfo")),e}n||(n=this.initHtmlContainer());var l=this._createDom(t);n.appendChild(l),this._setCustomPosition(t,l)},n._createDom=function(t){var e=this.get("itemTpl"),n=i.substitute(e,{text:t.text});return a.createDom(n)},n._setCustomPosition=function(t,e){var n=t.textAlign||"left",r=t.y,i=t.x,o=a.getOuterWidth(e),s=a.getOuterHeight(e);r-=s/2,"center"===n?i-=o/2:"right"===n&&(i-=o),e.style.top=parseInt(r,10)+"px",e.style.left=parseInt(i,10)+"px"},e}(o);t.exports=h},function(t,e){var n=function(){function t(){this.bitmap=[]}var e=t.prototype;return e.hasGap=function(t){for(var e=!0,n=this.bitmap,r=Math.floor(t.minX),i=Math.ceil(t.maxX),a=Math.floor(t.minY),o=Math.ceil(t.maxY)-1,s=r;s<i;s++)if(n[s]){if(s===r||s===i-1){for(var u=a;u<=o;u++)if(n[s][u]){e=!1;break}}else if(n[s][a]||n[s][o]){e=!1;break}}else n[s]=[];return e},e.fillGap=function(t){for(var e=this.bitmap,n=Math.floor(t.minX),r=Math.ceil(t.maxX)-1,i=Math.floor(t.minY),a=Math.ceil(t.maxY)-1,o=n;o<=r;o++){for(var s=i;s<a;s+=8)e[o]||(e[o]=[]),e[o][s]=!0;e[o][a]=!0}for(var u=i;u<=a;u++)e[n][u]=!0,e[r][u]=!0},t}();t.exports=n},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(3),a=n(34),o=n(18),s=o.FONT_FAMILY,u=function(t){r(n,t);var e=n.prototype;function n(e){var n;return n=t.call(this,e)||this,n._init(),n.beforeRender(),n.render(),n._adjustPositionOffset(),n._bindEvents(),n}return e.getDefaultCfg=function(){return{container:null,title:null,formatter:null,hoverable:!0,titleGap:15,position:[0,0],offset:[0,0],offsetX:null,offsetY:null}},e._init=function(){var t=this.get("group"),e=this.get("container");this.set("canvas",e.get("canvas"));var n=this.get("position");t||(t=e.addGroup({x:0-n[0],y:0-n[1]})),this.set("group",t)},e._adjustPositionOffset=function(){var t=this.get("position"),e=this.get("offset"),n=this.get("offsetX"),r=this.get("offsetY");if(!i.isArray(e)){var a=this.get("layout");e="vertical"===a?[e,0]:[0,e]}n&&(e[0]=n),r&&(e[1]=r);var o=this.get("group").getBBox();this.move(-o.minX+t[0]+e[0],-o.minY+t[1]+e[1])},e.beforeRender=function(){var t=this.get("group"),e=t.addGroup();this.set("itemsGroup",e)},e.render=function(){this._renderTitle()},e._renderTitle=function(){var t=this.get("title"),e=this.get("titleGap");if(e=e||0,t&&t.text){var n=this.get("group"),r=n.addShape("text",{attrs:i.mix({x:0,y:0-e,fill:"#333",textBaseline:"middle",fontFamily:s},t)});r.name="legend-title",this.get("appendInfo")&&r.setSilent("appendInfo",this.get("appendInfo")),this.set("titleShape",r)}},e.getCheckedCount=function(){var t=this.get("itemsGroup"),e=t.get("children"),n=i.filter(e,function(t){return t.get("checked")});return n.length},e.setItems=function(t){this.set("items",t),this.clear(),this.render()},e.addItem=function(t){var e=this.get("items");e.push(t),this.clear(),this.render()},e.clear=function(){var t=this.get("itemsGroup");t.clear();var e=this.get("group");e.clear(),this.beforeRender()},e.destroy=function(){var t=this.get("group");t.destroy(),this._attrs={},this.removeAllListeners(),this.destroyed=!0},e.getWidth=function(){var t=this.get("group").getBBox();return t.width},e.getHeight=function(){var t=this.get("group").getBBox();return t.height},e.move=function(t,e){this.get("group").move(t,e)},e.draw=function(){this.get("canvas").draw()},n}(a);t.exports=u},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(3),a=n(107),o=n(18),s=o.FONT_FAMILY,u=i.DomUtil,l=i.Group,c="g2-legend",h="g2-legend-title",f="g2-legend-list",p="g2-legend-list-item",d="g2-legend-text",g="g2-legend-marker";function v(t,e){return t.getElementsByClassName(e)[0]}function y(t,e){var n=t.className;return i.isNil(n)?t:(n=n.split(" "),n.indexOf(e)>-1?t:t.parentNode?t.parentNode.className===c?t.parentNode:y(t.parentNode,e):null)}function m(t,e){var n=null,r=e instanceof l?e.get("value"):e;return i.each(t,function(t){if(t.value===r)return n=t,!1}),n}var x=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return i.mix({},e,{type:"category-legend",container:null,containerTpl:'<div class="'+c+'"><h4 class="'+h+'"></h4><ul class="'+f+'"></ul></div>',itemTpl:'<li class="'+p+' item-{index} {checked}" data-color="{originColor}" data-value="{originValue}"><i class="'+g+'" style="background-color:{color};"></i><span class="'+d+'">{value}</span></li>',legendStyle:{},textStyle:{fill:"#333",fontSize:12,textAlign:"middle",textBaseline:"top",fontFamily:s},abridgeText:!1,tipTpl:'<div class="textTip"></div>',tipStyle:{display:"none",fontSize:"12px",backgroundColor:"#fff",position:"absolute",width:"auto",height:"auto",padding:"3px",boxShadow:"2px 2px 5px #888"},autoPosition:!0})},n._init=function(){},n.beforeRender=function(){},n.render=function(){this._renderHTML()},n._bindEvents=function(){var t=this,e=this.get("legendWrapper"),n=v(e,f);this.get("hoverable")&&(n.onmousemove=function(e){return t._onMousemove(e)},n.onmouseout=function(e){return t._onMouseleave(e)}),this.get("clickable")&&(n.onclick=function(e){return t._onClick(e)})},n._onMousemove=function(t){var e=this.get("items"),n=t.target,r=n.className;if(r=r.split(" "),!(r.indexOf(c)>-1||r.indexOf(f)>-1)){var i=y(n,p),a=m(e,i.getAttribute("data-value"));a?(this.deactivate(),this.activate(i.getAttribute("data-value")),this.emit("itemhover",{item:a,currentTarget:i,checked:a.checked})):a||(this.deactivate(),this.emit("itemunhover",t))}},n._onMouseleave=function(t){this.deactivate(),this.emit("itemunhover",t)},n._onClick=function(t){var e=this,n=this.get("legendWrapper"),r=v(n,f),a=this.get("unCheckColor"),o=this.get("items"),s=this.get("selectedMode"),u=r.childNodes,l=t.target,h=l.className;if(h=h.split(" "),!(h.indexOf(c)>-1||h.indexOf(f)>-1)){var x=y(l,p),b=v(x,d),_=v(x,g),w=m(o,x.getAttribute("data-value"));if(w){var M=x.className,S=x.getAttribute("data-color");if("single"===s)w.checked=!0,i.each(u,function(t){if(t!==x){var n=v(t,g);n.style.backgroundColor=a,t.className=t.className.replace("checked","unChecked"),t.style.color=a;var r=m(o,t.getAttribute("data-value"));r.checked=!1}else b&&(b.style.color=e.get("textStyle").fill),_&&(_.style.backgroundColor=S),x.className=M.replace("unChecked","checked")});else{var C=-1!==M.indexOf("checked"),k=0;if(i.each(u,function(t){-1!==t.className.indexOf("checked")&&k++}),!this.get("allowAllCanceled")&&C&&1===k)return void this.emit("clicklastitem",{item:w,currentTarget:x,checked:"single"===s||w.checked});w.checked=!w.checked,C?(_&&(_.style.backgroundColor=a),x.className=M.replace("checked","unChecked"),x.style.color=a):(_&&(_.style.backgroundColor=S),x.className=M.replace("unChecked","checked"),x.style.color=this.get("textStyle").fill)}this.emit("itemclick",{item:w,currentTarget:x,checked:"single"===s||w.checked})}}},n.activate=function(t){var e=this,n=this,r=n.get("items"),i=m(r,t),a=n.get("legendWrapper"),o=v(a,f),s=o.childNodes;s.forEach(function(t){var a=v(t,g),o=m(r,t.getAttribute("data-value"));if(e.get("highlight")){if(o===i&&o.checked)return void(a.style.border="1px solid #333")}else o===i?a.style.opacity=n.get("activeOpacity"):o.checked&&(a.style.opacity=n.get("inactiveOpacity"))})},n.deactivate=function(){var t=this,e=this,n=e.get("legendWrapper"),r=v(n,f),i=r.childNodes;i.forEach(function(n){var r=v(n,g);t.get("highlight")?r.style.border="1px solid #fff":r.style.opacity=e.get("inactiveOpacity")})},n._renderHTML=function(){var t=this,e=this.get("container"),n=this.get("title"),r=this.get("containerTpl"),a=u.createDom(r),o=v(a,h),l=v(a,f),y=this.get("unCheckColor"),m=i.deepMix({},{CONTAINER_CLASS:{height:"auto",width:"auto",position:"absolute",overflowY:"auto",fontSize:"12px",fontFamily:s,lineHeight:"20px",color:"#8C8C8C"},TITLE_CLASS:{marginBottom:this.get("titleGap")+"px",fontSize:"12px",color:"#333",textBaseline:"middle",fontFamily:s},LIST_CLASS:{listStyleType:"none",margin:0,padding:0,textAlign:"center"},LIST_ITEM_CLASS:{cursor:"pointer",marginBottom:"5px",marginRight:"24px"},MARKER_CLASS:{width:"9px",height:"9px",borderRadius:"50%",display:"inline-block",marginRight:"4px",verticalAlign:"middle"}},this.get("legendStyle"));if(/^\#/.test(e)||"string"===typeof e&&e.constructor===String){var x=e.replace("#","");e=document.getElementById(x),e.appendChild(a)}else{var b=this.get("position"),_={};_="left"===b||"right"===b?{maxHeight:(this.get("maxLength")||e.offsetHeight)+"px"}:{maxWidth:(this.get("maxLength")||e.offsetWidth)+"px"},u.modifyCSS(a,i.mix({},m.CONTAINER_CLASS,_,this.get(c))),e.appendChild(a)}u.modifyCSS(l,i.mix({},m.LIST_CLASS,this.get(f))),o&&(n&&n.text?(o.innerHTML=n.text,u.modifyCSS(o,i.mix({},m.TITLE_CLASS,this.get(h),n))):a.removeChild(o));var w=this.get("items"),M=this.get("itemTpl"),S=this.get("position"),C=this.get("layout"),k="right"===S||"left"===S||"vertical"===C?"block":"inline-block",A=i.mix({},m.LIST_ITEM_CLASS,{display:k},this.get(p)),P=i.mix({},m.MARKER_CLASS,this.get(g));if(i.each(w,function(e,n){var r,o=e.checked,s=t._formatItemValue(e.value),c=e.marker.fill||e.marker.stroke,h=o?c:y;r=i.isFunction(M)?M(s,h,o,n):M;var f=i.substitute(r,i.mix({},e,{index:n,checked:o?"checked":"unChecked",value:s,color:h,originColor:c,originValue:e.value.replace(/\"/g,"&quot;")})),p=u.createDom(f);p.style.color=t.get("textStyle").fill;var m=v(p,g),x=v(p,d);if(u.modifyCSS(p,A),m&&u.modifyCSS(m,P),o||(p.style.color=y,m&&(m.style.backgroundColor=y)),l.appendChild(p),t.get("abridgeText")){var b=s,_=p.offsetWidth,w=t.get("textStyle").fontSize;isNaN(w)&&(-1!==w.indexOf("pt")?w=1*parseFloat(w.substr(0,w.length-2))/72*96:-1!==w.indexOf("px")&&(w=parseFloat(w.substr(0,w.length-2))));var S=w*b.length,C=Math.floor(_/w);_<2*w?b="":_<S&&C>1&&(b=b.substr(0,C-1)+"..."),x.innerText=b,p.addEventListener("mouseover",function(){var t=v(a.parentNode,"textTip");t.style.display="block",t.style.left=p.offsetLeft+p.offsetWidth+"px",t.style.top=p.offsetTop+15+"px",t.innerText=s}),p.addEventListener("mouseout",function(){var t=v(a.parentNode,"textTip");t.style.display="none"})}}),this.get("abridgeText")){var I=this.get("tipTpl"),T=u.createDom(I),O=this.get("tipStyle");u.modifyCSS(T,O),a.parentNode.appendChild(T),T.addEventListener("mouseover",function(){T.style.display="none"})}this.set("legendWrapper",a)},n._adjustPositionOffset=function(){var t=this.get("position"),e=this.get("offset"),n=this.get("offsetX"),r=this.get("offsetY");n&&(e[0]=n),r&&(e[1]=r);var i=this.get("legendWrapper");i.style.left=t[0]+"px",i.style.top=t[1]+"px",i.style.marginLeft=e[0]+"px",i.style.marginTop=e[1]+"px"},n.getWidth=function(){return u.getOuterWidth(this.get("legendWrapper"))},n.getHeight=function(){return u.getOuterHeight(this.get("legendWrapper"))},n.move=function(e,n){/^\#/.test(this.get("container"))?t.prototype.move.call(this,e,n):(u.modifyCSS(this.get("legendWrapper"),{left:e+"px",top:n+"px"}),this.set("x",e),this.set("y",n))},n.destroy=function(){var t=this.get("legendWrapper");t&&t.parentNode&&t.parentNode.removeChild(t)},e}(a);t.exports=x},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(3),a=n(105),o=n(18),s=o.FONT_FAMILY,u=i.Event,l=i.Group;function c(t,e){var n=null,r=e instanceof l||"legendGroup"===e.name?e.get("value"):e;return i.each(t,function(t){if(t.value===r)return n=t,!1}),n}function h(t,e){return t.findBy(function(t){return t.name===e})}var f=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return i.mix({},e,{type:"category-legend",items:null,itemGap:5,itemMarginBottom:8,itemsGroup:null,layout:"horizontal",allowAllCanceled:!1,backPadding:[0,0,0,0],unCheckColor:"#ccc",background:{fill:"#fff",fillOpacity:0},itemWidth:null,textStyle:{fill:"#333",fontSize:12,textAlign:"start",textBaseline:"middle",fontFamily:s},_wordSpaceing:8,clickable:!0,selectedMode:"multiple",reversed:!1,autoWrap:!0,highlight:!1,activeOpacity:.7,inactiveOpacity:1})},n.render=function(){t.prototype.render.call(this),this._renderItems(),this.get("autoWrap")&&this._adjustItems()},n._bindEvents=function(){this.get("hoverable")&&(this.get("group").on("mousemove",i.wrapBehavior(this,"_onMousemove")),this.get("group").on("mouseleave",i.wrapBehavior(this,"_onMouseleave"))),this.get("clickable")&&this.get("group").on("click",i.wrapBehavior(this,"_onClick"))},n._getLegendItem=function(t){var e=t.get("parent");return e&&"legendGroup"===e.name?e:null},n.activate=function(t){var e=this,n=this,r=n.get("itemsGroup"),i=r.get("children"),a=void 0;i.forEach(function(r){if(a=h(r,"legend-marker"),a){var i=r.get("checked");e.get("highlight")?r.get("value")===t&&i?a.attr("stroke","#333"):a.attr("stroke",null):r.get("value")===t&&a.attr("fillOpacity",n.get("activeOpacity"))}}),this.get("canvas").draw()},n.deactivate=function(){var t=this,e=this,n=e.get("itemsGroup"),r=n.get("children"),i=void 0,a=this.get("unCheckColor");r.forEach(function(n){if(i=h(n,"legend-marker"),i)if(t.get("highlight")){var r=i.get("oriStroke"),o=n.get("checked");r=r&&!o?a:"",i.attr("stroke",r)}else i.attr("fillOpacity",e.get("inactiveOpacity"))}),this.get("canvas").draw()},n._onMousemove=function(t){var e=this._getLegendItem(t.currentTarget);if(e&&e.get("checked")){var n=this.get("items"),r=new u("itemhover",t,!0,!0);r.item=c(n,e),r.checked=e.get("checked"),r.currentTarget=t.currentTarget,this.deactivate(),this.activate(e.get("value")),this.emit("itemhover",r)}else this.deactivate(),this.emit("itemunhover",t);this.get("canvas").draw()},n._onMouseleave=function(t){this.deactivate(),this.get("canvas").draw(),this.emit("itemunhover",t)},n._onClick=function(t){var e=this._getLegendItem(t.currentTarget),n=this.get("items");if(e&&!e.get("destroyed")){var r=e.get("checked"),a=this.get("selectedMode"),o=c(n,e),s=new u("itemclick",t,!0,!0);if(s.item=o,s.currentTarget=e,s.appendInfo=t.currentTarget.get("appendInfo"),s.checked="single"===a||!r,!this.get("allowAllCanceled")&&r&&1===this.getCheckedCount())return void this.emit("clicklastitem",s);var l=this.get("unCheckColor"),f=this.get("textStyle").fill,p=void 0,d=void 0,g=void 0;if("single"===a){var v=this.get("itemsGroup"),y=v.get("children");i.each(y,function(t){p=h(t,"legend-marker"),d=h(t,"legend-text"),g=h(t,"legend-item"),t!==e?(p.attr("fill")&&p.attr("fill",l),p.attr("stroke")&&p.attr("stroke",l),d.attr("fill",l),p.setSilent("checked",!1),d.setSilent("checked",!1),g.setSilent("checked",!1),t.setSilent("checked",!1)):(p.attr("fill")&&o&&o.marker&&p.attr("fill",o.marker.fill),p.attr("stroke")&&o&&o.marker&&p.attr("stroke",o.marker.stroke),d.attr("fill",f),p.setSilent("checked",!0),d.setSilent("checked",!0),g.setSilent("checked",!0),t.setSilent("checked",!0))})}else p=h(e,"legend-marker"),d=h(e,"legend-text"),g=h(e,"legend-item"),p.attr("fill")&&o&&o.marker&&p.attr("fill",r?l:o.marker.fill),p.attr("stroke")&&o&&o.marker&&p.attr("stroke",r?l:o.marker.stroke),d.attr("fill",r?l:f),e.setSilent("checked",!r),p.setSilent("checked",!r),d.setSilent("checked",!r),g.setSilent("checked",!r);this.emit("itemclick",s)}this.get("canvas").draw()},n._renderItems=function(){var t=this,e=this.get("items");if(this.get("reversed")&&e.reverse(),i.each(e,function(e,n){t._addItem(e,n)}),this.get("highlight")){var n=this.get("itemsGroup"),r=n.get("children"),a=void 0;r.forEach(function(t){a=h(t,"legend-marker");var e=a.get("oriStroke");e||(a.attr("stroke")?a.set("oriStroke",a.attr("stroke")):a.set("oriStroke",""))})}},n._formatItemValue=function(t){var e=this.get("formatter")||this.get("itemFormatter");return e&&(t=e.call(this,t)),t},n._getNextX=function(){var t=this.get("layout"),e=this.get("itemGap"),n=this.get("itemsGroup"),r=this.get("itemWidth"),a=n.get("children"),o=0;return"horizontal"===t&&i.each(a,function(t){o+=(r||t.getBBox().width)+e}),o},n._getNextY=function(){var t=this.get("itemMarginBottom"),e=this.get("titleShape")?this.get("titleGap"):0,n=this.get("layout"),r=this.get("itemsGroup"),a=this.get("titleShape"),o=r.get("children"),s=e;return a&&(s+=a.getBBox().height),"vertical"===n&&i.each(o,function(e){s+=e.getBBox().height+t}),s},n._addItem=function(t){var e=this.get("itemsGroup"),n=this._getNextX(),r=this._getNextY(),a=this.get("unCheckColor"),o=e.addGroup({x:n,y:r,value:t.value,checked:t.checked});o.set("viewId",this.get("viewId"));var u=this.get("textStyle"),l=this.get("_wordSpaceing"),c=0;if(t.marker){var h=i.mix({},t.marker,{x:t.marker.radius+n,y:r});t.checked||(h.fill&&(h.fill=a),h.stroke&&(h.stroke=a));var f=o.addShape("marker",{type:"marker",attrs:h});f.attr("cursor","pointer"),f.name="legend-marker",c+=f.getBBox().width+l}var p=i.mix({},{fill:"#333",fontSize:12,textAlign:"start",textBaseline:"middle",fontFamily:s},u,{x:c+n,y:r,text:this._formatItemValue(t.value)});t.checked||i.mix(p,{fill:a});var d=o.addShape("text",{attrs:p});d.attr("cursor","pointer"),d.name="legend-text",this.get("appendInfo")&&d.setSilent("appendInfo",this.get("appendInfo"));var g=o.getBBox(),v=this.get("itemWidth"),y=o.addShape("rect",{attrs:{x:n,y:r-g.height/2,fill:"#fff",fillOpacity:0,width:v||g.width,height:g.height}});return y.attr("cursor","pointer"),y.setSilent("origin",t),y.name="legend-item",this.get("appendInfo")&&y.setSilent("appendInfo",this.get("appendInfo")),o.name="legendGroup",o},n._adjustHorizontal=function(){var t=this.get("itemsGroup"),e=t.get("children"),n=this.get("maxLength"),r=this.get("itemGap"),a=this.get("itemMarginBottom"),o=this.get("titleShape")?this.get("titleGap"):0,s=0,u=0,l=void 0,c=void 0,h=void 0,f=this.get("itemWidth");t.getBBox().width>n&&i.each(e,function(t){h=t.getBBox(),l=f||h.width,c=h.height+a,n-u<l&&(s++,u=0),t.move(u,s*c+o),u+=l+r})},n._adjustVertical=function(){var t=this.get("itemsGroup"),e=this.get("titleShape"),n=t.get("children"),r=this.get("maxLength"),a=this.get("itemGap"),o=this.get("itemMarginBottom"),s=this.get("titleGap"),u=e?e.getBBox().height+s:0,l=this.get("itemWidth"),c=u,h=void 0,f=void 0,p=void 0,d=0,g=0;t.getBBox().height>r&&i.each(n,function(t){p=t.getBBox(),h=p.width,f=p.height,l?d=l+a:h>d&&(d=h+a),r-c<f?(c=u,g+=d,t.move(g,u)):t.move(g,c),c+=f+o})},n._adjustItems=function(){var t=this.get("layout");"horizontal"===t?this._adjustHorizontal():this._adjustVertical()},n.getWidth=function(){return t.prototype.getWidth.call(this)},n.getHeight=function(){return t.prototype.getHeight.call(this)},n.move=function(e,n){t.prototype.move.call(this,e,n)},e}(a);t.exports=f},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}function i(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}var a=n(35),o=n(109),s=n(110),u=n(111),l=n(64),c=n(3),h=n(18),f=h.FONT_FAMILY,p=c.DomUtil,d=c.MatrixUtil,g=function(t){r(n,t);var e=n.prototype;function n(e){var n;n=t.call(this,e)||this,c.assign(i(i(n)),u),c.assign(i(i(n)),s);var r=n.get("crosshairs");if(r){var a="rect"===r.type?n.get("backPlot"):n.get("frontPlot"),l=new o(c.mix({plot:a,plotRange:n.get("plotRange"),canvas:n.get("canvas")},n.get("crosshairs")));l.hide(),n.set("crosshairGroup",l)}return n._init_(),n.get("items")&&n.render(),n}return e.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return c.mix({},e,{boardStyle:{x:0,y:0,width:100,height:100,fill:"rgba(255, 255, 255, 0.9)",radius:4,stroke:"#e2e2e2",lineWidth:1},titleStyle:{fontFamily:f,text:"",textBaseline:"top",fontSize:12,fill:"rgb(87, 87, 87)",lineHeight:20,padding:20},markerStyle:{radius:4},nameStyle:{fontFamily:f,fontSize:12,fill:"rgb(87, 87, 87)",textBaseline:"middle",textAlign:"start",padding:8},valueStyle:{fontFamily:f,fontSize:12,fill:"rgb(87, 87, 87)",textBaseline:"middle",textAlign:"start",padding:30},padding:{top:20,right:20,bottom:20,left:20},itemGap:10,animationDuration:200})},e._init_=function(){var t=this,e=t.get("padding"),n=t.get("frontPlot"),r=n.addGroup({capture:!1});t.set("markerGroup",r);var i=n.addGroup();i.hide(),t.set("container",i);var a=i.addShape("rect",{attrs:c.mix({},t.get("boardStyle"))});t.set("board",a);var o=t.get("titleStyle");if(t.get("showTitle")){var s=i.addShape("text",{attrs:c.mix({x:e.left,y:e.top},o)});t.set("titleShape",s),s.name="tooltip-title"}var u=i.addGroup();u.move(e.left,e.top+o.lineHeight+o.padding),t.set("itemsGroup",u)},e.render=function(){var t=this;t.clear();var e=t.get("container"),n=t.get("board"),r=t.get("showTitle"),i=t.get("titleContent"),a=this.get("titleShape"),o=this.get("itemsGroup"),s=t.get("items"),u=t.get("padding");if(a&&r&&a.attr("text",i),o){var l=t.get("itemGap"),h=0,f=0;c.each(s,function(e){var n=t._addItem(e);n.move(h,f),o.add(n);var r=n.getBBox().height;f+=r+l})}var p=e.getBBox(),d=p.width+u.right,g=p.height+u.bottom;n.attr("width",d),n.attr("height",g),t._alignToRight(d)},e.clear=function(){var t=this.get("titleShape"),e=this.get("itemsGroup"),n=this.get("board");t.text="",e.clear(),n.attr("width",0),n.attr("height",0)},e.show=function(){var e=this.get("container");e.show();var n=this.get("crosshairGroup");n&&n.show();var r=this.get("markerGroup");r&&r.show(),t.prototype.show.call(this),this.get("canvas").draw()},e.hide=function(){var e=this.get("container");e.hide();var n=this.get("crosshairGroup");n&&n.hide();var r=this.get("markerGroup");r&&r.hide(),t.prototype.hide.call(this),this.get("canvas").draw()},e.destroy=function(){var e=this.get("container"),n=this.get("crosshairGroup");n&&n.destroy();var r=this.get("markerGroup");r&&r.remove(),t.prototype.destroy.call(this),e.remove()},e.setPosition=function(e,n,r){var i,a=this.get("container"),o=this.get("canvas").get("el"),s=p.getWidth(o),u=p.getHeight(o),l=a.getBBox(),h=l.width,f=l.height,g=e,v=n;if(this.get("position")){var y=l.width,m=l.height;i=this._calcTooltipPosition(e,n,this.get("position"),y,m,r),e=i[0],n=i[1]}else i=this._constraintPositionInBoundary(e,n,h,f,s,u),e=i[0],n=i[1];if(this.get("inPlot")){var x=this.get("plotRange");i=this._constraintPositionInPlot(e,n,h,f,x,this.get("enterable")),e=i[0],n=i[1]}var b=this.get("markerItems");c.isEmpty(b)||(g=b[0].x,v=b[0].y);var _=[1,0,0,0,1,0,0,0,1],w=d.transform(_,[["t",e,n]]);a.stopAnimate(),a.animate({matrix:w},this.get("animationDuration"));var M=this.get("crosshairGroup");if(M){var S=this.get("items");M.setPosition(g,v,S)}t.prototype.setPosition.call(this,e,n)},e._addItem=function(t){var e=new a.Group,n=this.get("markerStyle").radius;if(t.marker){var r=c.mix({},t.marker,{x:t.marker.radius/2,y:0});e.addShape("marker",{attrs:r}),n=t.marker.radius}var i=this.get("nameStyle");e.addShape("text",{attrs:c.mix({x:n+i.padding,y:0,text:t.name},i)});var o=this.get("valueStyle");return e.addShape("text",{attrs:c.mix({x:e.getBBox().width+o.padding,y:0,text:t.value},o)}),e},e._alignToRight=function(t){var e=this,n=this.get("itemsGroup"),r=n.get("children");c.each(r,function(n){var r=n.get("children"),i=r[2],a=i.getBBox().width,o=t-a-2*e.get("padding").right;i.attr("x",o)})},n}(l);t.exports=g},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(34),a=n(3),o=function(t){r(n,t);var e=n.prototype;function n(e){var n;return n=t.call(this,e)||this,n._init_(),n.render(),n}return e.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return a.mix({},e,{type:null,plot:null,plotRange:null,rectStyle:{fill:"#CCD6EC",opacity:.3},lineStyle:{stroke:"rgba(0, 0, 0, 0.25)",lineWidth:1},isTransposed:!1})},e._init_=function(){var t,e=this,n=e.get("plot");t="rect"===e.type?n.addGroup({zIndex:0}):n.addGroup(),this.set("container",t)},e._addLineShape=function(t,e){var n=this.get("container"),r=n.addShape("line",{capture:!1,attrs:t});return this.set("crossLineShape"+e,r),r},e._renderHorizontalLine=function(t,e){var n=a.mix(this.get("lineStyle"),this.get("style")),r=a.mix({x1:e?e.bl.x:t.get("width"),y1:0,x2:e?e.br.x:0,y2:0},n);this._addLineShape(r,"X")},e._renderVerticalLine=function(t,e){var n=a.mix(this.get("lineStyle"),this.get("style")),r=a.mix({x1:0,y1:e?e.bl.y:t.get("height"),x2:0,y2:e?e.tl.y:0},n);this._addLineShape(r,"Y")},e._renderBackground=function(t,e){var n=a.mix(this.get("rectStyle"),this.get("style")),r=this.get("container"),i=a.mix({x:e?e.tl.x:0,y:e?e.tl.y:t.get("height"),width:e?e.br.x-e.bl.x:t.get("width"),height:e?Math.abs(e.tl.y-e.bl.y):t.get("height")},n),o=r.addShape("rect",{attrs:i,capture:!1});return this.set("crosshairsRectShape",o),o},e._updateRectShape=function(t){var e,n=this.get("crosshairsRectShape"),r=this.get("isTransposed"),i=t[0],o=t[t.length-1],s=r?"y":"x",u=r?"height":"width",l=i[s];if(t.length>1&&i[s]>o[s]&&(l=o[s]),this.get("width"))n.attr(s,l-this.get("crosshairs").width/2),n.attr(u,this.get("width"));else if(a.isArray(i.point[s])&&!i.size){var c=i.point[s][1]-i.point[s][0];n.attr(s,i.point[s][0]),n.attr(u,c)}else e=3*i.size/4,n.attr(s,l-e),1===t.length?n.attr(u,3*i.size/2):n.attr(u,Math.abs(o[s]-i[s])+2*e)},e.render=function(){var t=this.get("canvas"),e=this.get("plotRange"),n=this.get("isTransposed");switch(this.clear(),this.get("type")){case"x":this._renderHorizontalLine(t,e);break;case"y":this._renderVerticalLine(t,e);break;case"cross":this._renderHorizontalLine(t,e),this._renderVerticalLine(t,e);break;case"rect":this._renderBackground(t,e);break;default:n?this._renderHorizontalLine(t,e):this._renderVerticalLine(t,e)}},e.show=function(){var e=this.get("container");t.prototype.show.call(this),e.show()},e.hide=function(){var e=this.get("container");t.prototype.hide.call(this),e.hide()},e.clear=function(){var e=this.get("container");this.set("crossLineShapeX",null),this.set("crossLineShapeY",null),this.set("crosshairsRectShape",null),t.prototype.clear.call(this),e.clear()},e.destroy=function(){var e=this.get("container");t.prototype.destroy.call(this),e.remove()},e.setPosition=function(t,e,n){var r=this.get("crossLineShapeX"),i=this.get("crossLineShapeY"),a=this.get("crosshairsRectShape");i&&!i.get("destroyed")&&i.move(t,0),r&&!r.get("destroyed")&&r.move(0,e),a&&!a.get("destroyed")&&this._updateRectShape(n)},n}(i);t.exports=o},function(t,e,n){var r=n(3),i={setMarkers:function(t,e){var n=this,i=n.get("markerGroup"),a=n.get("frontPlot");i?i.clear():(i=a.addGroup({zIndex:1,capture:!1}),n.set("markerGroup",i)),r.each(t,function(t){i.addShape("marker",{color:t.color,attrs:r.mix({fill:t.color,symbol:"circle",shadowColor:t.color},e,{x:t.x,y:t.y})})}),this.set("markerItems",t)},clearMarkers:function(){var t=this.get("markerGroup");t&&t.clear()}};t.exports=i},function(t,e){var n=20,r={_calcTooltipPosition:function(t,e,n,r,i,a){var o=0,s=0,u=20;if(a){var l=a.getBBox();o=l.width,s=l.height,t=l.x,e=l.y,u=5}switch(n){case"inside":t=t+o/2-r/2,e=e+s/2-i/2;break;case"top":t=t+o/2-r/2,e=e-i-u;break;case"left":t=t-r-u,e=e+s/2-i/2;break;case"right":t=t+o+u,e=e+s/2-i/2;break;case"bottom":default:t=t+o/2-r/2,e=e+s+u;break}return[t,e]},_constraintPositionInBoundary:function(t,e,r,i,a,o){return t+r+n>a?(t-=r+n,t=t<0?0:t):t+n<0?t=n:t+=n,e+i+n>o?(e-=i+n,e=e<0?0:e):e+n<0?e=n:e+=n,[t,e]},_constraintPositionInPlot:function(t,e,r,i,a,o){return t+r>a.tr.x&&(t-=r+2*n),t<a.tl.x&&(t=a.tl.x),o||(e+i>a.bl.y&&(e-=i+2*n),e<a.tl.y&&(e=a.tl.y)),[t,e]}};t.exports=r},function(t,e,n){var r=n(0),i=n(264),a={appear:{duration:450,easing:"easeQuadOut"},update:{duration:450,easing:"easeQuadInOut"},enter:{duration:400,easing:"easeQuadInOut",delay:100},leave:{duration:350,easing:"easeQuadIn"}},o={line:{appear:function(){return i.appear.clipIn},enter:function(){return i.enter.clipIn},leave:function(){return i.leave.lineWidthOut}},path:{appear:function(){return i.appear.clipIn},enter:function(){return i.enter.clipIn},leave:function(){return i.leave.lineWidthOut}},area:{appear:function(){return i.appear.clipIn},enter:function(){return i.enter.fadeIn},leave:function(){return i.leave.fadeOut},cfg:{appear:{duration:500,easing:"easeQuadOut"},update:{duration:450,easing:"easeQuadInOut"},enter:{duration:600,delay:150,easing:"easeQuadInOut"},leave:{easing:"easeQuadOut",duration:350}}},polygon:{appear:function(){return i.appear.zoomIn},enter:function(){return i.enter.zoomIn},leave:function(){return i.leave.zoomOut}},edge:{appear:function(){return i.appear.pathIn},enter:function(){return i.enter.pathIn},leave:function(){return i.leave.pathOut}},interval:{appear:function(t){var e;return t.isPolar?(e=i.appear.zoomIn,(t.isTransposed||"theta"===t.type)&&(e=i.appear.fanIn)):e=t.isRect?t.isTransposed?i.appear.scaleInX:i.appear.scaleInY:i.appear.zoomIn,e},enter:function(t){return t.isRect||t.isTransposed||"theta"===t.type?i.enter.fadeIn:i.enter.zoomIn},leave:function(){return i.leave.fadeOut},update:function(t){if("theta"===t.type)return i.update.fanIn}},point:{appear:function(){return i.appear.zoomIn},enter:function(){return i.enter.zoomIn},leave:function(){return i.leave.zoomOut}},schema:{appear:function(){return i.appear.clipIn},enter:function(){return i.enter.clipIn},leave:function(){return i.leave.lineWidthOut}},contour:null,heatmap:null,label:{appear:function(){return i.appear.fadeIn},enter:function(){return i.enter.fadeIn},leave:function(){return i.leave.fadeOut},cfg:{appear:{duration:900}}},"axis-label":{enter:function(){return i.appear.fadeIn},leave:function(){return i.leave.fadeOut},update:function(t){if(t.isPolar)return i.appear.fadeIn}},"axis-ticks":{enter:function(){return i.appear.fadeIn},leave:function(){return i.leave.fadeOut},update:function(t){if(t.isPolar)return i.appear.fadeIn}},"axis-grid":{enter:function(){return i.appear.fadeIn},leave:function(){return i.leave.fadeOut},update:function(t){if(t.isPolar)return i.appear.fadeIn}},"axis-grid-rect":{enter:function(){return i.appear.fadeIn},leave:function(){return i.leave.fadeOut},update:function(){return i.leave.fadeIn}},labelLine:{appear:function(){return i.appear.pathIn},enter:function(){return i.enter.pathIn},leave:function(){return i.leave.pathOut}}};o.Action=i,o.defaultCfg=a,o.getAnimation=function(t,e,n){var i=this[t];if(i){var a=i[n];if(r.isFunction(a))return a(e)}return!1},o.getAnimateCfg=function(t,e){var n=a[e];return this[t]&&this[t].cfg&&this[t].cfg[e]?r.deepMix({},n,this[t].cfg[e]):n},o.registerAnimation=function(t,e,n){this.Action[t]||(this.Action[t]={}),this.Action[t][e]=n},t.exports=o},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(98),a=n(0),o=function(t){r(n,t);var e=n.prototype;function n(e){var n;n=t.call(this)||this;var r={visible:!0},i=n.getDefaultCfg();return n._attrs=r,a.assign(r,i,e),n}return e.getDefaultCfg=function(){return{}},e.get=function(t){return this._attrs[t]},e.set=function(t,e){this._attrs[t]=e},e.show=function(){var t=this.get("visible");t||(this.set("visible",!0),this.changeVisible(!0))},e.hide=function(){var t=this.get("visible");t&&(this.set("visible",!1),this.changeVisible(!1))},e.changeVisible=function(){},e.destroy=function(){this._attrs={},this.removeAllListeners(),this.destroyed=!0},n}(i);t.exports=o},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(0),a=n(273),o=n(23),s=o.Canvas,u=i.DomUtil,l=n(5),c=n(277),h=n(115),f=n(117),p=n(116),d=n(118),g="auto";function v(t,e){var n=!1;return i.each(t,function(t){var r=[].concat(t.values),i=[].concat(e.values);t.type!==e.type||t.field!==e.field||r.sort().toString()!==i.sort().toString()||(n=!0)}),n}function y(t,e){return i.isEqualWith(t,e,function(t,e){return t===e})}var m=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return i.mix(e,{id:null,forceFit:!1,container:null,wrapperEl:null,canvas:null,width:500,height:500,pixelRatio:null,backPlot:null,frontPlot:null,plotBackground:null,padding:l.plotCfg.padding,background:null,autoPaddingAppend:5,limitInPlot:!1,renderer:l.renderer,views:[]})},n.init=function(){var e=this,n=e.get("viewTheme");e._initCanvas(),e._initPlot(),e._initEvents(),t.prototype.init.call(this);var r=new h.Tooltip({chart:e,viewTheme:n,options:{}});e.set("tooltipController",r);var i=new h.Legend({chart:e,viewTheme:n});e.set("legendController",i),e.set("_id","chart"),e.emit("afterinit")},n._isAutoPadding=function(){var t=this.get("padding");return i.isArray(t)?-1!==t.indexOf(g):t===g},n._getAutoPadding=function(){for(var t=this.get("padding"),e=this.get("frontPlot"),n=e.getBBox(),r=this.get("backPlot"),a=p(r,d(this.get("plotRange"))),o=f(n,a),s=[0-o.minY,o.maxX-this.get("width"),o.maxY-this.get("height"),0-o.minX],u=i.toAllPadding(t),l=0;l<u.length;l++)if(u[l]===g){var c=Math.max(0,s[l]);u[l]=c+this.get("autoPaddingAppend")}return u},n._initCanvas=function(){var t=this.get("container"),e=this.get("id");!t&&e&&(t=e,this.set("container",e));var n=this.get("width"),r=this.get("height");if(i.isString(t)){if(t=document.getElementById(t),!t)throw new Error("Please specify the container for the chart!");this.set("container",t)}var a=u.createDom('<div style="position:relative;"></div>');t.appendChild(a),this.set("wrapperEl",a),this.get("forceFit")&&(n=u.getWidth(t,n),this.set("width",n));var o=this.get("renderer"),l=new s({containerDOM:a,width:n,height:r,pixelRatio:"svg"===o?1:this.get("pixelRatio"),renderer:o});this.set("canvas",l)},n._initPlot=function(){var t=this;t._initPlotBack();var e=t.get("canvas"),n=e.addGroup({zIndex:1}),r=e.addGroup({zIndex:0}),i=e.addGroup({zIndex:3});t.set("backPlot",n),t.set("middlePlot",r),t.set("frontPlot",i)},n._initPlotBack=function(){var t=this,e=t.get("canvas"),n=t.get("viewTheme"),r=e.addGroup(c,{padding:this.get("padding"),plotBackground:i.mix({},n.plotBackground,t.get("plotBackground")),background:i.mix({},n.background,t.get("background"))});t.set("plot",r),t.set("plotRange",r.get("plotRange"))},n._initEvents=function(){this.get("forceFit")&&window.addEventListener("resize",i.wrapBehavior(this,"_initForceFitEvent"))},n._initForceFitEvent=function(){var t=setTimeout(i.wrapBehavior(this,"forceFit"),200);clearTimeout(this.get("resizeTimer")),this.set("resizeTimer",t)},n._renderLegends=function(){var t=this.get("options"),e=t.legends;if(i.isNil(e)||!1!==e){var n=this.get("legendController");if(n.options=e||{},n.plotRange=this.get("plotRange"),e&&e.custom)n.addCustomLegend();else{var r=this.getAllGeoms(),a=[];i.each(r,function(t){var e=t.get("view"),r=t.getAttrsForLegend();i.each(r,function(r){var i=r.type,o=r.getScale(i);if(o.field&&"identity"!==o.type&&!v(a,o)){a.push(o);var s=e.getFilteredOutValues(o.field);n.addLegend(o,r,t,s)}})});var o=this.getYScales();0===a.length&&o.length>1&&n.addMixedLegend(o,r)}n.alignLegends()}},n._renderTooltips=function(){var t=this.get("options");if(i.isNil(t.tooltip)||!1!==t.tooltip){var e=this.get("tooltipController");e.options=t.tooltip||{},e.renderTooltip()}},n.getAllGeoms=function(){var t=[];t=t.concat(this.get("geoms"));var e=this.get("views");return i.each(e,function(e){t=t.concat(e.get("geoms"))}),t},n.forceFit=function(){var t=this;if(t&&!t.destroyed){var e=t.get("container"),n=t.get("width"),r=u.getWidth(e,n);if(0!==r&&r!==n){var i=t.get("height");t.changeSize(r,i)}return t}},n.resetPlot=function(){var t=this.get("plot"),e=this.get("padding");y(e,t.get("padding"))||(t.set("padding",e),t.repaint())},n.changeSize=function(t,e){var n=this,r=n.get("canvas");r.changeSize(t,e);var i=this.get("plot");return n.set("width",t),n.set("height",e),i.repaint(),this.set("keepPadding",!0),n.repaint(),this.set("keepPadding",!1),this.emit("afterchangesize"),n},n.changeWidth=function(t){return this.changeSize(t,this.get("height"))},n.changeHeight=function(t){return this.changeSize(this.get("width"),t)},n.view=function(t){t=t||{},t.theme=this.get("theme"),t.parent=this,t.backPlot=this.get("backPlot"),t.middlePlot=this.get("middlePlot"),t.frontPlot=this.get("frontPlot"),t.canvas=this.get("canvas"),i.isNil(t.animate)&&(t.animate=this.get("animate")),t.options=i.mix({},this._getSharedOptions(),t.options);var e=new a(t);return e.set("_id","view"+this.get("views").length),this.get("views").push(e),this.emit("addview",{view:e}),e},n.removeView=function(t){var e=this.get("views");i.Array.remove(e,t),t.destroy()},n._getSharedOptions=function(){var t=this.get("options"),e={};return i.each(["scales","coord","axes"],function(n){e[n]=i.cloneDeep(t[n])}),e},n.getViewRegion=function(){var t=this.get("plotRange");return{start:t.bl,end:t.tr}},n.legend=function(t,e){var n=this.get("options");n.legends||(n.legends={});var r={};return!1===t?n.legends=!1:i.isObject(t)?r=t:i.isString(t)?r[t]=e:r=e,i.mix(n.legends,r),this},n.tooltip=function(t,e){var n=this.get("options");return n.tooltip||(n.tooltip={}),!1===t?n.tooltip=!1:i.isObject(t)?i.mix(n.tooltip,t):i.mix(n.tooltip,e),this},n.clear=function(){this.emit("beforeclear");var e=this.get("views");while(e.length>0){var n=e.shift();n.destroy()}t.prototype.clear.call(this);var r=this.get("canvas");return this.resetPlot(),r.draw(),this.emit("afterclear"),this},n.clearInner=function(){var e=this.get("views");i.each(e,function(t){t.clearInner()});var n=this.get("tooltipController");if(n&&n.clear(),!this.get("keepLegend")){var r=this.get("legendController");r&&r.clear()}t.prototype.clearInner.call(this)},n.drawComponents=function(){t.prototype.drawComponents.call(this),this.get("keepLegend")||this._renderLegends()},n.render=function(){var e=this;if(!e.get("keepPadding")&&e._isAutoPadding()){e.beforeRender(),e.drawComponents();var n=e._getAutoPadding(),r=e.get("plot");y(r.get("padding"),n)||(r.set("padding",n),r.repaint())}var a=e.get("middlePlot");if(e.get("limitInPlot")&&!a.attr("clip")){var o=i.getClipByRange(e.get("plotRange"));a.attr("clip",o)}t.prototype.render.call(this),e._renderTooltips()},n.repaint=function(){this.get("keepPadding")||this.resetPlot(),t.prototype.repaint.call(this)},n.changeVisible=function(t){var e=this.get("wrapperEl"),n=t?"":"none";e.style.display=n},n.toDataURL=function(){var t=this,e=t.get("canvas"),n=t.get("renderer"),r=e.get("el"),i="";if("svg"===n){var a=r.cloneNode(!0),o=document.implementation.createDocumentType("svg","-//W3C//DTD SVG 1.1//EN","http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"),s=document.implementation.createDocument("http://www.w3.org/2000/svg","svg",o);s.replaceChild(a,s.documentElement);var u=(new XMLSerializer).serializeToString(s);i="data:image/svg+xml;charset=utf8,"+encodeURIComponent(u)}else"canvas"===n&&(i=r.toDataURL("image/png"));return i},n.downloadImage=function(t){var e=this,n=document.createElement("a"),r=e.get("renderer"),i=(t||"chart")+("svg"===r?".svg":".png"),a=e.get("canvas");a.get("timeline").stopAllAnimations(),setTimeout(function(){var t=e.toDataURL();if(window.Blob&&window.URL&&"svg"!==r){var a=t.split(","),o=a[0].match(/:(.*?);/)[1],s=atob(a[1]),u=s.length,l=new Uint8Array(u);while(u--)l[u]=s.charCodeAt(u);var c=new Blob([l],{type:o});window.navigator.msSaveBlob?window.navigator.msSaveBlob(c,i):n.addEventListener("click",function(){n.download=i,n.href=window.URL.createObjectURL(c)})}else n.addEventListener("click",function(){n.download=i,n.href=t});var h=document.createEvent("MouseEvents");h.initEvent("click",!1,!1),n.dispatchEvent(h)},16)},n.showTooltip=function(t){var e=this.getViewsByPoint(t);if(e.length){var n=this.get("tooltipController");n.showTooltip(t,e)}return this},n.hideTooltip=function(){var t=this.get("tooltipController");return t.hideTooltip(),this},n.getTooltipItems=function(t){var e=this,n=e.getViewsByPoint(t),r=[];return i.each(n,function(e){var n=e.get("geoms");i.each(n,function(e){var n=e.get("dataArray"),a=[];i.each(n,function(n){var r=e.findPoint(t,n);if(r){var i=e.getTipItems(r);a=a.concat(i)}}),r=r.concat(a)})}),r},n.destroy=function(){this.emit("beforedestroy"),clearTimeout(this.get("resizeTimer"));var e=this.get("canvas"),n=this.get("wrapperEl");n.parentNode.removeChild(n),t.prototype.destroy.call(this),e.destroy(),window.removeEventListener("resize",i.getWrapBehavior(this,"_initForceFitEvent")),this.emit("afterdestroy")},e}(a);t.exports=m},function(t,e,n){t.exports={Scale:n(271),Coord:n(267),Axis:n(266),Guide:n(269),Legend:n(270),Tooltip:n(272),Event:n(268)}},function(t,e,n){var r=n(23),i=n(0),a=n(117);function o(t,e,n){void 0===n&&(n=1);var r=[t.x,t.y,n];return i.vec3.transformMat3(r,r,e),{x:r[0],y:r[1]}}function s(t){var e=t.getBBox(),n={x:e.minX,y:e.minY},r={x:e.maxX,y:e.maxY},i=t.attr("matrix");return n=o(n,i),r=o(r,i),{minX:n.x,minY:n.y,maxX:r.x,maxY:r.y}}t.exports=function(t,e){var n=e;return i.each(t.get("children"),function(t){if(t instanceof r.Group&&t.get("children").length||t instanceof r.Path)n=a(n,t.getBBox());else if(t instanceof r.Text){var e=s(t),o=Math.abs(e.maxX-e.minX),u=Math.abs(e.maxY-e.minY);n=a(n,o<u?i.mix(n,{minX:Math.min(n.minX,e.minX),maxX:Math.max(n.maxX,e.maxX)}):i.mix(n,{minY:Math.min(n.minY,e.minY),maxY:Math.max(n.maxY,e.maxY)}))}}),n}},function(t,e){t.exports=function(t,e){return{minX:Math.min(t.minX,e.minX),minY:Math.min(t.minY,e.minY),maxX:Math.max(t.maxX,e.maxX),maxY:Math.max(t.maxY,e.maxY)}}},function(t,e){t.exports=function(t){return{minX:t.tl.x,minY:t.tl.y,maxX:t.br.x,maxY:t.br.y}}},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(43),a=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return e.type="list",e.cols=null,e},n.generateFacets=function(t){var e=this,n=e.fields,r=n[0];if(!r)throw"Please specify for the field for facet!";var i=e.getFieldValues(r,t),a=i.length,o=e.cols||a,s=parseInt((a+o-1)/o),u=[];return i.forEach(function(n,l){var c=parseInt(l/o),h=l%o,f=[{field:r,value:n,values:i}],p=e.getFilter(f),d=t.filter(p),g={type:e.type,count:a,colValue:n,colField:r,rowField:null,rowValue:n,colIndex:h,rowIndex:c,cols:o,rows:s,data:d,region:e.getRegion(s,o,h,c)};u.push(g)}),u},n.setXAxis=function(t,e,n){n.rowIndex!==n.rows-1&&n.cols*n.rowIndex+n.colIndex+1+n.cols<=n.count&&(e[t].label=null,e[t].title=null)},n.setYAxis=function(t,e,n){0!==n.colIndex&&(e[t].title=null,e[t].label=null)},e}(i);t.exports=a},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(43),a=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return e.type="rect",e},n.generateFacets=function(t){var e=this,n=e.fields,r=[],i=1,a=1,o=n[0],s=n[1],u=[""],l=[""];return o&&(u=e.getFieldValues(o,t),a=u.length),s&&(l=e.getFieldValues(s,t),i=l.length),u.forEach(function(n,c){l.forEach(function(h,f){var p=[{field:o,value:n,values:u},{field:s,value:h,values:l}],d=e.getFilter(p),g=t.filter(d),v={type:e.type,colValue:n,rowValue:h,colField:o,rowField:s,colIndex:c,rowIndex:f,cols:a,rows:i,data:g,region:e.getRegion(i,a,c,f)};r.push(v)})}),r},n.setXAxis=function(t,e,n){n.rowIndex!==n.rows-1?(e[t].title=null,e[t].label=null):n.colIndex!==parseInt((n.cols-1)/2)&&(e[t].title=null)},n.setYAxis=function(t,e,n){0!==n.colIndex?(e[t].title=null,e[t].label=null):n.rowIndex!==parseInt((n.rows-1)/2)&&(e[t].title=null)},n.renderTitle=function(t,e){0===e.rowIndex&&this.drawColTitle(t,e),e.colIndex===e.cols-1&&this.drawRowTitle(t,e)},e}(i);t.exports=a},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(66),a=n(25),o=n(0),s=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.getPointRauis=function(t,e){return a.getPointRadius(t,e)},n.getCirclePoint=function(t,e,n){var r=this,i=r.get("coord"),a=i.getCenter(),o=r._isEmitLabels(),s=r.getPointRauis(i,n);if(0===s)return null;if(i.isTransposed&&s>e&&!o){var u=Math.asin(e/(2*s));t+=2*u}else s+=e;return{x:a.x+s*Math.cos(t),y:a.y+s*Math.sin(t),angle:t,r:s}},n.getArcPoint=function(t,e){var n,r=this;return e=e||0,n=o.isArray(t.x)||o.isArray(t.y)?{x:o.isArray(t.x)?t.x[e]:t.x,y:o.isArray(t.y)?t.y[e]:t.y}:t,r.transLabelPoint(n),n},n.getPointAngle=function(t){var e=this,n=e.get("coord");return a.getPointAngle(n,t)},n.getMiddlePoint=function(t){var e=this,n=e.get("coord"),r=t.length,i={x:0,y:0};return o.each(t,function(t){i.x+=t.x,i.y+=t.y}),i.x/=r,i.y/=r,i=n.convert(i),i},n._isToMiddle=function(t){return t.x.length>2},n.getLabelPoint=function(t,e,n){var r,i=this,a=t.text[n],o=1;i._isToMiddle(e)?r=i.getMiddlePoint(e.points):(1===t.text.length&&0===n?n=1:0===n&&(o=-1),r=i.getArcPoint(e,n));var s=i.getDefaultOffset(t);s*=o;var u=i.getPointAngle(r),l=i.getCirclePoint(u,s,r);if(l?(l.text=a,l.angle=u,l.color=e.color):l={text:""},t.autoRotate||"undefined"===typeof t.autoRotate){var c=l.textStyle?l.textStyle.rotate:null;c||(c=l.rotate||i.getLabelRotate(u,s,e)),l.rotate=c}return l.start={x:r.x,y:r.y},l},n._isEmitLabels=function(){var t=this.get("label");return t.labelEmit},n.getLabelRotate=function(t){var e,n=this;return e=180*t/Math.PI,e+=90,n._isEmitLabels()&&(e-=90),e&&(e>90?e-=180:e<-90&&(e+=180)),e/180*Math.PI},n.getLabelAlign=function(t){var e,n=this,r=n.get("coord");if(n._isEmitLabels())e=t.angle<=Math.PI/2&&t.angle>-Math.PI/2?"left":"right";else if(r.isTransposed){var i=r.getCenter(),a=n.getDefaultOffset(t);e=Math.abs(t.x-i.x)<1?"center":t.angle>Math.PI||t.angle<=0?a>0?"left":"right":a>0?"right":"left"}else e="center";return e},e}(i);t.exports=s},function(t,e,n){var r=n(0),i=n(5);t.exports={splitData:function(t){var e=this.get("viewTheme")||i;if(!t.length)return[];var n,a=[],o=[],s=this.getYScale(),u=s.field;return r.each(t,function(t){n=t._origin?t._origin[u]:t[u],e.connectNulls?r.isNil(n)||o.push(t):r.isArray(n)&&r.isNil(n[0])||r.isNil(n)?o.length&&(a.push(o),o=[]):o.push(t)}),o.length&&a.push(o),a}}},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}function i(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}var a=n(8),o=n(122),s=n(0),u=function(t){r(n,t);var e=n.prototype;function n(e){var n;return n=t.call(this,e)||this,s.assign(i(i(n)),o),n}return e.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return e.type="path",e.shapeType="line",e},e.getDrawCfg=function(e){var n=t.prototype.getDrawCfg.call(this,e);return n.isStack=this.hasStack(),n},e.draw=function(t,e,n,r){var i=this,a=this.splitData(t),o=this.getDrawCfg(t[0]);i._applyViewThemeShapeStyle(o,o.shape,n),o.origin=t,s.each(a,function(t,a){if(!s.isEmpty(t)){o.splitedIndex=a,o.points=t;var u=n.drawShape(o.shape,o,e);i.appendShapeInfo(u,r+a)}})},n}(a);a.Path=u,t.exports=u},function(t,e){var n,r,i="#1890FF",a=["#1890FF","#2FC25B","#FACC14","#223273","#8543E0","#13C2C2","#3436C7","#F04864"],o=["#1890FF","#41D9C7","#2FC25B","#FACC14","#E6965C","#223273","#7564CC","#8543E0","#5C8EE6","#13C2C2","#5CA3E6","#3436C7","#B381E6","#F04864","#D598D9"],s=["#1890FF","#66B5FF","#41D9C7","#2FC25B","#6EDB8F","#9AE65C","#FACC14","#E6965C","#57AD71","#223273","#738AE6","#7564CC","#8543E0","#A877ED","#5C8EE6","#13C2C2","#70E0E0","#5CA3E6","#3436C7","#8082FF","#DD81E6","#F04864","#FA7D92","#D598D9"],u=["#1890FF","#13C2C2","#2FC25B","#FACC14","#F04864","#8543E0","#3436C7","#223273"],l=["#1890FF","#73C9E6","#13C2C2","#6CD9B3","#2FC25B","#9DD96C","#FACC14","#E6965C","#F04864","#D66BCA","#8543E0","#8E77ED","#3436C7","#737EE6","#223273","#7EA2E6"],c='"-apple-system", BlinkMacSystemFont, "Segoe UI", Roboto,"Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",SimSun, "sans-serif"',h="g2-tooltip",f="g2-tooltip-title",p="g2-tooltip-list",d="g2-tooltip-list-item",g="g2-tooltip-marker",v="g2-tooltip-value",y="g2-legend",m="g2-legend-title",x="g2-legend-list",b="g2-legend-list-item",_="g2-legend-marker",w={defaultColor:i,plotCfg:{padding:[20,20,95,80]},fontFamily:c,defaultLegendPosition:"bottom",colors:a,colors_16:o,colors_24:s,colors_pie:u,colors_pie_16:l,shapes:{point:["hollowCircle","hollowSquare","hollowDiamond","hollowBowtie","hollowTriangle","hollowHexagon","cross","tick","plus","hyphen","line"],line:["line","dash","dot"],area:["area"]},sizes:[1,10],opacities:[.1,.9],axis:{top:{position:"top",title:null,label:{offset:16,textStyle:{fill:"#545454",fontSize:12,lineHeight:16,textBaseline:"middle",fontFamily:c},autoRotate:!0},line:{lineWidth:1,stroke:"#BFBFBF"},tickLine:{lineWidth:1,stroke:"#BFBFBF",length:4,alignWithLabel:!0}},bottom:{position:"bottom",title:null,label:{offset:16,autoRotate:!0,textStyle:{fill:"#545454",fontSize:12,lineHeight:16,textBaseline:"middle",fontFamily:c}},line:{lineWidth:1,stroke:"#BFBFBF"},tickLine:{lineWidth:1,stroke:"#BFBFBF",length:4,alignWithLabel:!0}},left:{position:"left",title:null,label:{offset:8,autoRotate:!0,textStyle:{fill:"#545454",fontSize:12,lineHeight:16,textBaseline:"middle",fontFamily:c}},line:null,tickLine:null,grid:{zIndex:-1,lineStyle:{stroke:"#E9E9E9",lineWidth:1,lineDash:[3,3]},hideFirstLine:!0}},right:{position:"right",title:null,label:{offset:8,autoRotate:!0,textStyle:{fill:"#545454",fontSize:12,lineHeight:16,textBaseline:"middle",fontFamily:c}},line:null,tickLine:null,grid:{lineStyle:{stroke:"#E9E9E9",lineWidth:1,lineDash:[3,3]},hideFirstLine:!0}},circle:{zIndex:1,title:null,label:{offset:8,textStyle:{fill:"#545454",fontSize:12,lineHeight:16,fontFamily:c}},line:{lineWidth:1,stroke:"#BFBFBF"},tickLine:{lineWidth:1,stroke:"#BFBFBF",length:4,alignWithLabel:!0},grid:{lineStyle:{stroke:"#E9E9E9",lineWidth:1,lineDash:[3,3]},hideFirstLine:!0}},radius:{zIndex:0,label:{offset:12,textStyle:{fill:"#545454",fontSize:12,textBaseline:"middle",lineHeight:16,fontFamily:c}},line:{lineWidth:1,stroke:"#BFBFBF"},tickLine:{lineWidth:1,stroke:"#BFBFBF",length:4,alignWithLabel:!0},grid:{lineStyle:{stroke:"#E9E9E9",lineWidth:1,lineDash:[3,3]},type:"circle"}},helix:{grid:null,label:null,title:null,line:{lineWidth:1,stroke:"#BFBFBF"},tickLine:{lineWidth:1,length:4,stroke:"#BFBFBF",alignWithLabel:!0}}},label:{offset:20,textStyle:{fill:"#545454",fontSize:12,textBaseline:"middle",fontFamily:c}},treemapLabels:{offset:10,textStyle:{fill:"#fff",fontSize:12,textBaseline:"top",fontStyle:"bold",fontFamily:c}},innerLabels:{textStyle:{fill:"#fff",fontSize:12,textBaseline:"middle",fontFamily:c}},thetaLabels:{labelHeight:14,offset:30},legend:{right:{position:"right",layout:"vertical",itemMarginBottom:8,width:16,height:156,title:null,legendStyle:{LIST_CLASS:{textAlign:"left"}},textStyle:{fill:"#8C8C8C",fontSize:12,textAlign:"start",textBaseline:"middle",lineHeight:0,fontFamily:c},unCheckColor:"#bfbfbf"},left:{position:"left",layout:"vertical",itemMarginBottom:8,width:16,height:156,title:null,textStyle:{fill:"#8C8C8C",fontSize:12,textAlign:"start",textBaseline:"middle",lineHeight:20,fontFamily:c},unCheckColor:"#bfbfbf"},top:{position:"top",offset:[0,6],layout:"horizontal",title:null,itemGap:10,width:156,height:16,textStyle:{fill:"#8C8C8C",fontSize:12,textAlign:"start",textBaseline:"middle",lineHeight:20,fontFamily:c},unCheckColor:"#bfbfbf"},bottom:{position:"bottom",offset:[0,6],layout:"horizontal",title:null,itemGap:10,width:156,height:16,textStyle:{fill:"#8C8C8C",fontSize:12,textAlign:"start",textBaseline:"middle",lineHeight:20,fontFamily:c},unCheckColor:"#bfbfbf"},html:(n={},n[""+y]={height:"auto",width:"auto",position:"absolute",overflow:"auto",fontSize:"12px",fontFamily:c,lineHeight:"20px",color:"#8C8C8C"},n[""+m]={marginBottom:"4px"},n[""+x]={listStyleType:"none",margin:0,padding:0},n[""+b]={cursor:"pointer",marginBottom:"5px",marginRight:"24px"},n[""+_]={width:"9px",height:"9px",borderRadius:"50%",display:"inline-block",marginRight:"8px",verticalAlign:"middle"},n),gradient:{textStyle:{fill:"#8C8C8C",fontSize:12,textAlign:"center",textBaseline:"middle",lineHeight:20,fontFamily:c},lineStyle:{lineWidth:1,stroke:"#fff"},unCheckColor:"#bfbfbf"},margin:[0,5,24,5],legendMargin:24},tooltip:(r={useHtml:!0,crosshairs:!1,offset:15},r[""+h]={position:"absolute",visibility:"hidden",zIndex:8,transition:"visibility 0.2s cubic-bezier(0.23, 1, 0.32, 1), left 0.4s cubic-bezier(0.23, 1, 0.32, 1), top 0.4s cubic-bezier(0.23, 1, 0.32, 1)",backgroundColor:"rgba(255, 255, 255, 0.9)",boxShadow:"0px 0px 10px #aeaeae",borderRadius:"3px",color:"rgb(87, 87, 87)",fontSize:"12px",fontFamily:c,lineHeight:"20px",padding:"10px 10px 6px 10px"},r[""+f]={marginBottom:"4px"},r[""+p]={margin:0,listStyleType:"none",padding:0},r[""+d]={marginBottom:"4px"},r[""+g]={width:"5px",height:"5px",borderRadius:"50%",display:"inline-block",marginRight:"8px"},r[""+v]={display:"inline-block",float:"right",marginLeft:"30px"},r),tooltipMarker:{symbol:function(t,e,n){return[["M",t,e],["m",-n,0],["a",n,n,0,1,0,2*n,0],["a",n,n,0,1,0,2*-n,0]]},stroke:"#fff",shadowBlur:10,shadowOffsetX:0,shadowOffSetY:0,shadowColor:"rgba(0,0,0,0.09)",lineWidth:2,radius:4},tooltipCrosshairsRect:{type:"rect",rectStyle:{fill:"#CCD6EC",opacity:.3}},tooltipCrosshairsLine:{lineStyle:{stroke:"rgba(0, 0, 0, 0.25)",lineWidth:1}},shape:{point:{lineWidth:1,fill:i,radius:4},hollowPoint:{fill:"#fff",lineWidth:1,stroke:i,radius:3},interval:{lineWidth:0,fill:i,fillOpacity:.85},hollowInterval:{fill:"#fff",stroke:i,fillOpacity:0,lineWidth:2},area:{lineWidth:0,fill:i,fillOpacity:.6},polygon:{lineWidth:0,fill:i,fillOpacity:1},hollowPolygon:{fill:"#fff",stroke:i,fillOpacity:0,lineWidth:2},hollowArea:{fill:"#fff",stroke:i,fillOpacity:0,lineWidth:2},line:{stroke:i,lineWidth:2,fill:null},edge:{stroke:i,lineWidth:1,fill:null},schema:{stroke:i,lineWidth:1,fill:null}},guide:{line:{lineStyle:{stroke:"rgba(0, 0, 0, .65)",lineDash:[2,2],lineWidth:1},text:{position:"start",autoRotate:!0,style:{fill:"rgba(0, 0, 0, .45)",fontSize:12,textAlign:"start",fontFamily:c,textBaseline:"bottom"}}},text:{style:{fill:"rgba(0,0,0,.5)",fontSize:12,textBaseline:"middle",textAlign:"start",fontFamily:c}},region:{style:{lineWidth:0,fill:"#000",fillOpacity:.04}},html:{alignX:"middle",alignY:"middle"},dataRegion:{style:{region:{lineWidth:0,fill:"#000000",opacity:.04},text:{textAlign:"center",textBaseline:"bottom",fontSize:12,fill:"rgba(0, 0, 0, .65)"}}},dataMarker:{top:!0,style:{point:{r:3,fill:"#FFFFFF",stroke:"#1890FF",lineWidth:2},line:{stroke:"#A3B1BF",lineWidth:1},text:{fill:"rgba(0, 0, 0, .65)",opacity:1,fontSize:12,textAlign:"start"}},display:{point:!0,line:!0,text:!0},lineLength:20,direction:"upward",autoAdjust:!0}},pixelRatio:null};t.exports=w},function(t,e,n){var r={default:n(124),dark:n(311)};t.exports=r},function(t,e,n){var r=n(1),i=n(314),a=n(317),o=n(313),s=n(98),u=function(t){this._cfg={zIndex:0,capture:!0,visible:!0,destroyed:!1},r.assign(this._cfg,this.getDefaultCfg(),t),this.initAttrs(this._cfg.attrs),this._cfg.attrs={},this.initTransform(),this.init()};u.CFG={id:null,zIndex:0,canvas:null,parent:null,capture:!0,context:null,visible:!0,destroyed:!1},r.augment(u,i,a,s,o,{init:function(){this.setSilent("animable",!0),this.setSilent("animating",!1)},getParent:function(){return this._cfg.parent},getDefaultCfg:function(){return{}},set:function(t,e){return"zIndex"===t&&this._beforeSetZIndex&&this._beforeSetZIndex(e),"loading"===t&&this._beforeSetLoading&&this._beforeSetLoading(e),this._cfg[t]=e,this},setSilent:function(t,e){this._cfg[t]=e},get:function(t){return this._cfg[t]},show:function(){return this._cfg.visible=!0,this},hide:function(){return this._cfg.visible=!1,this},remove:function(t,e){var n=this._cfg,i=n.parent,a=n.el;return i&&r.remove(i.get("children"),this),a&&(e?i&&i._cfg.tobeRemoved.push(a):a.parentNode.removeChild(a)),(t||void 0===t)&&this.destroy(),this},destroy:function(){var t=this.get("destroyed");t||(this._attrs=null,this.removeEvent(),this._cfg={destroyed:!0})},toFront:function(){var t=this._cfg,e=t.parent;if(e){var n=e._cfg.children,r=t.el,i=n.indexOf(this);n.splice(i,1),n.push(this),r&&(r.parentNode.removeChild(r),t.el=null)}},toBack:function(){var t=this._cfg,e=t.parent;if(e){var n=e._cfg.children,r=t.el,i=n.indexOf(this);if(n.splice(i,1),n.unshift(this),r){var a=r.parentNode;a.removeChild(r),a.insertBefore(r,a.firstChild)}}},_beforeSetZIndex:function(t){var e=this._cfg.parent;this._cfg.zIndex=t,r.isNil(e)||e.sort();var n=this._cfg.el;if(n){var i=e._cfg.children,a=i.indexOf(this),o=n.parentNode;o.removeChild(n),a===i.length-1?o.appendChild(n):o.insertBefore(n,o.childNodes[a])}return t},_setAttrs:function(t){return this.attr(t),t},setZIndex:function(t){return this._cfg.zIndex=t,this._beforeSetZIndex(t)},clone:function(){return r.clone(this)},getBBox:function(){}}),t.exports=u},function(t,e,n){var r=n(1),i=n(126),a=n(331),o={},s="_INDEX";function u(t){return function(e,n){var r=t(e,n);return 0===r?e[s]-n[s]:r}}function l(t,e,n){for(var r,i=t.length-1;i>=0;i--){var a=t[i];if(a._cfg.visible&&a._cfg.capture&&(a.isGroup?r=a.getShape(e,n):a.isHit(e,n)&&(r=a)),r)break}return r}var c=function t(e){t.superclass.constructor.call(this,e),this.set("children",[]),this.set("tobeRemoved",[]),this._beforeRenderUI(),this._renderUI(),this._bindUI()};function h(t){if(!t._cfg&&t!==c){var e=t.superclass.constructor;e&&!e._cfg&&h(e),t._cfg={},r.merge(t._cfg,e._cfg),r.merge(t._cfg,t.CFG)}}r.extend(c,i),r.augment(c,{isGroup:!0,type:"group",canFill:!0,canStroke:!0,getDefaultCfg:function(){return h(this.constructor),r.merge({},this.constructor._cfg)},_beforeRenderUI:function(){},_renderUI:function(){},_bindUI:function(){},addShape:function(t,e){var n=this.get("canvas");e=e||{};var i=o[t];if(i||(i=r.upperFirst(t),o[t]=i),e.attrs&&n){var s=e.attrs;if("text"===t){var u=n.get("fontFamily");u&&(s.fontFamily=s.fontFamily?s.fontFamily:u)}}e.canvas=n,e.type=t;var l=new a[i](e);return this.add(l),l},addGroup:function(t,e){var n,i=this.get("canvas");if(e=r.merge({},e),r.isFunction(t))e?(e.canvas=i,e.parent=this,n=new t(e)):n=new t({canvas:i,parent:this}),this.add(n);else if(r.isObject(t))t.canvas=i,n=new c(t),this.add(n);else{if(void 0!==t)return!1;n=new c,this.add(n)}return n},renderBack:function(t,e){var n=this.get("backShape"),i=this.getBBox();return r.merge(e,{x:i.minX-t[3],y:i.minY-t[0],width:i.width+t[1]+t[3],height:i.height+t[0]+t[2]}),n?n.attr(e):n=this.addShape("rect",{zIndex:-1,attrs:e}),this.set("backShape",n),this.sort(),n},removeChild:function(t,e){if(arguments.length>=2)this.contain(t)&&t.remove(e);else{if(1===arguments.length){if(!r.isBoolean(t))return this.contain(t)&&t.remove(!0),this;e=t}0===arguments.length&&(e=!0),c.superclass.remove.call(this,e)}return this},add:function(t){var e=this,n=e.get("children");if(r.isArray(t))r.each(t,function(t){var n=t.get("parent");n&&n.removeChild(t,!1),e._setCfgProperty(t)}),e._cfg.children=n.concat(t);else{var i=t,a=i.get("parent");a&&a.removeChild(i,!1),e._setCfgProperty(i),n.push(i)}return e},_setCfgProperty:function(t){var e=this._cfg;t.set("parent",this),t.set("canvas",e.canvas),e.timeline&&t.set("timeline",e.timeline)},contain:function(t){var e=this.get("children");return e.indexOf(t)>-1},getChildByIndex:function(t){var e=this.get("children");return e[t]},getFirst:function(){return this.getChildByIndex(0)},getLast:function(){var t=this.get("children").length-1;return this.getChildByIndex(t)},getBBox:function(){var t=this,e=1/0,n=-1/0,i=1/0,a=-1/0,o=t.get("children");o.length>0?r.each(o,function(t){if(t.get("visible")){if(t.isGroup&&0===t.get("children").length)return;var r=t.getBBox();if(!r)return!0;var o=[r.minX,r.minY,1],s=[r.minX,r.maxY,1],u=[r.maxX,r.minY,1],l=[r.maxX,r.maxY,1];t.apply(o),t.apply(s),t.apply(u),t.apply(l);var c=Math.min(o[0],s[0],u[0],l[0]),h=Math.max(o[0],s[0],u[0],l[0]),f=Math.min(o[1],s[1],u[1],l[1]),p=Math.max(o[1],s[1],u[1],l[1]);c<e&&(e=c),h>n&&(n=h),f<i&&(i=f),p>a&&(a=p)}}):(e=0,n=0,i=0,a=0);var s={minX:e,minY:i,maxX:n,maxY:a};return s.x=s.minX,s.y=s.minY,s.width=s.maxX-s.minX,s.height=s.maxY-s.minY,s},getCount:function(){return this.get("children").length},sort:function(){var t=this.get("children");return r.each(t,function(t,e){return t[s]=e,t}),t.sort(u(function(t,e){return t.get("zIndex")-e.get("zIndex")})),this},findById:function(t){return this.find(function(e){return e.get("id")===t})},find:function(t){if(r.isString(t))return this.findById(t);var e=this.get("children"),n=null;return r.each(e,function(e){if(t(e)?n=e:e.find&&(n=e.find(t)),n)return!1}),n},findAll:function(t){var e=this.get("children"),n=[],i=[];return r.each(e,function(e){t(e)&&n.push(e),e.findAllBy&&(i=e.findAllBy(t),n=n.concat(i))}),n},findBy:function(t){var e=this.get("children"),n=null;return r.each(e,function(e){if(t(e)?n=e:e.findBy&&(n=e.findBy(t)),n)return!1}),n},findAllBy:function(t){var e=this.get("children"),n=[],i=[];return r.each(e,function(e){t(e)&&n.push(e),e.findAllBy&&(i=e.findAllBy(t),n=n.concat(i))}),n},getShape:function(t,e){var n,r=this,i=r._attrs.clip,a=r._cfg.children;if(i){var o=[t,e,1];i.invert(o,r.get("canvas")),i.isPointInPath(o[0],o[1])&&(n=l(a,t,e))}else n=l(a,t,e);return n},clearTotalMatrix:function(){var t=this.get("totalMatrix");if(t){this.setSilent("totalMatrix",null);for(var e=this._cfg.children,n=0;n<e.length;n++){var r=e[n];r.clearTotalMatrix()}}},clear:function(t){for(var e=this._cfg.children,n=e.length-1;n>=0;n--)e[n].remove(!0,t);return this._cfg.children=[],this},destroy:function(){this.get("destroyed")||(this.clear(),c.superclass.destroy.call(this))},clone:function(){var t=this,e=t._cfg.children,n=new c;return r.each(e,function(t){n.add(t.clone())}),n}}),t.exports=c},function(t,e,n){var r=n(1),i=function(t,e,n,r){this.type=t,this.target=null,this.currentTarget=null,this.bubbles=n,this.cancelable=r,this.timeStamp=(new Date).getTime(),this.defaultPrevented=!1,this.propagationStopped=!1,this.removed=!1,this.event=e};r.augment(i,{preventDefault:function(){this.defaultPrevented=this.cancelable&&!0},stopPropagation:function(){this.propagationStopped=!0},remove:function(){this.remove=!0},clone:function(){return r.clone(this)},toString:function(){return"[Event (type="+this.type+")]"}}),t.exports=i},function(t,e,n){var r=n(1),i=n(7),a=n(44),o=n(46);function s(t,e,n){return t+e*Math.cos(n)}function u(t,e,n){return t+e*Math.sin(n)}var l=function t(e){t.superclass.constructor.call(this,e)};l.ATTRS={x:0,y:0,r:0,startAngle:0,endAngle:0,clockwise:!1,lineWidth:1,startArrow:!1,endArrow:!1},r.extend(l,i),r.augment(l,{canStroke:!0,type:"arc",getDefaultAttrs:function(){return{x:0,y:0,r:0,startAngle:0,endAngle:0,clockwise:!1,lineWidth:1,startArrow:!1,endArrow:!1}},calculateBox:function(){var t=this._attrs,e=t.x,n=t.y,r=t.r,i=t.startAngle,o=t.endAngle,s=t.clockwise,u=this.getHitLineWidth(),l=u/2,c=a.box(e,n,r,i,o,s);return c.minX-=l,c.minY-=l,c.maxX+=l,c.maxY+=l,c},getStartTangent:function(){var t=this._attrs,e=t.x,n=t.y,r=t.startAngle,i=t.r,a=t.clockwise,o=Math.PI/180;a&&(o*=-1);var l=[],c=s(e,i,r+o),h=u(n,i,r+o),f=s(e,i,r),p=u(n,i,r);return l.push([c,h]),l.push([f,p]),l},getEndTangent:function(){var t=this._attrs,e=t.x,n=t.y,r=t.endAngle,i=t.r,a=t.clockwise,o=Math.PI/180,l=[];a&&(o*=-1);var c=s(e,i,r+o),h=u(n,i,r+o),f=s(e,i,r),p=u(n,i,r);return l.push([f,p]),l.push([c,h]),l},createPath:function(t){var e=this._attrs,n=e.x,r=e.y,i=e.r,a=e.startAngle,o=e.endAngle,s=e.clockwise;t=t||self.get("context"),t.beginPath(),t.arc(n,r,i,a,o,s)},afterPath:function(t){var e=this._attrs;if(t=t||this.get("context"),e.startArrow){var n=this.getStartTangent();o.addStartArrow(t,e,n[0][0],n[0][1],n[1][0],n[1][1])}if(e.endArrow){var r=this.getEndTangent();o.addEndArrow(t,e,r[0][0],r[0][1],r[1][0],r[1][1])}}}),t.exports=l},function(t,e,n){var r=n(1),i=n(7),a=function t(e){t.superclass.constructor.call(this,e)};a.ATTRS={x:0,y:0,r:0,lineWidth:1},r.extend(a,i),r.augment(a,{canFill:!0,canStroke:!0,type:"circle",getDefaultAttrs:function(){return{lineWidth:1}},calculateBox:function(){var t=this._attrs,e=t.x,n=t.y,r=t.r,i=this.getHitLineWidth(),a=i/2+r;return{minX:e-a,minY:n-a,maxX:e+a,maxY:n+a}},createPath:function(t){var e=this._attrs,n=e.x,r=e.y,i=e.r;t.beginPath(),t.arc(n,r,i,0,2*Math.PI,!1),t.closePath()}}),t.exports=a},function(t,e,n){var r=n(1),i=n(7),a=function t(e){t.superclass.constructor.call(this,e)};r.extend(a,i),r.augment(a,{canFill:!0,canStroke:!0,type:"dom",calculateBox:function(){var t=this,e=t._attrs,n=e.x,r=e.y,i=e.width,a=e.height,o=this.getHitLineWidth(),s=o/2;return{minX:n-s,minY:r-s,maxX:n+i+s,maxY:r+a+s}}}),t.exports=a},function(t,e,n){var r=n(1),i=n(7),a=function t(e){t.superclass.constructor.call(this,e)};a.ATTRS={x:0,y:0,rx:1,ry:1,lineWidth:1},r.extend(a,i),r.augment(a,{canFill:!0,canStroke:!0,type:"ellipse",getDefaultAttrs:function(){return{lineWidth:1}},calculateBox:function(){var t=this._attrs,e=t.x,n=t.y,r=t.rx,i=t.ry,a=this.getHitLineWidth(),o=r+a/2,s=i+a/2;return{minX:e-o,minY:n-s,maxX:e+o,maxY:n+s}},createPath:function(t){var e=this._attrs,n=e.x,i=e.y,a=e.rx,o=e.ry;t=t||self.get("context");var s=a>o?a:o,u=a>o?1:a/o,l=a>o?o/a:1,c=[1,0,0,0,1,0,0,0,1];r.mat3.scale(c,c,[u,l]),r.mat3.translate(c,c,[n,i]),t.beginPath(),t.save(),t.transform(c[0],c[1],c[3],c[4],c[6],c[7]),t.arc(0,0,s,0,2*Math.PI),t.restore(),t.closePath()}}),t.exports=a},function(t,e,n){var r=n(1),i=n(7),a=n(44),o=function t(e){t.superclass.constructor.call(this,e)};o.ATTRS={x:0,y:0,rs:0,re:0,startAngle:0,endAngle:0,clockwise:!1,lineWidth:1},r.extend(o,i),r.augment(o,{canFill:!0,canStroke:!0,type:"fan",getDefaultAttrs:function(){return{clockwise:!1,lineWidth:1,rs:0,re:0}},calculateBox:function(){var t=this,e=t._attrs,n=e.x,r=e.y,i=e.rs,o=e.re,s=e.startAngle,u=e.endAngle,l=e.clockwise,c=this.getHitLineWidth(),h=a.box(n,r,i,s,u,l),f=a.box(n,r,o,s,u,l),p=Math.min(h.minX,f.minX),d=Math.min(h.minY,f.minY),g=Math.max(h.maxX,f.maxX),v=Math.max(h.maxY,f.maxY),y=c/2;return{minX:p-y,minY:d-y,maxX:g+y,maxY:v+y}},createPath:function(t){var e=this._attrs,n=e.x,r=e.y,i=e.rs,a=e.re,o=e.startAngle,s=e.endAngle,u=e.clockwise,l={x:Math.cos(o)*i+n,y:Math.sin(o)*i+r},c={x:Math.cos(o)*a+n,y:Math.sin(o)*a+r},h={x:Math.cos(s)*i+n,y:Math.sin(s)*i+r};t=t||self.get("context"),t.beginPath(),t.moveTo(l.x,l.y),t.lineTo(c.x,c.y),t.arc(n,r,a,o,s,u),t.lineTo(h.x,h.y),t.arc(n,r,i,s,o,!u),t.closePath()}}),t.exports=o},function(t,e,n){var r=n(1),i=n(7),a=function t(e){t.superclass.constructor.call(this,e)};a.ATTRS={x:0,y:0,img:void 0,width:0,height:0,sx:null,sy:null,swidth:null,sheight:null},r.extend(a,i),r.augment(a,{type:"image",isHitBox:function(){return!1},calculateBox:function(){var t=this._attrs;this._cfg.attrs&&this._cfg.attrs.img===t.img||this._setAttrImg();var e=t.x,n=t.y,r=t.width,i=t.height;return{minX:e,minY:n,maxX:e+r,maxY:n+i}},_beforeSetLoading:function(t){var e=this.get("canvas");return!1===t&&!0===this.get("toDraw")&&(this._cfg.loading=!1,e.draw()),t},_setAttrImg:function(){var t=this,e=t._attrs,n=e.img;if(!r.isString(n))return n instanceof Image?(e.width||t.attr("width",n.width),e.height||t.attr("height",n.height),n):n instanceof HTMLElement&&r.isString(n.nodeName)&&"CANVAS"===n.nodeName.toUpperCase()?(e.width||t.attr("width",Number(n.getAttribute("width"))),e.height||t.attr("height",Number(n.getAttribute("height"))),n):n instanceof ImageData?(e.width||t.attr("width",n.width),e.height||t.attr("height",n.height),n):null;var i=new Image;i.onload=function(){if(t.get("destroyed"))return!1;t.attr("imgSrc",n),t.attr("img",i);var e=t.get("callback");e&&e.call(t),t.set("loading",!1)},i.src=n,i.crossOrigin="Anonymous",t.set("loading",!0)},drawInner:function(t){this._cfg.hasUpdate&&this._setAttrImg(),this.get("loading")?this.set("toDraw",!0):(this._drawImage(t),this._cfg.hasUpdate=!1)},_drawImage:function(t){var e=this._attrs,n=e.x,i=e.y,a=e.img,o=e.width,s=e.height,u=e.sx,l=e.sy,c=e.swidth,h=e.sheight;this.set("toDraw",!1);var f=a;if(f instanceof ImageData&&(f=new Image,f.src=a),f instanceof Image||f instanceof HTMLElement&&r.isString(f.nodeName)&&"CANVAS"===f.nodeName.toUpperCase()){if(r.isNil(u)||r.isNil(l)||r.isNil(c)||r.isNil(h))return void t.drawImage(f,n,i,o,s);if(!r.isNil(u)&&!r.isNil(l)&&!r.isNil(c)&&!r.isNil(h))return void t.drawImage(f,u,l,c,h,n,i,o,s)}}}),t.exports=a},function(t,e,n){var r=n(1),i=n(7),a=n(46),o=n(45),s=function t(e){t.superclass.constructor.call(this,e)};s.ATTRS={x1:0,y1:0,x2:0,y2:0,lineWidth:1,startArrow:!1,endArrow:!1},r.extend(s,i),r.augment(s,{canStroke:!0,type:"line",getDefaultAttrs:function(){return{lineWidth:1,startArrow:!1,endArrow:!1}},calculateBox:function(){var t=this._attrs,e=t.x1,n=t.y1,r=t.x2,i=t.y2,a=this.getHitLineWidth();return o.box(e,n,r,i,a)},createPath:function(t){var e=this._attrs,n=e.x1,r=e.y1,i=e.x2,a=e.y2;t=t||self.get("context"),t.beginPath(),t.moveTo(n,r),t.lineTo(i,a)},afterPath:function(t){var e=this._attrs,n=e.x1,r=e.y1,i=e.x2,o=e.y2;t=t||this.get("context"),e.startArrow&&a.addStartArrow(t,e,i,o,n,r),e.endArrow&&a.addEndArrow(t,e,n,r,i,o)},getPoint:function(t){var e=this._attrs;return{x:o.at(e.x1,e.x2,t),y:o.at(e.y1,e.y2,t)}}}),t.exports=s},function(t,e){t.exports={xAt:function(t,e,n,r,i){return e*Math.cos(t)*Math.cos(i)-n*Math.sin(t)*Math.sin(i)+r},yAt:function(t,e,n,r,i){return e*Math.sin(t)*Math.cos(i)+n*Math.cos(t)*Math.sin(i)+r},xExtrema:function(t,e,n){return Math.atan(-n/e*Math.tan(t))},yExtrema:function(t,e,n){return Math.atan(n/(e*Math.tan(t)))}}},function(t,e,n){var r=n(1),i=r.vec2;function a(t,e,n,r){var i=1-r;return i*(i*t+2*r*e)+r*r*n}function o(t,e,n,r,o,s,u,l,c){var h,f,p,d,g,v,y,m=.005,x=1/0,b=1e-4,_=[u,l];for(g=0;g<1;g+=.05)p=[a(t,n,o,g),a(e,r,s,g)],f=i.squaredDistance(_,p),f<x&&(h=g,x=f);for(x=1/0,y=0;y<32;y++){if(m<b)break;var w=h-m,M=h+m;p=[a(t,n,o,w),a(e,r,s,w)],f=i.squaredDistance(_,p),w>=0&&f<x?(h=w,x=f):(d=[a(t,n,o,M),a(e,r,s,M)],v=i.squaredDistance(_,d),M<=1&&v<x?(h=M,x=v):m*=.5)}return c&&(c.x=a(t,n,o,h),c.y=a(e,r,s,h)),Math.sqrt(x)}function s(t,e,n){var i=t+n-2*e;if(r.isNumberEqual(i,0))return[.5];var a=(t-e)/i;return a<=1&&a>=0?[a]:[]}t.exports={at:a,projectPoint:function(t,e,n,r,i,a,s,u){var l={};return o(t,e,n,r,i,a,s,u,l),l},pointDistance:o,extrema:s}},function(t,e,n){var r=n(1),i=n(7),a=n(47),o=n(36),s=n(46),u=n(71),l=n(69),c=function t(e){t.superclass.constructor.call(this,e)};c.ATTRS={path:null,lineWidth:1,startArrow:!1,endArrow:!1},r.extend(c,i),r.augment(c,{canFill:!0,canStroke:!0,type:"path",getDefaultAttrs:function(){return{lineWidth:1,startArrow:!1,endArrow:!1}},_afterSetAttrPath:function(t){var e=this;if(r.isNil(t))return e.setSilent("segments",null),void e.setSilent("box",void 0);var n,i=o.parsePath(t),s=[];if(r.isArray(i)&&0!==i.length&&("M"===i[0][0]||"m"===i[0][0])){for(var u=i.length,l=0;l<i.length;l++){var c=i[l];n=new a(c,n,l===u-1),s.push(n)}e.setSilent("segments",s),e.setSilent("tCache",null),e.setSilent("box",null)}},calculateBox:function(){var t=this,e=t.get("segments");if(!e)return null;var n=this.getHitLineWidth(),i=1/0,a=-1/0,o=1/0,s=-1/0;return r.each(e,function(t){t.getBBox(n);var e=t.box;e&&(e.minX<i&&(i=e.minX),e.maxX>a&&(a=e.maxX),e.minY<o&&(o=e.minY),e.maxY>s&&(s=e.maxY))}),i===1/0||o===1/0?{minX:0,minY:0,maxX:0,maxY:0}:{minX:i,minY:o,maxX:a,maxY:s}},_setTcache:function(){var t,e,n,i,a=0,o=0,s=[],u=this._cfg.curve;u&&(r.each(u,function(t,e){n=u[e+1],i=t.length,n&&(a+=l.len(t[i-2],t[i-1],n[1],n[2],n[3],n[4],n[5],n[6]))}),r.each(u,function(r,c){n=u[c+1],i=r.length,n&&(t=[],t[0]=o/a,e=l.len(r[i-2],r[i-1],n[1],n[2],n[3],n[4],n[5],n[6]),o+=e,t[1]=o/a,s.push(t))}),this._cfg.tCache=s)},_calculateCurve:function(){var t=this,e=t._attrs,n=e.path;this._cfg.curve=u.pathTocurve(n)},getStartTangent:function(){var t,e,n,i,a=this.get("segments");if(a.length>1)if(t=a[0].endPoint,e=a[1].endPoint,n=a[1].startTangent,i=[],r.isFunction(n)){var o=n();i.push([t.x-o[0],t.y-o[1]]),i.push([t.x,t.y])}else i.push([e.x,e.y]),i.push([t.x,t.y]);return i},getEndTangent:function(){var t,e,n,i,a=this.get("segments"),o=a.length;if(o>1)if(t=a[o-2].endPoint,e=a[o-1].endPoint,n=a[o-1].endTangent,i=[],r.isFunction(n)){var s=n();i.push([e.x-s[0],e.y-s[1]]),i.push([e.x,e.y])}else i.push([t.x,t.y]),i.push([e.x,e.y]);return i},getPoint:function(t){var e,n,i=this._cfg.tCache;i||(this._calculateCurve(),this._setTcache(),i=this._cfg.tCache);var a=this._cfg.curve;if(!i)return a?{x:a[0][1],y:a[0][2]}:null;r.each(i,function(r,i){t>=r[0]&&t<=r[1]&&(e=(t-r[0])/(r[1]-r[0]),n=i)});var o=a[n];if(r.isNil(o)||r.isNil(n))return null;var s=o.length,u=a[n+1];return{x:l.at(o[s-2],u[1],u[3],u[5],1-e),y:l.at(o[s-1],u[2],u[4],u[6],1-e)}},createPath:function(t){var e=this,n=e.get("segments");if(r.isArray(n)){t=t||e.get("context"),t.beginPath();for(var i=n.length,a=0;a<i;a++)n[a].draw(t)}},afterPath:function(t){var e=this,n=e._attrs,i=e.get("segments"),a=n.path;if(t=t||e.get("context"),r.isArray(i)&&1!==i.length&&(n.startArrow||n.endArrow)&&"z"!==a[a.length-1]&&"Z"!==a[a.length-1]&&!n.fill){var o=e.getStartTangent();s.addStartArrow(t,n,o[0][0],o[0][1],o[1][0],o[1][1]);var u=e.getEndTangent();s.addEndArrow(t,n,u[0][0],u[0][1],u[1][0],u[1][1])}}}),t.exports=c},function(t,e,n){var r=n(1),i=n(7),a=function t(e){t.superclass.constructor.call(this,e)};a.ATTRS={points:null,lineWidth:1},r.extend(a,i),r.augment(a,{canFill:!0,canStroke:!0,type:"polygon",getDefaultAttrs:function(){return{lineWidth:1}},calculateBox:function(){var t=this,e=t._attrs,n=e.points,i=this.getHitLineWidth();if(!n||0===n.length)return null;var a=1/0,o=1/0,s=-1/0,u=-1/0;r.each(n,function(t){var e=t[0],n=t[1];e<a&&(a=e),e>s&&(s=e),n<o&&(o=n),n>u&&(u=n)});var l=i/2;return{minX:a-l,minY:o-l,maxX:s+l,maxY:u+l}},createPath:function(t){var e=this,n=e._attrs,i=n.points;i.length<2||(t=t||e.get("context"),t.beginPath(),r.each(i,function(e,n){0===n?t.moveTo(e[0],e[1]):t.lineTo(e[0],e[1])}),t.closePath())}}),t.exports=a},function(t,e,n){var r=n(1),i=n(7),a=n(46),o=n(45),s=function t(e){t.superclass.constructor.call(this,e)};s.ATTRS={points:null,lineWidth:1,startArrow:!1,endArrow:!1,tCache:null},r.extend(s,i),r.augment(s,{canStroke:!0,type:"polyline",tCache:null,getDefaultAttrs:function(){return{lineWidth:1,startArrow:!1,endArrow:!1}},calculateBox:function(){var t=this,e=t._attrs,n=this.getHitLineWidth(),i=e.points;if(!i||0===i.length)return null;var a=1/0,o=1/0,s=-1/0,u=-1/0;r.each(i,function(t){var e=t[0],n=t[1];e<a&&(a=e),e>s&&(s=e),n<o&&(o=n),n>u&&(u=n)});var l=n/2;return{minX:a-l,minY:o-l,maxX:s+l,maxY:u+l}},_setTcache:function(){var t,e,n=this,i=n._attrs,a=i.points,s=0,u=0,l=[];a&&0!==a.length&&(r.each(a,function(t,e){a[e+1]&&(s+=o.len(t[0],t[1],a[e+1][0],a[e+1][1]))}),s<=0||(r.each(a,function(n,r){a[r+1]&&(t=[],t[0]=u/s,e=o.len(n[0],n[1],a[r+1][0],a[r+1][1]),u+=e,t[1]=u/s,l.push(t))}),this.tCache=l))},createPath:function(t){var e,n,r=this,i=r._attrs,a=i.points;if(!(a.length<2)){for(t=t||r.get("context"),t.beginPath(),t.moveTo(a[0][0],a[0][1]),n=1,e=a.length-1;n<e;n++)t.lineTo(a[n][0],a[n][1]);t.lineTo(a[e][0],a[e][1])}},getStartTangent:function(){var t=this.__attrs.points,e=[];return e.push([t[1][0],t[1][1]]),e.push([t[0][0],t[0][1]]),e},getEndTangent:function(){var t=this.__attrs.points,e=t.length-1,n=[];return n.push([t[e-1][0],t[e-1][1]]),n.push([t[e][0],t[e][1]]),n},afterPath:function(t){var e=this,n=e._attrs,r=n.points,i=r.length-1;t=t||e.get("context"),n.startArrow&&a.addStartArrow(t,n,r[1][0],r[1][1],r[0][0],r[0][1]),n.endArrow&&a.addEndArrow(t,n,r[i-1][0],r[i-1][1],r[i][0],r[i][1])},getPoint:function(t){var e,n,i=this._attrs,a=i.points,s=this.tCache;return s||(this._setTcache(),s=this.tCache),r.each(s,function(r,i){t>=r[0]&&t<=r[1]&&(e=(t-r[0])/(r[1]-r[0]),n=i)}),{x:o.at(a[n][0],a[n+1][0],e),y:o.at(a[n][1],a[n+1][1],e)}}}),t.exports=s},function(t,e,n){var r=n(1),i=n(36),a=i.parseRadius,o=n(7),s=function t(e){t.superclass.constructor.call(this,e)};s.ATTRS={x:0,y:0,width:0,height:0,radius:0,lineWidth:1},r.extend(s,o),r.augment(s,{canFill:!0,canStroke:!0,type:"rect",getDefaultAttrs:function(){return{lineWidth:1,radius:0}},calculateBox:function(){var t=this,e=t._attrs,n=e.x,r=e.y,i=e.width,a=e.height,o=this.getHitLineWidth(),s=o/2;return{minX:n-s,minY:r-s,maxX:n+i+s,maxY:r+a+s}},createPath:function(t){var e=this,n=e._attrs,r=n.x,i=n.y,o=n.width,s=n.height,u=n.radius;if(t=t||e.get("context"),t.beginPath(),0===u)t.rect(r,i,o,s);else{var l=a(u);t.moveTo(r+l.r1,i),t.lineTo(r+o-l.r2,i),0!==l.r2&&t.arc(r+o-l.r2,i+l.r2,l.r2,-Math.PI/2,0),t.lineTo(r+o,i+s-l.r3),0!==l.r3&&t.arc(r+o-l.r3,i+s-l.r3,l.r3,0,Math.PI/2),t.lineTo(r+l.r4,i+s),0!==l.r4&&t.arc(r+l.r4,i+s-l.r4,l.r4,Math.PI/2,Math.PI),t.lineTo(r,i+l.r1),0!==l.r1&&t.arc(r+l.r1,i+l.r1,l.r1,Math.PI,1.5*Math.PI),t.closePath()}}}),t.exports=s},function(t,e,n){var r=n(1),i=n(7),a=function t(e){t.superclass.constructor.call(this,e)};a.ATTRS={x:0,y:0,text:null,fontSize:12,fontFamily:"sans-serif",fontStyle:"normal",fontWeight:"normal",fontVariant:"normal",textAlign:"start",textBaseline:"bottom",lineHeight:null,textArr:null},r.extend(a,i),r.augment(a,{canFill:!0,canStroke:!0,type:"text",getDefaultAttrs:function(){return{lineWidth:1,lineCount:1,fontSize:12,fontFamily:"sans-serif",fontStyle:"normal",fontWeight:"normal",fontVariant:"normal",textAlign:"start",textBaseline:"bottom"}},initTransform:function(){var t=this._attrs.fontSize;t&&+t<12&&this.transform([["t",-1*this._attrs.x,-1*this._attrs.y],["s",+t/12,+t/12],["t",this._attrs.x,this._attrs.y]])},_assembleFont:function(){var t=this._attrs,e=t.fontSize,n=t.fontFamily,r=t.fontWeight,i=t.fontStyle,a=t.fontVariant;t.font=[i,a,r,e+"px",n].join(" ")},_setAttrText:function(){var t=this._attrs,e=t.text,n=null;if(r.isString(e)&&-1!==e.indexOf("\n")){n=e.split("\n");var i=n.length;t.lineCount=i}t.textArr=n},_getTextHeight:function(){var t=this._attrs,e=t.lineCount,n=1*t.fontSize;if(e>1){var r=this._getSpaceingY();return n*e+r*(e-1)}return n},isHitBox:function(){return!1},calculateBox:function(){var t=this,e=t._attrs,n=this._cfg;n.attrs&&!n.hasUpdate||(this._assembleFont(),this._setAttrText()),e.textArr||this._setAttrText();var r=e.x,i=e.y,a=t.measureText();if(!a)return{minX:r,minY:i,maxX:r,maxY:i};var o=t._getTextHeight(),s=e.textAlign,u=e.textBaseline,l=t.getHitLineWidth(),c={x:r,y:i-o};s&&("end"===s||"right"===s?c.x-=a:"center"===s&&(c.x-=a/2)),u&&("top"===u?c.y+=o:"middle"===u&&(c.y+=o/2)),this.set("startPoint",c);var h=l/2;return{minX:c.x-h,minY:c.y-h,maxX:c.x+a+h,maxY:c.y+o+h}},_getSpaceingY:function(){var t=this._attrs,e=t.lineHeight,n=1*t.fontSize;return e?e-n:.14*n},drawInner:function(t){var e=this,n=e._attrs,i=this._cfg;i.attrs&&!i.hasUpdate||(this._assembleFont(),this._setAttrText()),t.font=n.font;var a=n.text;if(a){var o=n.textArr,s=n.x,u=n.y;if(t.beginPath(),e.hasStroke()){var l=n.strokeOpacity;r.isNil(l)||1===l||(t.globalAlpha=l),o?e._drawTextArr(t,!1):t.strokeText(a,s,u),t.globalAlpha=1}if(e.hasFill()){var c=n.fillOpacity;r.isNil(c)||1===c||(t.globalAlpha=c),o?e._drawTextArr(t,!0):t.fillText(a,s,u)}i.hasUpdate=!1}},_drawTextArr:function(t,e){var n,i=this._attrs.textArr,a=this._attrs.textBaseline,o=1*this._attrs.fontSize,s=this._getSpaceingY(),u=this._attrs.x,l=this._attrs.y,c=this.getBBox(),h=c.maxY-c.minY;r.each(i,function(r,i){n=l+i*(s+o)-h+o,"middle"===a&&(n+=h-o-(h-o)/2),"top"===a&&(n+=h-o),e?t.fillText(r,u,n):t.strokeText(r,u,n)})},measureText:function(){var t,e=this,n=e._attrs,i=n.text,a=n.font,o=n.textArr,s=0;if(!r.isNil(i)){var u=document.createElement("canvas").getContext("2d");return u.save(),u.font=a,o?r.each(o,function(e){t=u.measureText(e).width,s<t&&(s=t),u.restore()}):(s=u.measureText(i).width,u.restore()),s}}}),t.exports=a},function(t,e,n){t.exports={isFunction:n(14),isObject:n(38),isBoolean:n(185),isNil:n(6),isString:n(15),isArray:n(4),isNumber:n(11),isEmpty:n(161),uniqueId:n(188),clone:n(74),deepMix:n(75),assign:n(10),merge:n(75),upperFirst:n(183),each:n(2),isEqual:n(77),toArray:n(53),extend:n(156),augment:n(152),remove:n(150),isNumberEqual:n(51),toRadian:n(166),toDegree:n(164),mod:n(163),clamp:n(78),createDom:n(153),modifyCSS:n(154),requestAnimationFrame:n(155),getRatio:function(){return window.devicePixelRatio?window.devicePixelRatio:2},mat3:n(79),vec2:n(168),vec3:n(169),transform:n(167)}},function(t,e,n){var r=n(2),i=8,a=4;function o(t){var e=[];return r(t,function(t){e=e.concat(t)}),e}function s(t,e){var n;for(n=e;n>0;n--)if(t%n===0)break;if(1===n)for(n=e;n>0;n--)if((t-1)%n===0)break;return n}t.exports=function(t){var e,n={},r=[],u=t.isRounding,l=o(t.data),c=l.length,h=t.maxCount||i;if(u?(e=s(c-1,h-1)+1,2===e?e=h:e<h-a&&(e=h-a)):e=h,!u&&c<=e+e/2)r=[].concat(l);else{for(var f=parseInt(c/(e-1),10),p=l.map(function(t,e){return e%f===0?l.slice(e,e+f):null}).filter(function(t){return t}),d=1,g=p.length;d<g&&(u?d*f<c-f:d<e-1);d++)r.push(p[d][0]);if(l.length){r.unshift(l[0]);var v=l[c-1];-1===r.indexOf(v)&&r.push(v)}}return n.categories=l,n.ticks=r,n}},function(t,e){var n=12;function r(t){var e=1;if(t===1/0||t===-1/0)throw new Error("Not support Infinity!");if(t<1){var r=0;while(t<1)e/=10,t*=10,r++;e.toString().length>n&&(e=parseFloat(e.toFixed(r)))}else while(t>10)e*=10,t/=10;return e}function i(t,e){var n=t.length;if(0===n)return NaN;var r=t[0];if(e<t[0])return NaN;if(e>=t[n-1])return t[n-1];for(var i=1;i<t.length;i++){if(e<t[i])break;r=t[i]}return r}function a(t,e){var n,r=t.length;if(0===r)return NaN;if(e>t[r-1])return NaN;if(e<t[0])return t[0];for(var i=1;i<t.length;i++)if(e<=t[i]){n=t[i];break}return n}var o={snapFactorTo:function(t,e,i){if(isNaN(t))return NaN;var a=1;if(0!==t){t<0&&(a=-1),t*=a;var s=r(t);a*=s,t/=s}t="floor"===i?o.snapFloor(e,t):"ceil"===i?o.snapCeiling(e,t):o.snapTo(e,t);var u=parseFloat((t*a).toPrecision(n));if(Math.abs(a)<1&&u.toString().length>n){var l=parseInt(1/a),c=a>0?1:-1;u=t/l*c}return u},snapMultiple:function(t,e,n){var r;return r="ceil"===n?Math.ceil(t/e):"floor"===n?Math.floor(t/e):Math.round(t/e),r*e},snapTo:function(t,e){var n=i(t,e),r=a(t,e);if(isNaN(n)||isNaN(r)){if(t[0]>=e)return t[0];var o=t[t.length-1];if(o<=e)return o}return Math.abs(e-n)<Math.abs(r-e)?n:r},snapFloor:function(t,e){return i(t,e)},snapCeiling:function(t,e){return a(t,e)},fixedBase:function(t,e){var n=e.toString(),r=n.indexOf(".");if(-1===r)return Math.round(t);var i=n.substr(r+1).length;return i>20&&(i=20),parseFloat(t.toFixed(i))}};t.exports=o},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(26),a=n(144),o=n(2),s=n(11),u=n(15),l=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n._initDefaultCfg=function(){t.prototype._initDefaultCfg.call(this),this.type="cat",this.isCategory=!0,this.isRounding=!0},n.init=function(){var t=this,e=t.values,n=t.tickCount;if(o(e,function(t,n){e[n]=t.toString()}),!t.ticks){var r=e;if(n){var i=a({maxCount:n,data:e,isRounding:t.isRounding});r=i.ticks}this.ticks=r}},n.getText=function(e){return-1===this.values.indexOf(e)&&s(e)&&(e=this.values[Math.round(e)]),t.prototype.getText.call(this,e)},n.translate=function(t){var e=this.values.indexOf(t);return-1===e&&s(t)?e=t:-1===e&&(e=NaN),e},n.scale=function(t){var e,n=this.rangeMin(),r=this.rangeMax();return(u(t)||-1!==this.values.indexOf(t))&&(t=this.translate(t)),e=this.values.length>1?t/(this.values.length-1):t,n+e*(r-n)},n.invert=function(t){if(u(t))return t;var e=this.rangeMin(),n=this.rangeMax();t<e&&(t=e),t>n&&(t=n);var r=(t-e)/(n-e),i=Math.round(r*(this.values.length-1))%this.values.length;return i=i||0,this.values[i]},e}(i);i.Cat=l,t.exports=l},function(t,e,n){var r=n(181),i=n(26);i.Linear=n(48),i.Identity=n(337),i.Cat=n(146),i.Time=n(341),i.TimeCat=n(340),i.Log=n(338),i.Pow=n(339);var a=function(t){if(i.hasOwnProperty(t)){var e=r(t);i[e]=function(e){return new i[t](e)}}};for(var o in i)a(o);var s=["cat","timeCat"];i.isCategory=function(t){return s.indexOf(t)>=0},t.exports=i},function(t,e,n){var r=n(15),i=n(186);t.exports={toTimeStamp:function(t){return r(t)&&(t=t.indexOf("T")>0?new Date(t).getTime():new Date(t.replace(/-/gi,"/")).getTime()),i(t)&&(t=t.getTime()),t}}},function(t,e,n){var r=n(20),i=Array.prototype.splice,a=function(t,e){if(!r(t))return[];var n=t?e.length:0,a=n-1;while(n--){var o=void 0,s=e[n];n!==a&&s===o||(o=s,i.call(t,s,1))}return t};t.exports=a},function(t,e){var n=Array.prototype,r=n.splice,i=n.indexOf,a=n.slice,o=function(t){for(var e=a.call(arguments,1),n=0;n<e.length;n++){var o=e[n],s=-1;while((s=i.call(t,o))>-1)r.call(t,s,1)}return t};t.exports=o},function(t,e,n){var r=n(2),i=n(49),a=function(t){var e=[];return r(t,function(t){i(e,t)||e.push(t)}),e};t.exports=a},function(t,e,n){var r=n(14),i=n(53),a=n(10),o=function(t){for(var e=i(arguments),n=1;n<e.length;n++){var o=e[n];r(o)&&(o=o.prototype),a(t.prototype,o)}};t.exports=o},function(t,e){var n=document.createElement("table"),r=document.createElement("tr"),i=/^\s*<(\w+|!)[^>]*>/,a={tr:document.createElement("tbody"),tbody:n,thead:n,tfoot:n,td:r,th:r,"*":document.createElement("div")};t.exports=function(t){var e=i.test(t)&&RegExp.$1;e in a||(e="*");var n=a[e];t=t.replace(/(^\s*)|(\s*$)/g,""),n.innerHTML=""+t;var r=n.childNodes[0];return n.removeChild(r),r}},function(t,e){t.exports=function(t,e){if(t)for(var n in e)e.hasOwnProperty(n)&&(t.style[n]=e[n]);return t}},function(t,e){t.exports=function(t){var e=window.requestAnimationFrame||window.webkitRequestAnimationFrame||function(t){return setTimeout(t,16)};return e(t)}},function(t,e,n){var r=n(14),i=n(10),a=function(t,e,n,a){r(e)||(n=e,e=t,t=function(){});var o=Object.create?function(t,e){return Object.create(t,{constructor:{value:e}})}:function(t,e){function n(){}n.prototype=t;var r=new n;return r.constructor=e,r},s=o(e.prototype,t);return t.prototype=i(s,t.prototype),t.superclass=o(e.prototype,e),i(s,n),i(t,a),t};t.exports=a},function(t,e,n){var r=n(2),i=n(4),a=Object.prototype.hasOwnProperty,o=function(t,e){if(!e||!i(t))return t;var n={},o=null;return r(t,function(t){o=e(t),a.call(n,o)?n[o].push(t):n[o]=[t]}),n};t.exports=o},function(t,e,n){var r=n(14),i=n(4),a=n(157),o=function(t,e){if(!e)return{0:t};if(!r(e)){var n=i(e)?e:e.replace(/\s+/g,"").split("*");e=function(t){for(var e="_",r=0,i=n.length;r<i;r++)e+=t[n[r]]&&t[n[r]].toString();return e}}var o=a(t,e);return o};t.exports=o},function(t,e,n){var r=n(158),i=function(t,e){if(!e)return[t];var n=r(t,e),i=[];for(var a in n)i.push(n[a]);return i};t.exports=i},function(t,e,n){var r=n(2),i=n(10),a=n(362),o=n(348),s=n(364),u=n(366),l=n(374),c=n(52),h=n(385),f=n(389),p=n(393),d=n(398),g={DOMUtil:a,DomUtil:a,MatrixUtil:c,PathUtil:f,arrayUtil:o,domUtil:a,eventUtil:s,formatUtil:u,mathUtil:l,matrixUtil:c,objectUtil:h,stringUtil:p,pathUtil:f,typeUtil:d,augment:n(152),clone:n(74),debounce:n(353),deepMix:n(75),each:r,extend:n(156),filter:n(76),group:n(159),groupBy:n(157),groupToMap:n(158),indexOf:n(370),isEmpty:n(161),isEqual:n(77),isEqualWith:n(371),map:n(372),mix:i,pick:n(392),throttle:n(397),toArray:n(53),toString:n(37),uniqueId:n(188)};r([a,o,s,u,l,c,h,f,p,d],function(t){i(g,t)}),t.exports=g},function(t,e,n){var r=n(6),i=n(20),a=n(184),o=n(187),s=Object.prototype.hasOwnProperty;function u(t){if(r(t))return!0;if(i(t))return!t.length;var e=a(t);if("Map"===e||"Set"===e)return!t.size;if(o(t))return!Object.keys(t).length;for(var n in t)if(s.call(t,n))return!1;return!0}t.exports=u},function(t,e,n){var r=n(4),i=n(14),a=n(2),o=function(t,e){if(r(t)){var n=t[0],o=void 0;o=i(e)?e(t[0]):t[0][e];var s=void 0;return a(t,function(t){s=i(e)?e(t):t[e],s>o&&(n=t,o=s)}),n}};t.exports=o},function(t,e){var n=function(t,e){return(t%e+e)%e};t.exports=n},function(t,e){var n=180/Math.PI,r=function(t){return n*t};t.exports=r},function(t,e){t.exports=parseInt},function(t,e){var n=Math.PI/180,r=function(t){return n*t};t.exports=r},function(t,e,n){var r=n(74),i=n(2),a=n(79);t.exports=function(t,e){return t=r(t),i(e,function(e){switch(e[0]){case"t":a.translate(t,t,[e[1],e[2]]);break;case"s":a.scale(t,t,[e[1],e[2]]);break;case"r":a.rotate(t,t,e[1]);break;case"m":a.multiply(t,t,e[1]);break;default:return!1}}),t}},function(t,e,n){var r=n(333),i=n(78);r.angle=function(t,e){var n=r.dot(t,e)/(r.length(t)*r.length(e));return Math.acos(i(n,-1,1))},r.direction=function(t,e){return t[0]*e[1]-e[0]*t[1]},r.angleTo=function(t,e,n){var i=r.angle(t,e),a=r.direction(t,e)>=0;return n?a?2*Math.PI-i:i:a?i:2*Math.PI-i},r.vertical=function(t,e,n){return n?(t[0]=e[1],t[1]=-1*e[0]):(t[0]=-1*e[1],t[1]=e[0]),t},t.exports=r},function(t,e,n){var r=n(334);t.exports=r},function(t,e){t.exports=function(t,e){return t.hasOwnProperty(e)}},function(t,e,n){var r=n(172),i=n(6);function a(t,e){var n=r(e),a=n.length;if(i(t))return!a;for(var o=0;o<a;o+=1){var s=n[o];if(e[s]!==t[s]||!(s in t))return!1}return!0}t.exports=a},function(t,e,n){var r=n(2),i=n(14),a=Object.keys?function(t){return Object.keys(t)}:function(t){var e=[];return r(t,function(n,r){i(t)&&"prototype"===r||e.push(r)}),e};t.exports=a},function(t,e,n){var r=n(2),i=n(14),a=Object.values?function(t){return Object.values(t)}:function(t){var e=[];return r(t,function(n,r){i(t)&&"prototype"===r||e.push(n)}),e};t.exports=a},function(t,e){t.exports=function(t,e){for(var n=[],r=0,i=t.length;i-2*!e>r;r+=2){var a=[{x:+t[r-2],y:+t[r-1]},{x:+t[r],y:+t[r+1]},{x:+t[r+2],y:+t[r+3]},{x:+t[r+4],y:+t[r+5]}];e?r?i-4===r?a[3]={x:+t[0],y:+t[1]}:i-2===r&&(a[2]={x:+t[0],y:+t[1]},a[3]={x:+t[2],y:+t[3]}):a[0]={x:+t[i-2],y:+t[i-1]}:i-4===r?a[3]=a[2]:r||(a[0]={x:+t[r],y:+t[r+1]}),n.push(["C",(-a[0].x+6*a[1].x+a[2].x)/6,(-a[0].y+6*a[1].y+a[2].y)/6,(a[1].x+6*a[2].x-a[3].x)/6,(a[1].y+6*a[2].y-a[3].y)/6,a[2].x,a[2].y])}return n}},function(t,e){var n=/,?([a-z]),?/gi;t.exports=function(t){return t.join(",").replace(n,"$1")}},function(t,e){var n="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r="\t\n\v\f\r \xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029",i=new RegExp("([a-z])["+r+",]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?["+r+"]*,?["+r+"]*)+)","ig"),a=new RegExp("(-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?)["+r+"]*,?["+r+"]*","ig");t.exports=function(t){if(!t)return null;if(("undefined"===typeof t?"undefined":n(t))===n([]))return t;var e={a:7,c:6,o:2,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,u:3,z:0},r=[];return String(t).replace(i,function(t,n,i){var o=[],s=n.toLowerCase();if(i.replace(a,function(t,e){e&&o.push(+e)}),"m"===s&&o.length>2&&(r.push([n].concat(o.splice(0,2))),s="l",n="m"===n?"l":"L"),"o"===s&&1===o.length&&r.push([n,o[0]]),"r"===s)r.push([n].concat(o));else while(o.length>=e[s])if(r.push([n].concat(o.splice(0,e[s]))),!e[s])break}),r}},function(t,e,n){var r=n(176),i=n(174);function a(t,e,n,r,i){var a=[];if(null===i&&null===r&&(r=n),t=+t,e=+e,n=+n,r=+r,null!==i){var o=Math.PI/180,s=t+n*Math.cos(-r*o),u=t+n*Math.cos(-i*o),l=e+n*Math.sin(-r*o),c=e+n*Math.sin(-i*o);a=[["M",s,l],["A",n,n,0,+(i-r>180),0,u,c]]}else a=[["M",t,e],["m",0,-r],["a",n,r,0,1,1,0,2*r],["a",n,r,0,1,1,0,-2*r],["z"]];return a}t.exports=function(t){if(t=r(t),!t||!t.length)return[["M",0,0]];var e=[],n=0,o=0,s=0,u=0,l=0,c=void 0,h=void 0;"M"===t[0][0]&&(n=+t[0][1],o=+t[0][2],s=n,u=o,l++,e[0]=["M",n,o]);for(var f,p,d=3===t.length&&"M"===t[0][0]&&"R"===t[1][0].toUpperCase()&&"Z"===t[2][0].toUpperCase(),g=l,v=t.length;g<v;g++){if(e.push(f=[]),p=t[g],c=p[0],c!==c.toUpperCase())switch(f[0]=c.toUpperCase(),f[0]){case"A":f[1]=p[1],f[2]=p[2],f[3]=p[3],f[4]=p[4],f[5]=p[5],f[6]=+p[6]+n,f[7]=+p[7]+o;break;case"V":f[1]=+p[1]+o;break;case"H":f[1]=+p[1]+n;break;case"R":h=[n,o].concat(p.slice(1));for(var y=2,m=h.length;y<m;y++)h[y]=+h[y]+n,h[++y]=+h[y]+o;e.pop(),e=e.concat(i(h,d));break;case"O":e.pop(),h=a(n,o,p[1],p[2]),h.push(h[0]),e=e.concat(h);break;case"U":e.pop(),e=e.concat(a(n,o,p[1],p[2],p[3])),f=["U"].concat(e[e.length-1].slice(-2));break;case"M":s=+p[1]+n,u=+p[2]+o;break;default:for(var x=1,b=p.length;x<b;x++)f[x]=+p[x]+(x%2?n:o)}else if("R"===c)h=[n,o].concat(p.slice(1)),e.pop(),e=e.concat(i(h,d)),f=["R"].concat(p.slice(-2));else if("O"===c)e.pop(),h=a(n,o,p[1],p[2]),h.push(h[0]),e=e.concat(h);else if("U"===c)e.pop(),e=e.concat(a(n,o,p[1],p[2],p[3])),f=["U"].concat(e[e.length-1].slice(-2));else for(var _=0,w=p.length;_<w;_++)f[_]=p[_];if(c=c.toUpperCase(),"O"!==c)switch(f[0]){case"Z":n=+s,o=+u;break;case"H":n=f[1];break;case"V":o=f[1];break;case"M":s=f[f.length-2],u=f[f.length-1];break;default:n=f[f.length-2],o=f[f.length-1]}}return e}},function(t,e,n){var r=n(177),i=function t(e,n,r,i,a,o,s,u,l,c){r===i&&(r+=1);var h=120*Math.PI/180,f=Math.PI/180*(+a||0),p=[],d=void 0,g=void 0,v=void 0,y=void 0,m=void 0,x=function(t,e,n){var r=t*Math.cos(n)-e*Math.sin(n),i=t*Math.sin(n)+e*Math.cos(n);return{x:r,y:i}};if(c)g=c[0],v=c[1],y=c[2],m=c[3];else{d=x(e,n,-f),e=d.x,n=d.y,d=x(u,l,-f),u=d.x,l=d.y,e===u&&n===l&&(u+=1,l+=1);var b=(e-u)/2,_=(n-l)/2,w=b*b/(r*r)+_*_/(i*i);w>1&&(w=Math.sqrt(w),r*=w,i*=w);var M=r*r,S=i*i,C=(o===s?-1:1)*Math.sqrt(Math.abs((M*S-M*_*_-S*b*b)/(M*_*_+S*b*b)));y=C*r*_/i+(e+u)/2,m=C*-i*b/r+(n+l)/2,g=Math.asin(((n-m)/i).toFixed(9)),v=Math.asin(((l-m)/i).toFixed(9)),g=e<y?Math.PI-g:g,v=u<y?Math.PI-v:v,g<0&&(g=2*Math.PI+g),v<0&&(v=2*Math.PI+v),s&&g>v&&(g-=2*Math.PI),!s&&v>g&&(v-=2*Math.PI)}var k=v-g;if(Math.abs(k)>h){var A=v,P=u,I=l;v=g+h*(s&&v>g?1:-1),u=y+r*Math.cos(v),l=m+i*Math.sin(v),p=t(u,l,r,i,a,0,s,P,I,[v,A,y,m])}k=v-g;var T=Math.cos(g),O=Math.sin(g),E=Math.cos(v),L=Math.sin(v),D=Math.tan(k/4),F=4/3*r*D,R=4/3*i*D,j=[e,n],B=[e+F*O,n-R*T],N=[u+F*L,l-R*E],z=[u,l];if(B[0]=2*j[0]-B[0],B[1]=2*j[1]-B[1],c)return[B,N,z].concat(p);p=[B,N,z].concat(p).join().split(",");for(var G=[],V=0,Y=p.length;V<Y;V++)G[V]=V%2?x(p[V-1],p[V],f).y:x(p[V],p[V+1],f).x;return G},a=function(t,e,n,r){return[t,e,n,r,n,r]},o=function(t,e,n,r,i,a){var o=1/3,s=2/3;return[o*t+s*n,o*e+s*r,o*i+s*n,o*a+s*r,i,a]};t.exports=function(t,e){var n=r(t),s=e&&r(e),u={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},l={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},c=[],h=[],f="",p="",d=void 0,g=function(t,e,n){var r=void 0,s=void 0;if(!t)return["C",e.x,e.y,e.x,e.y,e.x,e.y];switch(!(t[0]in{T:1,Q:1})&&(e.qx=e.qy=null),t[0]){case"M":e.X=t[1],e.Y=t[2];break;case"A":t=["C"].concat(i.apply(0,[e.x,e.y].concat(t.slice(1))));break;case"S":"C"===n||"S"===n?(r=2*e.x-e.bx,s=2*e.y-e.by):(r=e.x,s=e.y),t=["C",r,s].concat(t.slice(1));break;case"T":"Q"===n||"T"===n?(e.qx=2*e.x-e.qx,e.qy=2*e.y-e.qy):(e.qx=e.x,e.qy=e.y),t=["C"].concat(o(e.x,e.y,e.qx,e.qy,t[1],t[2]));break;case"Q":e.qx=t[1],e.qy=t[2],t=["C"].concat(o(e.x,e.y,t[1],t[2],t[3],t[4]));break;case"L":t=["C"].concat(a(e.x,e.y,t[1],t[2]));break;case"H":t=["C"].concat(a(e.x,e.y,t[1],e.y));break;case"V":t=["C"].concat(a(e.x,e.y,e.x,t[1]));break;case"Z":t=["C"].concat(a(e.x,e.y,e.X,e.Y));break;default:break}return t},v=function(t,e){if(t[e].length>7){t[e].shift();var r=t[e];while(r.length)c[e]="A",s&&(h[e]="A"),t.splice(e++,0,["C"].concat(r.splice(0,6)));t.splice(e,1),d=Math.max(n.length,s&&s.length||0)}},y=function(t,e,r,i,a){t&&e&&"M"===t[a][0]&&"M"!==e[a][0]&&(e.splice(a,0,["M",i.x,i.y]),r.bx=0,r.by=0,r.x=t[a][1],r.y=t[a][2],d=Math.max(n.length,s&&s.length||0))};d=Math.max(n.length,s&&s.length||0);for(var m=0;m<d;m++){n[m]&&(f=n[m][0]),"C"!==f&&(c[m]=f,m&&(p=c[m-1])),n[m]=g(n[m],u,p),"A"!==c[m]&&"C"===f&&(c[m]="C"),v(n,m),s&&(s[m]&&(f=s[m][0]),"C"!==f&&(h[m]=f,m&&(p=h[m-1])),s[m]=g(s[m],l,p),"A"!==h[m]&&"C"===f&&(h[m]="C"),v(s,m)),y(n,s,u,l,m),y(s,n,l,u,m);var x=n[m],b=s&&s[m],_=x.length,w=s&&b.length;u.x=x[_-2],u.y=x[_-1],u.bx=parseFloat(x[_-4])||u.x,u.by=parseFloat(x[_-3])||u.y,l.bx=s&&(parseFloat(b[w-4])||l.x),l.by=s&&(parseFloat(b[w-3])||l.y),l.x=s&&b[w-2],l.y=s&&b[w-1]}return s?[n,s]:n}},function(t,e,n){var r=n(175);t.exports=function(t,e,n,i,a){if(a)return[["M",+t+ +a,e],["l",n-2*a,0],["a",a,a,0,0,1,a,a],["l",0,i-2*a],["a",a,a,0,0,1,-a,a],["l",2*a-n,0],["a",a,a,0,0,1,-a,-a],["l",0,2*a-i],["a",a,a,0,0,1,a,-a],["z"]];var o=[["M",t,e],["l",n,0],["l",0,i],["l",-n,0],["z"]];return o.parsePathArray=r,o}},function(t,e,n){var r=n(37),i=function(t){return r(t).toLowerCase()};t.exports=i},function(t,e,n){var r=n(37),i=function(t){var e=r(t);return e.charAt(0).toLowerCase()+e.substring(1)};t.exports=i},function(t,e,n){var r=n(37),i=function(t){return r(t).toUpperCase()};t.exports=i},function(t,e,n){var r=n(37),i=function(t){var e=r(t);return e.charAt(0).toUpperCase()+e.substring(1)};t.exports=i},function(t,e){var n={}.toString,r=function(t){return n.call(t).replace(/^\[object /,"").replace(/\]$/,"")};t.exports=r},function(t,e,n){var r=n(16),i=function(t){return r(t,"Boolean")};t.exports=i},function(t,e,n){var r=n(16),i=function(t){return r(t,"Date")};t.exports=i},function(t,e){var n=Object.prototype,r=function(t){var e=t&&t.constructor,r="function"===typeof e&&e.prototype||n;return t===r};t.exports=r},function(t,e){var n=function(){var t={};return function(e){return e=e||"g",t[e]?t[e]+=1:t[e]=1,e+t[e]}}();t.exports=n},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={COORD_FUNC_PROPS:["rotate","scale","reflect","transpose"],GEOM_FUNC_PROPS:["position","color","size","shape","opacity","tooltip","style","animate","active","select","sets"]}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(28),i=s(r),a=n(54),o=s(a);function s(t){return t&&t.__esModule?t:{default:t}}for(var u=[{prop:"onPlotMove",event:"plotmove"},{prop:"onPlotEnter",event:"plotenter"},{prop:"onPlotLeave",event:"plotleave"},{prop:"onPlotClick",event:"plotclick"},{prop:"onPlotDblClick",event:"plotdblclick"},{prop:"onItemSelected",event:"itemselected"},{prop:"onItemUnselected",event:"itemunselected"},{prop:"onItemSelectedChange",event:"itemselectedchange"},{prop:"onTooltipChange",event:"tooltip:change"},{prop:"onTooltipShow",event:"tooltip:show"},{prop:"onTooltipHide",event:"tooltip:hide"}],l=["mouseenter","mousemove","mouseleave","click","dblclick","mousedown","mouseup","touchstart","touchmove","touchend"],c=["Mouseenter","Mousemove","Mouseleave","Click","Dblclick","Mousedown","Mouseup","Touchstart","Touchmove","Touchend"],h=["point","area","line","path","interval","schema","polygon","edge","axis-title","axis-label","axis-ticks","axis-line","axis-grid","legend-title","legend-item","legend-marker","legend-text","guide-text","guide-region","guide-line","guide-image","label"],f=["onPoint","onArea","onLine","onPath","onInterval","onSchema","onPolygon","onEdge","onAxisTitle","onAxisLabel","onAxisTicks","onAxisLine","onAxisGrid","onLegendTitle","onLegendItem","onLegendMarker","onLegendText","onGuideText","onGuideRegion","onGuideLine","onGuideImage","onLabel"],p=[],d=0;d<h.length;d+=1)for(var g=0;g<l.length;g+=1)p.push({prop:""+f[d]+c[g],event:h[d]+":"+l[g]});var v=u.concat(p);function y(){return[{prop:"onMouseEnter",event:"mouseenter"},{prop:"onMouseMove",event:"mousemove"},{prop:"onMouseLeave",event:"mouseleave"},{prop:"onClick",event:"click"},{prop:"onDblClick",event:"dblclick"},{prop:"onMouseDown",event:"mousedown"},{prop:"onMouseUp",event:"mouseup"},{prop:"onTouchStart",event:"touchstart"},{prop:"onTouchMove",event:"touchmove"},{prop:"onTouchEnd",event:"touchend"}]}function m(t){var e=y();return o.default.map(e,function(e){var n=e.event;return e.event=t+":"+n,e}),e}var x=y(),b={onMouseEnter:i.default.object,onMouseMove:i.default.object,onMouseLeave:i.default.object,onClick:i.default.oneOfType([i.default.object,i.default.func]),onDblClick:i.default.object,onMouseDown:i.default.object,onMouseUp:i.default.object,onTouchStart:i.default.object,onTouchMove:i.default.object,onTouchEnd:i.default.object},_={onMouseEnter:i.default.func,onMouseMove:i.default.func,onMouseLeave:i.default.func,onClick:i.default.func,onDblClick:i.default.func,onMouseDown:i.default.func,onMouseUp:i.default.func,onTouchStart:i.default.func,onTouchMove:i.default.func,onTouchEnd:i.default.func};function w(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments[2];o.default.each(e,function(e){var r=e.prop,i=e.event,a=n[r];if(o.default.isFunction(a))t.on(i,a);else if(o.default.isObject(a))for(var s in a)void 0!==a[s]&&t.on(s+":"+i,a[s])})}function M(t,e){w(t,x,e)}function S(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments[2],r=arguments[3];o.default.each(e,function(e){var i=e.prop,a=e.event,s=n[i],u=r[i],l=void 0;if(!o.default.shallowEqual(s,u))if(o.default.isFunction(s)&&o.default.isFunction(u))t.off(a,s),t.on(a,u);else if(o.default.isObject(s)&&o.default.isObject(u)){for(l in s)Object.prototype.hasOwnProperty.call(s,l)&&t.off(l+":"+a,s[l]);for(l in u)Object.prototype.hasOwnProperty.call(u,l)&&t.on(l+":"+a,u[l])}})}function C(t,e,n){S(t,x,e,n)}function k(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments[2];o.default.each(e,function(e){var r=e.prop,i=e.event,a=n[r];if(o.default.isFunction(a))t.off(i,a);else if(o.default.isObject(a))for(var s in a)Object.prototype.hasOwnProperty.call(a,s)&&t.off(s+":"+i,a[s])})}function A(t,e){k(t,x,e)}e.default={baseEventObjectTypes:b,baseEventFuncTypes:_,genBaseEvents:y,genItemBaseEvents:m,bindEvents:w,bindBaseEvents:M,updateEvents:S,updateBaseEvents:C,unbindEvents:k,unbindBaseEvents:A,chartEvents:v}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},i=n(65),a=d(i),o=n(82),s=n(189),u=p(s),l=n(190),c=p(l),h=n(81),f=p(h);function p(t){return t&&t.__esModule?t:{default:t}}function d(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function g(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e<t.length;e++)n[e]=t[e];return n}return Array.from(t)}function v(t,e){var n={};for(var r in t)e.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n}var y=u.default.COORD_FUNC_PROPS,m=u.default.GEOM_FUNC_PROPS;e.default={createChart:function(t){var e=t.chart,n=new a.Chart(e.props);return e.g2Instance=n,n},executeChartConfig:function(t,e){var n=e.chart,r=n.props;t.coord("rect",{}),t.source(r.data,r.scale),(e.facet||r.axis)&&e.facet&&!1!==r.axis||t.axis(!1),t.legend(!1),t.tooltip(!1),r.filter&&r.filter.forEach(function(e){t.filter(e[0],e[1])}),c.default.bindEvents(t,c.default.chartEvents,r),c.default.bindBaseEvents(t,r)},coord:function(t,e){var n=e.coord;if(n&&!n.g2Instance){var r=n.props,i=r.type,a=v(r,["type"]),s=t.coord(i||"rect",o.Util.without(a,y));o.Prop.init(y,a,function(t,e){"reflect"===e?o.Util.each(t,function(t){return s[e](t)}):s[e].apply(s,g(t))}),n.g2Instance=s}},createLabel:function(t,e){if(e&&!e.g2Instance){var n=e.props,r=n.content,i=v(n,["content"]);r&&(o.Util.isArray(r)?e.g2Instance=t.label(r[0],r[1],i):e.g2Instance=t.label(r,i))}},createGeom:function(t,e){if(e.g2Instance)e.label&&this.createLabel(e.g2Instance,e.label);else{var n=e.props,r=t[n.type||"interval"]();n.adjust&&r.adjust(n.adjust),o.Prop.init(m,n,function(t,e){r[e].apply(r,g(t))}),e.g2Instance=r,this.createLabel(r,e.label)}},geoms:function(t,e){var n=e.geoms;if(n)for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&this.createGeom(t,n[r])},legends:function(t,e){var n=e.legends;for(var r in n)if(n[r]){var i=n[r];if(i.g2Instance)return;var a=i.props,o=a.name,s=a.visible,u=v(a,["name","visible"]),l=s;Object.prototype.hasOwnProperty.call(i.props,"visible")||(l=!0);var c=l?u:l;i.g2Instance=t.legend.apply(t,g(o?[o,c]:[c]))}},tooltip:function(t,e){var n=e.tooltip;n&&!n.g2Instance&&(n.g2Instance=t.tooltip(r({},n.props)))},createAxis:function(t,e){if(!e.g2Instance){var n=e.props,r=n.name,i=n.visible,a=v(n,["name","visible"]);i||!Object.prototype.hasOwnProperty.call(e.props,"visible")?e.g2Instance=t.axis(r,a):e.g2Instance=t.axis(r,!1)}},axises:function(t,e){var n=e.axises;for(var r in n)n[r]&&this.createAxis(t,n[r])},views:function(t,e){var n=e.views;for(var r in n)n[r]&&this.createView(t,n[r])},createView:function(t,e){if("Facet"!==e.parentInfo.name){if(e.g2Instance)return e.filter&&e.filter.forEach(function(t){e.g2Instance.filter(t[0],t[1])}),this.coord(e.g2Instance,e),this.axises(e.g2Instance,e),this.geoms(e.g2Instance,e),void this.guide(e.g2Instance,e.guide);var n=e.props,i=n.scale,a=n.data,o=n.instance,s=n.axis,u=n.filter,l=(n.geoms,v(n,["scale","data","instance","axis","filter","geoms"])),c=void 0;c=o||t.view(r({},l)),a&&c.source(a,i),i&&c.scale(i),u&&u.forEach(function(t){c.filter(t[0],t[1])}),!0===s||o||c.axis(!1),e.g2Instance=c,this.coord(c,e),this.axises(c,e),this.geoms(c,e),this.guide(c,e.guide)}},facetView:function(t,e){var n=e.props,r=n.scale,i=n.data,a=n.axis;n.geoms,v(n,["scale","data","axis","geoms"]);i&&t.source(i,r),r&&t.scale(r),!1===a&&t.axis(!1),this.coord(t,e),this.axises(t,e),this.geoms(t,e),this.guide(t,e.guide),f.default.mergeView(e,!0)},guide:function(t,e){if(e){var n=e.elements;for(var r in n)if(n[r]){var i=n[r];if(!i.g2Instance){var a=i.props,o=(a.type,v(a,["type"]));i.g2Instance=t.guide()[i.type](o)}}}},facet:function(t,e){var n=this,r=e.facet;if(r&&!r.g2Instance){var i=r.props,a=i.children,o=i.type,s=v(i,["children","type"]);if(a){var u=e.views,l=null;for(var c in u)if(u[c]&&"Facet"===u[c].parentInfo.name&&u[c].parentInfo.id===r.id){l=u[c];break}l&&(f.default.mergeView(l,!0),s.eachView=function(t){n.facetView(t,l)},t.facet(o,s))}else t.facet(o,s)}},synchronizeG2Add:function(t,e){this.coord(t,e),this.axises(t,e),this.legends(t,e),this.tooltip(t,e),this.geoms(t,e),this.facet(t,e),this.views(t,e),this.guide(t,e.guide)},synchronizeG2Views:function(t,e){var n=e.views;for(var r in n)n[r]&&this.synchronizeG2View(n[r].g2Instance,n[r])},synchronizeG2View:function(t,e){t.clear(),this.clearViewG2Instance(e);var n=e.props,r=n.scale,i=n.data,a=n.instance,o=n.axis;n.geoms,v(n,["scale","data","instance","axis","geoms"]);i&&t.source(i,r),r&&t.scale(r),!0===o||a||t.axis(!1),this.coord(t,e),this.axises(t,e),this.geoms(t,e),this.guide(t,e.guide)},clearViewG2Instance:function(t){t.coord&&delete t.coord.g2Instance,t.axises&&Object.keys(t.axises).forEach(function(e){delete t.axises[e].g2Instance}),t.geoms&&Object.keys(t.geoms).forEach(function(e){delete t.geoms[e].g2Instance,t.geoms[e].label&&delete t.geoms[e].label.g2Instance}),t.guide&&t.guide.elements&&Object.keys(t.guide.elements).forEach(function(e){delete t.guide.elements[e].g2Instance})}}},function(t,e,n){"use strict";n.d(e,"b",function(){return r}),n.d(e,"a",function(){return i});var r=Math.PI/180,i=180/Math.PI},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(434);n.d(e,"easeLinear",function(){return r["a"]});var i=n(436);n.d(e,"easeQuad",function(){return i["a"]}),n.d(e,"easeQuadIn",function(){return i["b"]}),n.d(e,"easeQuadOut",function(){return i["c"]}),n.d(e,"easeQuadInOut",function(){return i["a"]});var a=n(431);n.d(e,"easeCubic",function(){return a["a"]}),n.d(e,"easeCubicIn",function(){return a["b"]}),n.d(e,"easeCubicOut",function(){return a["c"]}),n.d(e,"easeCubicInOut",function(){return a["a"]});var o=n(435);n.d(e,"easePoly",function(){return o["a"]}),n.d(e,"easePolyIn",function(){return o["b"]}),n.d(e,"easePolyOut",function(){return o["c"]}),n.d(e,"easePolyInOut",function(){return o["a"]});var s=n(437);n.d(e,"easeSin",function(){return s["a"]}),n.d(e,"easeSinIn",function(){return s["b"]}),n.d(e,"easeSinOut",function(){return s["c"]}),n.d(e,"easeSinInOut",function(){return s["a"]});var u=n(433);n.d(e,"easeExp",function(){return u["a"]}),n.d(e,"easeExpIn",function(){return u["b"]}),n.d(e,"easeExpOut",function(){return u["c"]}),n.d(e,"easeExpInOut",function(){return u["a"]});var l=n(430);n.d(e,"easeCircle",function(){return l["a"]}),n.d(e,"easeCircleIn",function(){return l["b"]}),n.d(e,"easeCircleOut",function(){return l["c"]}),n.d(e,"easeCircleInOut",function(){return l["a"]});var c=n(429);n.d(e,"easeBounce",function(){return c["a"]}),n.d(e,"easeBounceIn",function(){return c["b"]}),n.d(e,"easeBounceOut",function(){return c["a"]}),n.d(e,"easeBounceInOut",function(){return c["c"]});var h=n(428);n.d(e,"easeBack",function(){return h["a"]}),n.d(e,"easeBackIn",function(){return h["b"]}),n.d(e,"easeBackOut",function(){return h["c"]}),n.d(e,"easeBackInOut",function(){return h["a"]});var f=n(432);n.d(e,"easeElastic",function(){return f["a"]}),n.d(e,"easeElasticIn",function(){return f["b"]}),n.d(e,"easeElasticOut",function(){return f["a"]}),n.d(e,"easeElasticInOut",function(){return f["c"]})},function(t,e,n){"use strict";var r=n(86);e["a"]=function(t,e){var i,a=e?e.length:0,o=t?Math.min(a,t.length):0,s=new Array(o),u=new Array(a);for(i=0;i<o;++i)s[i]=n.i(r["a"])(t[i],e[i]);for(;i<a;++i)u[i]=e[i];return function(t){for(i=0;i<o;++i)u[i]=s[i](t);return u}}},function(t,e,n){"use strict";var r=n(85);e["a"]=function(t){var e=t.length;return function(i){var a=Math.floor(((i%=1)<0?++i:i)*e),o=t[(a+e-1)%e],s=t[a%e],u=t[(a+1)%e],l=t[(a+2)%e];return n.i(r["b"])((i-a/e)*e,o,s,u,l)}}},function(t,e,n){"use strict";e["a"]=function(t){return function(){return t}}},function(t,e,n){"use strict";e["a"]=function(t,e){var n=new Date;return t=+t,e-=t,function(r){return n.setTime(t+e*r),n}}},function(t,e,n){"use strict";var r=n(86);e["a"]=function(t,e){var i,a={},o={};for(i in null!==t&&"object"===typeof t||(t={}),null!==e&&"object"===typeof e||(e={}),e)i in t?a[i]=n.i(r["a"])(t[i],e[i]):o[i]=e[i];return function(t){for(i in a)o[i]=a[i](t);return o}}},function(t,e,n){"use strict";n.d(e,"b",function(){return u}),n.d(e,"c",function(){return l});var r=n(12),i=n(85),a=n(195),o=n(40);function s(t){return function(e){var i,a,o=e.length,s=new Array(o),u=new Array(o),l=new Array(o);for(i=0;i<o;++i)a=n.i(r["e"])(e[i]),s[i]=a.r||0,u[i]=a.g||0,l[i]=a.b||0;return s=t(s),u=t(u),l=t(l),a.opacity=1,function(t){return a.r=s(t),a.g=u(t),a.b=l(t),a+""}}}e["a"]=function t(e){var i=n.i(o["c"])(e);function a(t,e){var a=i((t=n.i(r["e"])(t)).r,(e=n.i(r["e"])(e)).r),s=i(t.g,e.g),u=i(t.b,e.b),l=n.i(o["a"])(t.opacity,e.opacity);return function(e){return t.r=a(e),t.g=s(e),t.b=u(e),t.opacity=l(e),t+""}}return a.gamma=t,a}(1);var u=s(i["a"]),l=s(a["a"])},function(t,e,n){"use strict";var r=n(55),i=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,a=new RegExp(i.source,"g");function o(t){return function(){return t}}function s(t){return function(e){return t(e)+""}}e["a"]=function(t,e){var u,l,c,h=i.lastIndex=a.lastIndex=0,f=-1,p=[],d=[];t+="",e+="";while((u=i.exec(t))&&(l=a.exec(e)))(c=l.index)>h&&(c=e.slice(h,c),p[f]?p[f]+=c:p[++f]=c),(u=u[0])===(l=l[0])?p[f]?p[f]+=l:p[++f]=l:(p[++f]=null,d.push({i:f,x:n.i(r["a"])(u,l)})),h=a.lastIndex;return h<e.length&&(c=e.slice(h),p[f]?p[f]+=c:p[++f]=c),p.length<2?d[0]?s(d[0].x):o(e):(e=d.length,function(t){for(var n,r=0;r<e;++r)p[(n=d[r]).i]=n.x(t);return p.join("")})}},function(t,e,n){"use strict";var r=n(89);e["a"]=function(t,e){var i,a=e?e.length:0,o=t?Math.min(a,t.length):0,s=new Array(o),u=new Array(a);for(i=0;i<o;++i)s[i]=n.i(r["a"])(t[i],e[i]);for(;i<a;++i)u[i]=e[i];return function(t){for(i=0;i<o;++i)u[i]=s[i](t);return u}}},function(t,e,n){"use strict";var r=n(87);e["a"]=function(t){var e=t.length;return function(i){var a=Math.floor(((i%=1)<0?++i:i)*e),o=t[(a+e-1)%e],s=t[a%e],u=t[(a+1)%e],l=t[(a+2)%e];return n.i(r["b"])((i-a/e)*e,o,s,u,l)}}},function(t,e,n){"use strict";e["a"]=function(t){return function(){return t}}},function(t,e,n){"use strict";e["a"]=function(t,e){var n=new Date;return t=+t,e-=t,function(r){return n.setTime(t+e*r),n}}},function(t,e,n){"use strict";var r=n(89);e["a"]=function(t,e){var i,a={},o={};for(i in null!==t&&"object"===typeof t||(t={}),null!==e&&"object"===typeof e||(e={}),e)i in t?a[i]=n.i(r["a"])(t[i],e[i]):o[i]=e[i];return function(t){for(i in a)o[i]=a[i](t);return o}}},function(t,e,n){"use strict";var r=n(12),i=n(87),a=n(202),o=n(30);function s(t){return function(e){var i,a,o=e.length,s=new Array(o),u=new Array(o),l=new Array(o);for(i=0;i<o;++i)a=n.i(r["e"])(e[i]),s[i]=a.r||0,u[i]=a.g||0,l[i]=a.b||0;return s=t(s),u=t(u),l=t(l),a.opacity=1,function(t){return a.r=s(t),a.g=u(t),a.b=l(t),a+""}}}e["a"]=function t(e){var i=n.i(o["c"])(e);function a(t,e){var a=i((t=n.i(r["e"])(t)).r,(e=n.i(r["e"])(e)).r),s=i(t.g,e.g),u=i(t.b,e.b),l=n.i(o["a"])(t.opacity,e.opacity);return function(e){return t.r=a(e),t.g=s(e),t.b=u(e),t.opacity=l(e),t+""}}return a.gamma=t,a}(1);s(i["a"]),s(a["a"])},function(t,e,n){"use strict";var r=n(56),i=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,a=new RegExp(i.source,"g");function o(t){return function(){return t}}function s(t){return function(e){return t(e)+""}}e["a"]=function(t,e){var u,l,c,h=i.lastIndex=a.lastIndex=0,f=-1,p=[],d=[];t+="",e+="";while((u=i.exec(t))&&(l=a.exec(e)))(c=l.index)>h&&(c=e.slice(h,c),p[f]?p[f]+=c:p[++f]=c),(u=u[0])===(l=l[0])?p[f]?p[f]+=l:p[++f]=l:(p[++f]=null,d.push({i:f,x:n.i(r["a"])(u,l)})),h=a.lastIndex;return h<e.length&&(c=e.slice(h),p[f]?p[f]+=c:p[++f]=c),p.length<2?d[0]?s(d[0].x):o(e):(e=d.length,function(t){for(var n,r=0;r<e;++r)p[(n=d[r]).i]=n.x(t);return p.join("")})}},function(t,e,n){"use strict";e["a"]=function(t){return function(){return this.matches(t)}}},function(t,e,n){"use strict";var r=n(17);e["a"]=function(t){return"string"===typeof t?new r["b"]([[document.querySelector(t)]],[document.documentElement]):new r["b"]([[t]],r["c"])}},function(t,e,n){"use strict";e["b"]=a;var r=n(211),i=n(17);function a(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}e["a"]=function(){return new i["b"](this._enter||this._groups.map(r["a"]),this._parents)},a.prototype={constructor:a,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}}},function(t,e,n){"use strict";e["a"]=function(t){return new Array(t.length)}},function(t,e,n){"use strict";e["a"]=s;var r=n(95);function i(t){return function(){this.style.removeProperty(t)}}function a(t,e,n){return function(){this.style.setProperty(t,e,n)}}function o(t,e,n){return function(){var r=e.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function s(t,e){return t.style.getPropertyValue(e)||n.i(r["a"])(t).getComputedStyle(t,null).getPropertyValue(e)}e["b"]=function(t,e,n){return arguments.length>1?this.each((null==e?i:"function"===typeof e?o:a)(t,e,null==n?"":n)):s(this.node(),t)}},function(t,e,n){"use strict";function r(){return[]}e["a"]=function(t){return null==t?r:function(){return this.querySelectorAll(t)}}},function(t,e,n){"use strict";var r=n(13);e["a"]=function(t,e){var n,i,a,o=t.__transition,s=!0;if(o){for(a in e=null==e?null:e+"",o)(n=o[a]).name===e?(i=n.state>r["a"]&&n.state<r["b"],n.state=r["c"],n.timer.stop(),n.on.call(i?"interrupt":"cancel",t,t.__data__,n.index,n.group),delete o[a]):s=!1;s&&delete t.__transition}}},function(t,e,n){"use strict";var r=n(12),i=n(88);e["a"]=function(t,e){var a;return("number"===typeof e?i["b"]:e instanceof r["f"]?i["c"]:(a=n.i(r["f"])(e))?(e=a,i["c"]):i["d"])(t,e)}},function(t,e,n){var r;(function(i){"use strict";var a={},o=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,s=/\d\d?/,u=/\d{3}/,l=/\d{4}/,c=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,h=/\[([^]*?)\]/gm,f=function(){};function p(t,e){for(var n=[],r=0,i=t.length;r<i;r++)n.push(t[r].substr(0,e));return n}function d(t){return function(e,n,r){var i=r[t].indexOf(n.charAt(0).toUpperCase()+n.substr(1).toLowerCase());~i&&(e.month=i)}}function g(t,e){t=String(t),e=e||2;while(t.length<e)t="0"+t;return t}var v=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],y=["January","February","March","April","May","June","July","August","September","October","November","December"],m=p(y,3),x=p(v,3);a.i18n={dayNamesShort:x,dayNames:v,monthNamesShort:m,monthNames:y,amPm:["am","pm"],DoFn:function(t){return t+["th","st","nd","rd"][t%10>3?0:(t-t%10!==10)*t%10]}};var b={D:function(t){return t.getDate()},DD:function(t){return g(t.getDate())},Do:function(t,e){return e.DoFn(t.getDate())},d:function(t){return t.getDay()},dd:function(t){return g(t.getDay())},ddd:function(t,e){return e.dayNamesShort[t.getDay()]},dddd:function(t,e){return e.dayNames[t.getDay()]},M:function(t){return t.getMonth()+1},MM:function(t){return g(t.getMonth()+1)},MMM:function(t,e){return e.monthNamesShort[t.getMonth()]},MMMM:function(t,e){return e.monthNames[t.getMonth()]},YY:function(t){return String(t.getFullYear()).substr(2)},YYYY:function(t){return g(t.getFullYear(),4)},h:function(t){return t.getHours()%12||12},hh:function(t){return g(t.getHours()%12||12)},H:function(t){return t.getHours()},HH:function(t){return g(t.getHours())},m:function(t){return t.getMinutes()},mm:function(t){return g(t.getMinutes())},s:function(t){return t.getSeconds()},ss:function(t){return g(t.getSeconds())},S:function(t){return Math.round(t.getMilliseconds()/100)},SS:function(t){return g(Math.round(t.getMilliseconds()/10),2)},SSS:function(t){return g(t.getMilliseconds(),3)},a:function(t,e){return t.getHours()<12?e.amPm[0]:e.amPm[1]},A:function(t,e){return t.getHours()<12?e.amPm[0].toUpperCase():e.amPm[1].toUpperCase()},ZZ:function(t){var e=t.getTimezoneOffset();return(e>0?"-":"+")+g(100*Math.floor(Math.abs(e)/60)+Math.abs(e)%60,4)}},_={D:[s,function(t,e){t.day=e}],Do:[new RegExp(s.source+c.source),function(t,e){t.day=parseInt(e,10)}],M:[s,function(t,e){t.month=e-1}],YY:[s,function(t,e){var n=new Date,r=+(""+n.getFullYear()).substr(0,2);t.year=""+(e>68?r-1:r)+e}],h:[s,function(t,e){t.hour=e}],m:[s,function(t,e){t.minute=e}],s:[s,function(t,e){t.second=e}],YYYY:[l,function(t,e){t.year=e}],S:[/\d/,function(t,e){t.millisecond=100*e}],SS:[/\d{2}/,function(t,e){t.millisecond=10*e}],SSS:[u,function(t,e){t.millisecond=e}],d:[s,f],ddd:[c,f],MMM:[c,d("monthNamesShort")],MMMM:[c,d("monthNames")],a:[c,function(t,e,n){var r=e.toLowerCase();r===n.amPm[0]?t.isPm=!1:r===n.amPm[1]&&(t.isPm=!0)}],ZZ:[/([\+\-]\d\d:?\d\d|Z)/,function(t,e){"Z"===e&&(e="+00:00");var n,r=(e+"").match(/([\+\-]|\d\d)/gi);r&&(n=60*r[1]+parseInt(r[2],10),t.timezoneOffset="+"===r[0]?n:-n)}]};_.dd=_.d,_.dddd=_.ddd,_.DD=_.D,_.mm=_.m,_.hh=_.H=_.HH=_.h,_.MM=_.M,_.ss=_.s,_.A=_.a,a.masks={default:"ddd MMM DD YYYY HH:mm:ss",shortDate:"M/D/YY",mediumDate:"MMM D, YYYY",longDate:"MMMM D, YYYY",fullDate:"dddd, MMMM D, YYYY",shortTime:"HH:mm",mediumTime:"HH:mm:ss",longTime:"HH:mm:ss.SSS"},a.format=function(t,e,n){var r=n||a.i18n;if("number"===typeof t&&(t=new Date(t)),"[object Date]"!==Object.prototype.toString.call(t)||isNaN(t.getTime()))throw new Error("Invalid Date in fecha.format");e=a.masks[e]||e||a.masks["default"];var i=[];return e=e.replace(h,function(t,e){return i.push(e),"??"}),e=e.replace(o,function(e){return e in b?b[e](t,r):e.slice(1,e.length-1)}),e.replace(/\?\?/g,function(){return i.shift()})},a.parse=function(t,e,n){var r=n||a.i18n;if("string"!==typeof e)throw new Error("Invalid format in fecha.parse");if(e=a.masks[e]||e,t.length>1e3)return!1;var i=!0,s={};if(e.replace(o,function(e){if(_[e]){var n=_[e],a=t.search(n[0]);~a?t.replace(n[0],function(e){return n[1](s,e,r),t=t.substr(a+e.length),e}):i=!1}return _[e]?"":e.slice(1,e.length-1)}),!i)return!1;var u,l=new Date;return!0===s.isPm&&null!=s.hour&&12!==+s.hour?s.hour=+s.hour+12:!1===s.isPm&&12===+s.hour&&(s.hour=0),null!=s.timezoneOffset?(s.minute=+(s.minute||0)-+s.timezoneOffset,u=new Date(Date.UTC(s.year||l.getFullYear(),s.month||0,s.day||1,s.hour||0,s.minute||0,s.second||0,s.millisecond||0))):u=new Date(s.year||l.getFullYear(),s.month||0,s.day||1,s.hour||0,s.minute||0,s.second||0,s.millisecond||0),u},"undefined"!==typeof t&&t.exports?t.exports=a:(r=function(){return a}.call(e,n,e,t),void 0===r||(t.exports=r))})()},function(t,e,n){"use strict";var r="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";t.exports=r},function(t,e,n){"use strict";t.exports=n(525)},function(t,e,n){"use strict";var r=function(){};r=function(t,e,n){var r=arguments.length;n=new Array(r>2?r-2:0);for(var i=2;i<r;i++)n[i-2]=arguments[i];if(void 0===e)throw new Error("`warning(condition, format, ...args)` requires a warning message argument");if(e.length<10||/^[s\W]*$/.test(e))throw new Error("The warning format should be able to uniquely identify this warning. Please, use a more descriptive format than: "+e);if(!t){var a=0,o="Warning: "+e.replace(/%s/g,function(){return n[a++]});"undefined"!==typeof console&&console.error(o);try{throw new Error(o)}catch(t){}}},t.exports=r},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(31),a=n(2),o=.5,s=.5,u=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n._initDefaultCfg=function(){this.marginRatio=o,this.dodgeRatio=s,this.adjustNames=["x","y"]},n.getDodgeOffset=function(t,e,n){var r=this,i=t.pre,a=t.next,o=a-i,s=o*r.dodgeRatio/n,u=r.marginRatio*s,l=.5*(o-n*s-(n-1)*u)+((e+1)*s+e*u)-.5*s-.5*o;return(i+a)/2+l},n.processAdjust=function(t){var e=this,n=t.length,r=e.xField;a(t,function(t,i){for(var a=0,o=t.length;a<o;a++){var s=t[a],u=s[r],l={pre:1===o?u-1:u-.5,next:1===o?u+1:u+.5},c=e.getDodgeOffset(l,i,n);s[r]=c}})},e}(i);i.Dodge=u,t.exports=u},function(t,e,n){var r=n(10),i=n(31),a=n(220),o=n(225),s=n(99),u=n(223),l=n(224);r(i.prototype,s),r(a.prototype,s,u),r(o.prototype,l),i.Jitter=n(222),i.Symmetric=n(226),i.Dodge=a,i.Stack=o,t.exports=i},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(2),a=n(10),o={merge:n(50)},s=n(31),u=n(99),l=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n._initDefaultCfg=function(){this.xField=null,this.yField=null,this.adjustNames=["x","y"],this.groupFields=null},n.processAdjust=function(t){var e=this,n=o.merge(t);e.adjDataArray=t,e.mergeData=n,e.adjustData(t,n),e.adjFrames=null,e.mergeData=null},n.getAdjustOffset=function(t,e){var n=Math.random(),r=e-t,i=.05*r;return t+i+.9*r*n},n._adjustGroup=function(t,e,n,r){var a=this,o=a.getAdjustRange(e,n,r);i(t,function(t){t[e]=a.getAdjustOffset(o.pre,o.next)})},n.adjustDim=function(t,e,n){var r=this,a=r.groupData(n,t);i(a,function(n,i){i=parseFloat(i),r._adjustGroup(n,t,i,e)})},e}(s);a(l.prototype,u),s.Jitter=l,t.exports=l},function(t,e,n){var r={merge:n(50),values:n(73)},i=n(159),a=n(2);t.exports={processAdjust:function(t){var e=this,n=r.merge(t),a=e.dodgeBy,o=t;a&&(o=i(n,a)),e.cacheMap={},e.adjDataArray=o,e.mergeData=n,e.adjustData(o,n),e.adjDataArray=null,e.mergeData=null},getDistribution:function(t){var e=this,n=e.adjDataArray,i=e.cacheMap,o=i[t];return o||(o={},a(n,function(e,n){var i=r.values(e,t);i.length||i.push(0),a(i,function(t){o[t]||(o[t]=[]),o[t].push(n)})}),i[t]=o),o},adjustDim:function(t,e,n,r,i){var o=this,s=o.getDistribution(t),u=o.groupData(n,t);a(u,function(n,r){var u;r=parseFloat(r),u=1===e.length?{pre:e[0]-1,next:e[0]+1}:o.getAdjustRange(t,r,e),a(n,function(e){var n=e[t],r=s[n],a=r.indexOf(i);e[t]=o.getDodgeOffset(u,a,r.length)})})}}},function(t,e){t.exports={_initDefaultCfg:function(){this.xField=null,this.yField=null,this.height=null,this.size=10,this.reverseOrder=!1,this.adjustNames=["y"]},processOneDimStack:function(t){var e=this,n=e.xField,r=e.yField||"y",i=e.height,a={};e.reverseOrder&&(t=t.slice(0).reverse());for(var o=0,s=t.length;o<s;o++)for(var u=t[o],l=0,c=u.length;l<c;l++){var h=u[l],f=h.size||e.size,p=2*f/i,d=h[n];a[d]||(a[d]=p/2),h[r]=a[d],a[d]+=p}},processAdjust:function(t){this.yField?this.processStack(t):this.processOneDimStack(t)}}},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(4),a=n(6),o=n(31),s=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n._initDefaultCfg=function(){this.xField=null,this.yField=null},n.processAdjust=function(t){this.processStack(t)},n.processStack=function(t){var e=this,n=e.xField,r=e.yField,o=t.length,s={positive:{},negative:{}};e.reverseOrder&&(t=t.slice(0).reverse());for(var u=0;u<o;u++)for(var l=t[u],c=0,h=l.length;c<h;c++){var f=l[c],p=f[n]||0,d=f[r],g=p.toString();if(d=i(d)?d[1]:d,!a(d)){var v=d>=0?"positive":"negative";s[v][g]||(s[v][g]=0),f[r]=[s[v][g],d+s[v][g]],s[v][g]+=d}}},e}(o);o.Stack=s,t.exports=s},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(2),a=n(162),o=n(4),s={merge:n(50)},u=n(31),l=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n._initDefaultCfg=function(){this.xField=null,this.yField=null,this.cacheMax=null,this.adjustNames=["y"],this.groupFields=null},n._getMax=function(t){var e=this,n=e.mergeData,r=a(n,function(e){var n=e[t];return o(n)?Math.max.apply(null,n):n}),i=r[t],s=o(i)?Math.max.apply(null,i):i;return s},n._getXValuesMax=function(){var t=this,e=t.yField,n=t.xField,r={},a=t.mergeData;return i(a,function(t){var i=t[n],a=t[e],s=o(a)?Math.max.apply(null,a):a;r[i]=r[i]||0,r[i]<s&&(r[i]=s)}),r},n.processAdjust=function(t){var e=this,n=s.merge(t);e.mergeData=n,e._processSymmetric(t),e.mergeData=null},n._processSymmetric=function(t){var e,n=this,r=n.xField,a=n.yField,s=n._getMax(a),u=t[0][0];u&&o(u[a])&&(e=n._getXValuesMax()),i(t,function(t){i(t,function(t){var n,u=t[a];if(o(u)){var l=t[r],c=e[l];n=(s-c)/2;var h=[];i(u,function(t){h.push(n+t)}),t[a]=h}else n=(s-u)/2,t[a]=[n,u+n]})})},e}(u);u.Symmetric=l,t.exports=l},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(15),a=n(100),o=n(32),s=function(t){function e(e){var n;return n=t.call(this,e)||this,n.names=["color"],n.type="color",n.gradient=null,i(n.values)&&(n.linear=!0),n}r(e,t);var n=e.prototype;return n.getLinearValue=function(t){var e=this.gradient;if(!e){var n=this.values;e=a.gradient(n),this.gradient=e}return e(t)},e}(o);t.exports=s},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(32),a=function(t){function e(e){var n;return n=t.call(this,e)||this,n.names=["opacity"],n.type="opacity",n.gradient=null,n}return r(e,t),e}(i);t.exports=a},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(6),a=n(4),o=n(2),s=n(32),u=function(t){function e(e){var n;return n=t.call(this,e)||this,n.names=["x","y"],n.type="position",n}r(e,t);var n=e.prototype;return n.mapping=function(t,e){var n,r,s,u=this.scales,l=this.coord,c=u[0],h=u[1];if(i(t)||i(e))return[];if(a(e)&&a(t)){n=[],r=[];for(var f=0,p=0,d=t.length,g=e.length;f<d&&p<g;f++,p++)s=l.convertPoint({x:c.scale(t[f]),y:h.scale(e[p])}),n.push(s.x),r.push(s.y)}else if(a(e))t=c.scale(t),r=[],o(e,function(e){e=h.scale(e),s=l.convertPoint({x:t,y:e}),n&&n!==s.x?(a(n)||(n=[n]),n.push(s.x)):n=s.x,r.push(s.y)});else if(a(t))e=h.scale(e),n=[],o(t,function(t){t=c.scale(t),s=l.convertPoint({x:t,y:e}),r&&r!==s.y?(a(r)||(r=[r]),r.push(s.y)):r=s.y,n.push(s.x)});else{t=c.scale(t),e=h.scale(e);var v=l.convertPoint({x:t,y:e});n=v.x,r=v.y}return[n,r]},e}(s);t.exports=u},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(32),a=function(t){function e(e){var n;return n=t.call(this,e)||this,n.names=["shape"],n.type="shape",n.gradient=null,n}r(e,t);var n=e.prototype;return n.getLinearValue=function(t){var e=this.values,n=Math.round((e.length-1)*t);return e[n]},e}(i);t.exports=a},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(32),a=function(t){function e(e){var n;return n=t.call(this,e)||this,n.names=["size"],n.type="size",n.gradient=null,n}return r(e,t),e}(i);t.exports=a},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(3),a=n(33),o=i.MatrixUtil.vec2,s=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return i.mix({},e,{type:"circle",tickInterval:null,startAngle:-Math.PI/2,endAngle:3*Math.PI/2,line:{lineWidth:1,stroke:"#C0D0E0"},tickLine:{lineWidth:1,stroke:"#C0D0E0",length:5},_labelOffset:5})},n.parseTick=function(t,e,n){return{text:t,value:e/n}},n._getCirclePoint=function(t,e){var n=this,r=n.get("center");return e=e||n.get("radius"),{x:r.x+Math.cos(t)*e,y:r.y+Math.sin(t)*e}},n.getTickPoint=function(t){var e=this,n=e.get("startAngle"),r=e.get("endAngle"),i=n+(r-n)*t;return e._getCirclePoint(i)},n.getSideVector=function(t,e){var n=this,r=n.get("center"),a=[e.x-r.x,e.y-r.y];if(!i.isNil(t)){var s=o.length(a);o.scale(a,a,t/s)}return a},n.getSidePoint=function(t,e){var n=this,r=n.getSideVector(e,t);return{x:t.x+r[0],y:t.y+r[1]}},n.getTickEnd=function(t,e){var n=this,r=n.get("tickLine");return e=e||r.length,n.getSidePoint(t,e)},n.getTextAnchor=function(t){var e;return i.snapEqual(t[0],0)?e="center":t[0]>0?e="left":t[0]<0&&(e="right"),e},n.getLinePath=function(){var t=this,e=t.get("center"),n=e.x,r=e.y,i=t.get("radius"),a=i,o=t.get("startAngle"),s=t.get("endAngle"),u=t.get("inner"),l=[];if(Math.abs(s-o)===2*Math.PI)l=[["M",n,r],["m",0,-a],["a",i,a,0,1,1,0,2*a],["a",i,a,0,1,1,0,-2*a],["z"]];else{var c=t._getCirclePoint(o),h=t._getCirclePoint(s),f=Math.abs(s-o)>Math.PI?1:0,p=o>s?0:1;if(u){var d=t.getSideVector(u*i,c),g=t.getSideVector(u*i,h),v={x:d[0]+n,y:d[1]+r},y={x:g[0]+n,y:g[1]+r};l=[["M",v.x,v.y],["L",c.x,c.y],["A",i,a,0,f,p,h.x,h.y],["L",y.x,y.y],["A",i*u,a*u,0,f,Math.abs(p-1),v.x,v.y]]}else l=[["M",n,r],["L",c.x,c.y],["A",i,a,0,f,p,h.x,h.y],["L",n,r]]}return l},n.addLabel=function(e,n,r){var i=this,a=i.get("label").offset||i.get("_labelOffset")||.001;n=i.getSidePoint(n,a),t.prototype.addLabel.call(this,e,n,r)},n.autoRotateLabels=function(){var t=this,e=t.get("ticks"),n=t.get("labelRenderer");if(n&&e.length>12){var r=t.get("radius"),a=t.get("startAngle"),o=t.get("endAngle"),s=o-a,u=s/(e.length-1),l=Math.sin(u/2)*r*2,c=t.getMaxLabelWidth(n);i.each(n.get("group").get("children"),function(t,n){var r=e[n],i=r.value*s+a,o=i%(2*Math.PI);c<l?(o<=0&&(i+=Math.PI),o>Math.PI&&(i-=Math.PI),i-=Math.PI/2,t.attr("textAlign","center")):o>Math.PI/2?i-=Math.PI:o<Math.PI/2*-1&&(i+=Math.PI),t.rotateAtStart(i)})}},e}(a);t.exports=s},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(3),a=n(33),o=i.MatrixUtil,s=i.PathUtil,u=o.vec2,l=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return i.mix({},e,{inner:0,type:"helix",line:{lineWidth:1,stroke:"#C0D0E0"},tickLine:{lineWidth:1,stroke:"#C0D0E0",length:5},startAngle:1.25*Math.PI,endAngle:7.25*Math.PI,a:0,center:null,axisStart:null,crp:[]})},n.getLinePath=function(){var t=this,e=t.get("crp"),n=t.get("axisStart"),r=s.catmullRomToBezier(e);return r.unshift(["M",n.x,n.y]),r},n.getTickPoint=function(t){var e=this,n=e.get("startAngle"),r=e.get("endAngle"),i=n+(r-n)*t;return e._getHelixPoint(i)},n._getHelixPoint=function(t){var e=this,n=e.get("center"),r=e.get("a"),i=r*t+e.get("inner");return{x:n.x+Math.cos(t)*i,y:n.y+Math.sin(t)*i}},n.getSideVector=function(t,e){var n=this,r=n.get("center"),i=[e.x-r.x,e.y-r.y];if(t){var a=u.length(i);u.scale(i,i,t/a)}return i},n.getSidePoint=function(t,e){var n=this,r=n.getSideVector(e,t);return{x:t.x+r[0],y:t.y+r[1]}},n.getTickEnd=function(t,e){var n=this,r=n.get("tickLine");return e=e||r.length,n.getSidePoint(t,e)},e}(a);t.exports=l},function(t,e,n){var r=n(33);r.Base=r,r.Circle=n(232),r.Grid=n(101),r.Helix=n(233),r.Line=n(235),r.Polyline=n(236),t.exports=r},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(33),a=n(3),o=a.MatrixUtil,s=o.vec2,u=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return a.mix({},e,{x:null,y:null,line:{lineWidth:1,stroke:"#C0D0E0"},tickLine:{lineWidth:1,stroke:"#C0D0E0",length:5},isVertical:!1,start:null,end:null})},n._getAvgLabelLength=function(t){var e=t.get("group").get("children");return e[1].attr("x")-e[0].attr("x")},n._getAvgLabelHeightSpace=function(t){var e=t.get("group").get("children");return e[1].attr("y")-e[0].attr("y")},n.getSideVector=function(t){var e=this,n=e.get("isVertical"),r=e.get("factor");if(!a.isNumber(t))return[0,0];var i=e.get("start"),o=e.get("end"),u=e.getAxisVector(),l=s.normalize([],u),c=!1;(n&&i.y<o.y||!n&&i.x>o.x)&&(c=!0);var h=s.vertical([],l,c);return s.scale([],h,t*r)},n.getAxisVector=function(){var t=this.get("start"),e=this.get("end");return[e.x-t.x,e.y-t.y]},n.getLinePath=function(){var t=this,e=t.get("start"),n=t.get("end"),r=[];return r.push(["M",e.x,e.y]),r.push(["L",n.x,n.y]),r},n.getTickEnd=function(t,e){var n=this,r=n.getSideVector(e);return{x:t.x+r[0],y:t.y+r[1]}},n.getTickPoint=function(t){var e=this,n=e.get("start"),r=e.get("end"),i=r.x-n.x,a=r.y-n.y;return{x:n.x+i*t,y:n.y+a*t}},n.renderTitle=function(){var t=this,e=t.get("title"),n=t.getTickPoint(.5),r=e.offset;if(a.isNil(r)){r=20;var i=t.get("labelsGroup");if(i){var o=t.getMaxLabelWidth(i),u=t.get("label").offset||t.get("_labelOffset");r+=o+u}}var l=e.textStyle,c=a.mix({},l);if(e.text){var h=t.getAxisVector();if(e.autoRotate&&a.isNil(l.rotate)){var f=0;if(!a.snapEqual(h[1],0)){var p=[1,0],d=[h[0],h[1]];f=s.angleTo(d,p,!0)}c.rotate=f*(180/Math.PI)}else a.isNil(l.rotate)||(c.rotate=l.rotate/180*Math.PI);var g,v=t.getSideVector(r),y=e.position;g="start"===y?{x:this.get("start").x+v[0],y:this.get("start").y+v[1]}:"end"===y?{x:this.get("end").x+v[0],y:this.get("end").y+v[1]}:{x:n.x+v[0],y:n.y+v[1]},c.x=g.x,c.y=g.y,c.text=e.text;var m=t.get("group"),x=m.addShape("Text",{zIndex:2,attrs:c});x.name="axis-title",t.get("appendInfo")&&x.setSilent("appendInfo",t.get("appendInfo"))}},n.autoRotateLabels=function(){var t=this,e=t.get("labelRenderer"),n=t.get("title");if(e){var r=e.get("group"),i=r.get("children"),o=t.get("label").offset,s=12,u=n?n.offset:48;if(u<0)return;var l,c,h=t.getAxisVector();if(a.snapEqual(h[0],0)&&n&&n.text)c=t.getMaxLabelWidth(e),c>u-o-s&&(l=-1*Math.acos((u-o-s)/c));else if(a.snapEqual(h[1],0)&&i.length>1){var f=Math.abs(t._getAvgLabelLength(e));c=t.getMaxLabelWidth(e),c>f&&(l=Math.asin(1.25*(u-o-s)/c))}if(l){var p=t.get("factor");a.each(i,function(t){t.rotateAtStart(l),a.snapEqual(h[1],0)&&(p>0?t.attr("textAlign","left"):t.attr("textAlign","right"))})}}},n.autoHideLabels=function(){var t,e,n=this,r=n.get("labelRenderer"),i=8;if(r){var o=r.get("group"),s=o.get("children"),u=n.getAxisVector();if(s.length<2)return;if(a.snapEqual(u[0],0)){var l=n.getMaxLabelHeight(r)+i,c=Math.abs(n._getAvgLabelHeightSpace(r));l>c&&(t=l,e=c)}else if(a.snapEqual(u[1],0)&&s.length>1){var h=n.getMaxLabelWidth(r)+i,f=Math.abs(n._getAvgLabelLength(r));h>f&&(t=h,e=f)}if(t&&e){var p=Math.ceil(t/e);a.each(s,function(t,e){e%p!==0&&t.attr("text","")})}}},e}(i);t.exports=u},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(3),a=n(33),o=i.MatrixUtil,s=i.PathUtil,u=o.vec2,l=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return i.mix({},e,{type:"polyline"})},n.getLinePath=function(){var t=this,e=t.get("tickPoints"),n=t.get("start"),r=t.get("end"),a=[];a.push(n.x),a.push(n.y),i.each(e,function(t){a.push(t.x),a.push(t.y)}),a.push(r.x),a.push(r.y);var o=s.catmullRomToBezier(a);return o.unshift(["M",n.x,n.y]),o},n.getTickPoint=function(t,e){var n=this.get("tickPoints");return n[e]},n.getTickEnd=function(t,e,n){var r=this,i=r.get("tickLine"),a=e||i.length,o=r.getSideVector(a,t,n);return{x:t.x+o[0],y:t.y+o[1]}},n.getSideVector=function(t,e,n){var r,i=this;if(0===n){if(r=i.get("start"),r.x===e.x&&r.y===e.y)return[0,0]}else{var a=i.get("tickPoints");r=a[n-1]}var o=[e.x-r.x,e.y-r.y],s=u.normalize([],o),l=u.vertical([],s,!1);return u.scale([],l,t)},e}(a);t.exports=l},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(3),a=n(19),o=Math.PI,s=Math.atan;function u(t,e){var n,r=t.x-e.x,i=t.y-e.y;return 0===i?n=r<0?o/2:270*o/180:r>=0&&i>0?n=2*o-s(r/i):r<=0&&i<0?n=o-s(r/i):r>0&&i<0?n=o+s(-r/i):r<0&&i>0&&(n=s(r/-i)),n}var l=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return i.mix({},e,{name:"arc",start:null,end:null,style:{stroke:"#999",lineWidth:1}})},n.render=function(t,e){var n,r=this,a=r.parsePoint(t,r.get("start")),s=r.parsePoint(t,r.get("end")),l=t.getCenter(),c=Math.sqrt((a.x-l.x)*(a.x-l.x)+(a.y-l.y)*(a.y-l.y)),h=u(a,l),f=u(s,l);if(f<h&&(f+=2*o),i.isNumberEqual(a.x,s.x)&&i.isNumberEqual(a.y,s.y)&&(r.get("start")[0]!==r.get("end")[0]||r.get("start")[1]!==r.get("end")[1]))n=[["M",a.x,a.y],["A",c,c,0,1,1,2*l.x-a.x,2*l.y-a.y],["A",c,c,0,1,1,a.x,a.y]];else{var p=(f-h)%(2*o),d=p>o?1:0;n=[["M",a.x,a.y],["A",c,c,0,d,1,s.x,s.y]]}var g=e.addShape("path",{zIndex:r.get("zIndex"),attrs:i.mix({path:n},r.get("style"))});g.name="guide-arc",r.get("appendInfo")&&g.setSilent("appendInfo",r.get("appendInfo")),r.set("el",g)},e}(a);t.exports=l},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(3),a=n(19),o=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return i.mix({},e,{name:"dataMarker",zIndex:1,top:!0,position:null,style:{point:{r:3,fill:"#FFFFFF",stroke:"#1890FF",lineWidth:2},line:{stroke:"#A3B1BF",lineWidth:1},text:{fill:"#000000",opacity:.65,fontSize:12,textAlign:"start"}},display:{point:!0,line:!0,text:!0},lineLength:20,direction:"upward",autoAdjust:!0})},n.render=function(t,e){var n=this,r=n.parsePoint(t,n.get("position")),i=e.addGroup();i.name="guide-data-marker";var a,o,s=n._getElementPosition(r),u=n.get("display");if(u.line){var l=s.line;a=n._drawLine(l,i)}if(u.text&&n.get("content")){var c=s.text;o=n._drawText(c,i)}if(u.point){var h=s.point;n._drawPoint(h,i)}if(n.get("autoAdjust")){var f=i.getBBox(),p=f.minX,d=f.minY,g=f.maxX,v=f.maxY,y=t.start,m=t.end;if(o){p<=y.x&&o.attr("textAlign","start"),g>=m.x&&o.attr("textAlign","end");var x=n.get("direction");if("upward"===x&&d<=m.y||"upward"!==x&&v>=y.y){var b,_;"upward"===x&&d<=m.y?(b="top",_=1):(b="bottom",_=-1),o.attr("textBaseline",b);var w=0;if(n.get("display").line){w=n.get("lineLength");var M=[["M",r.x,r.y],["L",r.x,r.y+w*_]];a.attr("path",M)}var S=r.y+(w+2)*_;o.attr("y",S)}}}n.get("appendInfo")&&i.setSilent("appendInfo",n.get("appendInfo")),n.set("el",i)},n._getElementPosition=function(t){var e=this,n=t.x,r=t.y,i=e.get("display").line?e.get("lineLength"):0,a=e.get("direction"),o=e.get("style").text;o.textBaseline="upward"===a?"bottom":"top";var s="upward"===a?-1:1,u={x:n,y:r},l={x:n,y:r},c={x:n,y:i*s+r},h={x:n,y:(i+2)*s+r};return{point:u,line:[l,c],text:h}},n._drawLine=function(t,e){var n=this,r=n.get("style").line,a=[["M",t[0].x,t[0].y],["L",t[1].x,t[1].y]],o=e.addShape("path",{attrs:i.mix({path:a},r)});return o},n._drawText=function(t,e){var n=this,r=this.get("style").text,a=e.addShape("text",{attrs:i.mix({text:n.get("content")},r,t)});return a},n._drawPoint=function(t,e){var n=this,r=n.get("style").point,a=e.addShape("circle",{attrs:i.mix({},r,t)});return a},e}(a);t.exports=o},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(3),a=n(102),o=n(19),s=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return i.mix({},e,{name:"dataRegion",start:null,end:null,content:"",style:{region:{lineWidth:0,fill:"#000000",opacity:.04},text:{textAlign:"center",textBaseline:"bottom",fontSize:12,fill:"rgba(0, 0, 0, .65)"}}})},n.render=function(t,e,n){var r=this,a=r.get("lineLength")||0,o=r._getRegionData(t,n);if(o.length){var s=r._getBBox(o),u=[];u.push(["M",o[0].x,s.yMin-a]);for(var l=0,c=o.length;l<c;l++){var h=["L",o[l].x,o[l].y];u.push(h)}u.push(["L",o[o.length-1].x,s.yMin-a]);var f=r.get("style"),p=f.region,d=f.text,g=e.addGroup();g.name="guide-data-region",g.addShape("path",{attrs:i.mix({path:u},p)});var v=r.get("content");v&&g.addShape("Text",{attrs:i.mix({x:(s.xMin+s.xMax)/2,y:s.yMin-a,text:v},d)}),r.get("appendInfo")&&g.setSilent("appendInfo",r.get("appendInfo")),r.set("el",g)}},n._getRegionData=function(t,e){for(var n,r=this,o=r.get("start"),s=r.get("end"),u=a.getFirstScale(r.get("xScales")).field,l=a.getFirstScale(r.get("yScales")).field,c=i.isArray(o)?o[0]:o[u],h=i.isArray(s)?s[0]:s[u],f=[],p=0,d=e.length;p<d;p++){var g=e[p];if(g[u]===c&&(n=p),p>=n&&f.push(r.parsePoint(t,[g[u],g[l]])),g[u]===h)break}return f},n._getBBox=function(t){for(var e=[],n=[],r=0;r<t.length;r++)e.push(t[r].x),n.push(t[r].y);var a=i.arrayUtil.getRange(e),o=i.arrayUtil.getRange(n);return{xMin:a.min,xMax:a.max,yMin:o.min,yMax:o.max}},e}(o);t.exports=s},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(3),a=i.DomUtil,o=n(19),s=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return i.mix({},e,{name:"html",zIndex:7,position:null,alignX:"middle",alignY:"middle",offsetX:null,offsetY:null,html:null})},n.render=function(t,e){var n=this,r=n.parsePoint(t,n.get("position")),o=e.get("canvas").get("el").parentNode,s=a.createDom('<div class="g-guide"></div>');o.appendChild(s);var u=n.get("htmlContent")||n.get("html");if(i.isFunction(u)){var l=n.get("xScales"),c=n.get("yScales");u=u(l,c)}var h=a.createDom(u);s.appendChild(h),a.modifyCSS(s,{position:"absolute"}),n._setDomPosition(s,h,r),n.set("el",s)},n._setDomPosition=function(t,e,n){var r=this,i=r.get("alignX"),o=r.get("alignY"),s=a.getOuterWidth(e),u=a.getOuterHeight(e),l={x:n.x,y:n.y};"middle"===i&&"top"===o?l.x-=Math.round(s/2):"middle"===i&&"bottom"===o?(l.x-=Math.round(s/2),l.y-=Math.round(u)):"left"===i&&"bottom"===o?l.y-=Math.round(u):"left"===i&&"middle"===o?l.y-=Math.round(u/2):"left"===i&&"top"===o?(l.x=n.x,l.y=n.y):"right"===i&&"bottom"===o?(l.x-=Math.round(s),l.y-=Math.round(u)):"right"===i&&"middle"===o?(l.x-=Math.round(s),l.y-=Math.round(u/2)):"right"===i&&"top"===o?l.x-=Math.round(s):(l.x-=Math.round(s/2),l.y-=Math.round(u/2));var c=r.get("offsetX");c&&(l.x+=c);var h=r.get("offsetY");h&&(l.y+=h),a.modifyCSS(t,{top:Math.round(l.y)+"px",left:Math.round(l.x)+"px",visibility:"visible",zIndex:r.get("zIndex")})},n.clear=function(){var t=this,e=t.get("el");e&&e.parentNode&&e.parentNode.removeChild(e)},e}(o);t.exports=s},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(3),a=n(19),o=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return i.mix({},e,{type:"image",start:null,end:null,src:null,offsetX:null,offsetY:null})},n.render=function(t,e){var n=this,r=n.parsePoint(t,n.get("start")),i={x:r.x,y:r.y};if(i.img=n.get("src"),n.get("end")){var a=n.parsePoint(t,n.get("end"));i.width=a.x-r.x,i.height=a.y-r.y}else i.width=n.get("width")||32,i.height=n.get("height")||32;n.get("offsetX")&&(i.x+=n.get("offsetX")),n.get("offsetY")&&(i.y+=n.get("offsetY"));var o=e.addShape("Image",{zIndex:1,attrs:i});o.name="guide-image",n.get("appendInfo")&&o.setSilent("appendInfo",n.get("appendInfo")),n.set("el",o)},e}(a);t.exports=o},function(t,e,n){t.exports={Guide:n(19),Arc:n(237),DataMarker:n(238),DataRegion:n(239),Html:n(240),Image:n(241),Line:n(243),Region:n(244),Text:n(245)}},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(3),a=n(19),o=i.MatrixUtil.vec2,s=n(18),u=s.FONT_FAMILY,l=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return i.mix({},e,{name:"line",start:null,end:null,lineStyle:{stroke:"#000",lineWidth:1},text:{position:"end",autoRotate:!0,style:{fill:"#999",fontSize:12,fontWeight:500,fontFamily:u},content:null}})},n.render=function(t,e){var n=this,r=n.parsePoint(t,n.get("start")),i=n.parsePoint(t,n.get("end")),a=e.addGroup({viewId:e.get("viewId")});n._drawLines(r,i,a);var o=n.get("text");o&&o.content&&n._drawText(r,i,a),n.set("el",a)},n._drawLines=function(t,e,n){var r=[["M",t.x,t.y],["L",e.x,e.y]],a=n.addShape("Path",{attrs:i.mix({path:r},this.get("lineStyle"))});a.name="guide-line",this.get("appendInfo")&&a.setSilent("appendInfo",this.get("appendInfo"))},n._drawText=function(t,e,n){var r,a=this.get("text"),s=a.position,u=a.style||{};r="start"===s?0:"center"===s?.5:i.isString(s)&&-1!==s.indexOf("%")?parseInt(s,10)/100:i.isNumber(s)?s:1,(r>1||r<0)&&(r=1);var l={x:t.x+(e.x-t.x)*r,y:t.y+(e.y-t.y)*r};if(a.offsetX&&(l.x+=a.offsetX),a.offsetY&&(l.y+=a.offsetY),l.text=a.content,l=i.mix({},l,u),a.autoRotate&&i.isNil(u.rotate)){var c=o.angleTo([e.x-t.x,e.y-t.y],[1,0],1);l.rotate=c}else i.isNil(u.rotate)||(l.rotate=u.rotate*Math.PI/180);var h=n.addShape("Text",{attrs:l});h.name="guide-line-text",this.get("appendInfo")&&h.setSilent("appendInfo",this.get("appendInfo"))},e}(a);t.exports=l},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(3),a=n(19),o=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return i.mix({},e,{name:"region",zIndex:1,start:null,end:null,style:{lineWidth:0,fill:"#CCD7EB",opacity:.4}})},n.render=function(t,e){var n=this,r=n.get("style"),a=n._getPath(t),o=e.addShape("path",{zIndex:n.get("zIndex"),attrs:i.mix({path:a},r)});o.name="guide-region",n.get("appendInfo")&&o.setSilent("appendInfo",n.get("appendInfo")),n.set("el",o)},n._getPath=function(t){var e=this,n=e.parsePoint(t,e.get("start")),r=e.parsePoint(t,e.get("end")),i=[["M",n.x,n.y],["L",r.x,n.y],["L",r.x,r.y],["L",n.x,r.y],["z"]];return i},e}(a);t.exports=o},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(3),a=n(19),o=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return i.mix({},e,{name:"text",position:null,content:null,style:{fill:"#999",fontSize:12,fontWeight:500,textAlign:"center"},offsetX:null,offsetY:null,top:!0})},n.render=function(t,e){var n=this,r=n.parsePoint(t,n.get("position")),a=i.mix({},n.get("style")),o=n.get("offsetX"),s=n.get("offsetY");o&&(r.x+=o),s&&(r.y+=s),a.rotate&&(a.rotate=a.rotate*Math.PI/180);var u=e.addShape("Text",{zIndex:n.get("zIndex"),attrs:i.mix({text:n.get("content")},a,r)});u.name="guide-text",n.get("appendInfo")&&u.setSilent("appendInfo",n.get("appendInfo")),n.set("el",u)},e}(a);t.exports=o},function(t,e,n){var r=n(103);t.exports=r},function(t,e){t.exports=function(t,e){for(var n,r,i=[],a=0;a<t.length;a++)n=t[a].getBBox(),r=e[a].getBBox(),n.width>r.width||n.height>r.height?i.push(t[a]):n.width*n.height>r.width*r.height&&i.push(t[a]);for(var o=0;o<i.length;o++)i[o].remove()}},function(t,e,n){var r=n(104);function i(t,e,n,r){var i=t.getBBox(),a=i.width,o=i.height,s={x:e,y:n,textAlign:"center"};switch(r){case 0:s.y-=o/2,s.textAlign="left";break;case 1:s.y-=o/2,s.textAlign="right";break;case 2:s.y+=o/2,s.textAlign="right";break;case 3:s.y+=o/2,s.textAlign="left";break;case 5:s.y-=o/2;break;case 6:s.y+=o/2;break;case 7:s.x+=a/2,s.textAlign="left";break;case 8:s.x-=a/2,s.textAlign="right";break;default:break}return t.attr(s),t.getBBox()}t.exports=function(t){for(var e,n,a,o,s,u=new r,l=[],c=0;c<t.length;c++){n=t[c],a=n.attr("x"),o=n.attr("y"),s=!1;for(var h=0;h<8;h++)if(e=i(n,a,o,h),u.hasGap(e)){u.fillGap(e),s=!0;break}s||l.push(n)}for(var f=0;f<l.length;f++)l[f].remove();return s}},function(t,e,n){var r=n(104),i=20;function a(t,e){var n,r=-1,a=t.attr("x"),o=t.attr("y"),s=t.getBBox(),u=Math.sqrt(s.width*s.width+s.height*s.height),l=-r,c=0,h=0,f=function(t){return[(t*=.1)*Math.cos(t),t*Math.sin(t)]};if(e.hasGap(s))return e.fillGap(s),!0;var p=!1,d=0;while(Math.min(Math.abs(c),Math.abs(h))<u&&d<i)if(n=f(l+=r),c=~~n[0],h=~~n[1],t.attr({x:a+c,y:o+h}),d++,e.hasGap(t.getBBox())){e.fillGap(s),p=!0;break}return p}t.exports=function(t){for(var e,n=new r,i=[],o=0;o<t.length;o++)e=t[o],a(e,n)||i.push(e);for(var s=0;s<i.length;s++)i[s].remove()}},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(3),a=n(106),o=n(18),s=o.FONT_FAMILY,u=i.DomUtil,l="g2-legend-list",c="g2-legend",h="g2-slip",f="g2-caret-up",p="g2-caret-down",d="rgba(0,0,0,0.65)",g="rgba(0,0,0,0.25)";function v(t,e){return t.getElementsByClassName(e)[0]}var y=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return i.mix({},e,{type:"category-page-legend",container:null,caretStyle:{fill:"rgba(0,0,0,0.65)"},pageNumStyle:{display:"inline-block",fontSize:"12px",fontFamily:s,cursor:"default"},slipDomStyle:{width:"auto",height:"auto",position:"absolute"},slipTpl:'<div class="'+h+'" ><svg viewBox="64 64 896 896" class="g2-caret-up" data-icon="left" width="1em" height="1em" aria-hidden="true"><path d="M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8a31.86 31.86 0 0 0 0 50.3l450.8 352.1c5.3 4.1 12.9.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281 360-281.1c3.8-3 6.1-7.7 6.1-12.6z"></path></svg><p class="cur-pagenum" style = "display:inline-block;">1</p><p class="next-pagenum" style = "display:inline-block;">/2</p><svg viewBox="64 64 896 896" class="g2-caret-down" data-icon="right" width="1em" height="1em" aria-hidden="true"><path d="M765.7 486.8L314.9 134.7A7.97 7.97 0 0 0 302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 0 0 0-50.4z"></path></svg></div>',slipWidth:65,legendOverflow:"unset"})},n.render=function(){t.prototype._renderHTML.call(this),this._renderFlipPage()},n._renderFlipPage=function(){var t=document.getElementsByClassName(c)[0],e=v(t,l),n=this.get("position"),r=this.get("layout"),a="right"===n||"left"===n||"vertical"===r?"block":"inline-block";if(t.scrollHeight>t.offsetHeight){var o=this.get("slipTpl"),s=u.createDom(o),h=v(s,f),y=v(s,p);u.modifyCSS(h,this.get("caretStyle")),u.modifyCSS(h,{fill:"rgba(0,0,0,0.25)"}),u.modifyCSS(y,this.get("caretStyle"));var m=v(s,"cur-pagenum"),x=v(s,"next-pagenum"),b=this.get("pageNumStyle");u.modifyCSS(m,i.mix({},b,{paddingLeft:"10px"})),u.modifyCSS(x,i.mix({},b,{opacity:.3,paddingRight:"10px"})),u.modifyCSS(s,i.mix({},this.get("slipDomStyle"),{top:t.offsetHeight+"px"})),t.style.overflow=this.get("legendOverflow"),t.appendChild(s);for(var _=e.childNodes,w=0,M=1,S=[],C=0;C<_.length;C++)_[C].style.display=a,w=_[C].offsetTop+_[C].offsetHeight,w>=t.offsetHeight&&(M++,S.forEach(function(t){t.style.display="none"}),S=[]),S.push(_[C]);x.innerText="/"+M,_.forEach(function(e){e.style.display=a,w=e.offsetTop+e.offsetHeight,w>t.offsetHeight&&(e.style.display="none")}),h.addEventListener("click",function(){if(_[0].style.display!==a){var e=-1;_.forEach(function(t,n){t.style.display===a&&(e=-1===e?n:e,t.style.display="none")});for(var n=e-1;n>=0;n--){if(_[n].style.display=a,w=_[e-1].offsetTop+_[e-1].offsetHeight,_[n].style.display="none",!(w<t.offsetHeight))break;_[n].style.display=a}var r=Number.parseInt(m.innerText,10)-1;h.style.fill=1===r?g:d,y.style.fill=d,m.innerText=r}}),y.addEventListener("click",function(){if(_[_.length-1].style.display!==a){var e=-1;_.forEach(function(t,n){t.style.display===a&&(e=n,t.style.display="none")});for(var n=e+1;n<_.length;n++){if(_[n].style.display=a,w=_[n].offsetTop+_[n].offsetHeight,_[n].style.display="none",!(w<t.offsetHeight))break;_[n].style.display=a}var r=Number.parseInt(m.innerText,10)+1;y.style.fill=r===a?g:d,h.style.fill=d,m.innerText=r}}),this.set("slipDom",s)}},n.destroy=function(){t.prototype.destroy.call(this);var e=this.get("slipDom");e&&e.parentNode&&e.parentNode.removeChild(e)},e}(a);t.exports=y},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(61),a=i.ColorUtil,o=n(3),s=n(63),u=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return o.mix({},e,{type:"color-legend",layout:"vertical",triggerAttr:{fill:"#fff",shadowOffsetX:-2,shadowOffsetY:2,shadowBlur:10,shadowColor:"#ccc",radius:3},isSegment:!1})},n._setPercentage=function(){var t=this.get("items");if(!t[0].percentage){var e=t[0].value,n=t[t.length-1].value;o.each(t,function(t){t.percentage=(t.value-e)/(n-e)})}},n._renderSliderShape=function(){this._setPercentage();var t,e=this.get("slider"),n=e.get("backgroundElement"),r=this.get("width"),i=this.get("height"),s=this.get("layout"),u=this.get("items"),l="";return"vertical"===s?(l+="l (90) ",o.each(u,function(e){t=a.toRGB(e.color),l+=1-e.percentage+":"+t+" "})):(l+="l (0) ",o.each(u,function(e){t=a.toRGB(e.color),l+=e.percentage+":"+t+" "})),this._addMiddleBar(n,"Rect",{x:0,y:0,width:r,height:i,fill:l,strokeOpacity:0})},n._renderUnslidable=function(){this._setPercentage();var t=this.get("titleShape"),e=this.get("titleGap");e=t?t.getBBox().height+e:e;var n,r=this.get("width"),i=this.get("height"),s=this.get("layout"),u=this.get("items"),l="",c=[],h=this.get("group"),f=h.addGroup(),p=u.length;if("vertical"===s){l+="l (90) ";for(var d=0;d<p;d+=1){if(0!==d&&d!==p-1&&(c.push(["M",0,i-u[d].percentage*i]),c.push(["L",r,i-u[d].percentage*i])),n=a.toRGB(u[d].color),l+=1-u[d].percentage+":"+n+" ",this.get("isSegment")&&d>0){var g=a.toRGB(u[d-1].color);l+=1-u[d].percentage+":"+g+" "}f.addShape("text",{attrs:o.mix({},{x:r+this.get("textOffset")/2,y:i-u[d].percentage*i,text:this._formatItemValue(u[d].value)+""},this.get("textStyle"),{textAlign:"start"})})}}else{l+="l (0) ";for(var v=0;v<p;v+=1){if(0!==v&&v!==p-1&&(c.push(["M",u[v].percentage*r,0]),c.push(["L",u[v].percentage*r,i])),n=a.toRGB(u[v].color),this.get("isSegment")&&v>0){var y=a.toRGB(u[v-1].color);l+=u[v].percentage+":"+y+" "}l+=u[v].percentage+":"+n+" ",f.addShape("text",{attrs:o.mix({},{x:u[v].percentage*r,y:i+5+this.get("textOffset"),text:this._formatItemValue(u[v].value)+""},this.get("textStyle"))})}}f.addShape("rect",{attrs:{x:0,y:0,width:r,height:i,fill:l,strokeOpacity:0}}),f.addShape("path",{attrs:o.mix({path:c},this.get("lineStyle"))}),f.move(0,e)},e}(s);t.exports=u},function(t,e,n){t.exports={Category:n(107),CatHtml:n(106),CatPageHtml:n(250),Color:n(251),Size:n(254),CircleSize:n(253)}},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(3),a=n(63),o=2,s=16,u=16,l=5,c=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return i.mix({},e,{type:"size-circle-legend",width:100,height:200,_unslidableCircleStyle:{stroke:"rgb(99, 161, 248)",fill:"rgb(99, 161, 248)",fillOpacity:.3,lineWidth:1.5},triggerAttr:{fill:"white",shadowOffsetX:-2,shadowOffsetY:2,shadowBlur:10,shadowColor:"#ccc"},frontMiddleBarStyle:{fill:"rgb(64, 141, 251)"}})},n._renderSliderShape=function(){var t=l,e=this.get("slider"),n=e.get("backgroundElement"),r=this.get("layout"),a="vertical"===r?o:this.get("width"),s="vertical"===r?this.get("height"):o,u=t,c=this.get("height")/2,h=this.get("frontMiddleBarStyle"),f="vertical"===r?[[0,0],[a,0],[a,s],[0,s]]:[[0,c+s],[0,c-s],[u+a-4,c-s],[u+a-4,c+s]];return this._addMiddleBar(n,"Polygon",i.mix({points:f},h))},n._addHorizontalTrigger=function(t,e,n,r){var a=this.get("slider"),o=a.get(t+"HandleElement"),s=-this.get("height")/2,u=o.addShape("circle",{attrs:i.mix({x:0,y:s,r:r},e)}),l=o.addShape("text",{attrs:i.mix(n,{x:0,y:s+r+10,textAlign:"center",textBaseline:"middle"})}),c=this.get("layout"),h="vertical"===c?"ns-resize":"ew-resize";u.attr("cursor",h),l.attr("cursor",h),this.set(t+"ButtonElement",u),this.set(t+"TextElement",l)},n._addVerticalTrigger=function(t,e,n,r){var a=this.get("slider"),o=a.get(t+"HandleElement"),s=o.addShape("circle",{attrs:i.mix({x:0,y:0,r:r},e)}),u=o.addShape("text",{attrs:i.mix(n,{x:r+10,y:0,textAlign:"start",textBaseline:"middle"})}),l=this.get("layout"),c="vertical"===l?"ns-resize":"ew-resize";s.attr("cursor",c),u.attr("cursor",c),this.set(t+"ButtonElement",s),this.set(t+"TextElement",u)},n._renderTrigger=function(){var t=this.get("firstItem"),e=this.get("lastItem"),n=this.get("layout"),r=this.get("textStyle"),a=this.get("triggerAttr"),o=i.mix({},a),s=i.mix({},a),c=l,h=u,f=i.mix({text:this._formatItemValue(t.value)+""},r),p=i.mix({text:this._formatItemValue(e.value)+""},r);"vertical"===n?(this._addVerticalTrigger("min",o,f,c),this._addVerticalTrigger("max",s,p,h)):(this._addHorizontalTrigger("min",o,f,c),this._addHorizontalTrigger("max",s,p,h))},n._bindEvents=function(){var t=this;if(this.get("slidable")){var e=this.get("slider");e.on("sliderchange",function(e){var n=e.range,r=t.get("firstItem").value,i=t.get("lastItem").value,a=r+n[0]/100*(i-r),o=r+n[1]/100*(i-r),s=l+n[0]/100*(u-l),c=l+n[1]/100*(u-l);t._updateElement(a,o,s,c);var h=new Event("itemfilter",e,!0,!0);h.range=[a,o],t.emit("itemfilter",h)})}},n._updateElement=function(e,n,r,i){t.prototype._updateElement.call(this,e,n);var a=this.get("minTextElement"),o=this.get("maxTextElement"),s=this.get("minButtonElement"),u=this.get("maxButtonElement");s.attr("r",r),u.attr("r",i);var l=this.get("layout");if("vertical"===l)a.attr("x",r+10),o.attr("x",i+10);else{var c=-this.get("height")/2;a.attr("y",c+r+10),o.attr("y",c+i+10)}},n._addCircle=function(t,e,n,r,a){var o=this.get("group"),s=o.addGroup(),u=this.get("_unslidableCircleStyle"),l=this.get("textStyle"),c=this.get("titleShape"),h=this.get("titleGap");c&&(h+=c.getBBox().height),s.addShape("circle",{attrs:i.mix({x:t,y:e+h,r:0===n?1:n},u)}),"vertical"===this.get("layout")?s.addShape("text",{attrs:i.mix({x:a+20+this.get("textOffset"),y:e+h,text:0===r?"0":r},l)}):s.addShape("text",{attrs:i.mix({x:t,y:e+h+a+13+this.get("textOffset"),text:0===r?"0":r},l)})},n._renderUnslidable=function(){var t=this.get("firstItem").value,e=this.get("lastItem").value;if(t>e){var n=e;e=t,t=n}var r=this._formatItemValue(t),i=this._formatItemValue(e),a=t<l?l:t,o=e>u?u:e;a>o&&(a=l,o=u),"vertical"===this.get("layout")?(this._addCircle(o,o,a,r,2*o),this._addCircle(o,2*o+s+a,o,i,2*o)):(this._addCircle(o,o,a,r,2*o),this._addCircle(2*o+s+a,o,o,i,2*o))},n.activate=function(e){this.get("slidable")&&t.prototype.activate.call(this,e)},e}(a);t.exports=c},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(3),a=n(63),o=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return i.mix({},e,{type:"size-legend",width:100,height:200,_unslidableElementStyle:{fill:"#4E7CCC",fillOpacity:1},frontMiddleBarStyle:{fill:"rgb(64, 141, 251)"}})},n._renderSliderShape=function(){var t=this.get("slider"),e=t.get("backgroundElement"),n=this.get("layout"),r=this.get("width"),a=this.get("height"),o=this.get("height")/2,s=this.get("frontMiddleBarStyle"),u="vertical"===n?[[0,0],[r,0],[r,a],[r-4,a]]:[[0,o+a/2],[0,o+a/2-4],[r,o-a/2],[r,o+a/2]];return this._addMiddleBar(e,"Polygon",i.mix({points:u},s))},n._renderUnslidable=function(){var t=this.get("layout"),e=this.get("width"),n=this.get("height"),r=this.get("frontMiddleBarStyle"),a="vertical"===t?[[0,0],[e,0],[e,n],[e-4,n]]:[[0,n],[0,n-4],[e,0],[e,n]],o=this.get("group"),s=o.addGroup();s.addShape("Polygon",{attrs:i.mix({points:a},r)});var u=this._formatItemValue(this.get("firstItem").value),l=this._formatItemValue(this.get("lastItem").value);"vertical"===this.get("layout")?(this._addText(e+10,n-3,u),this._addText(e+10,3,l)):(this._addText(0,n,u),this._addText(e,n,l))},n._addText=function(t,e,n){var r=this.get("group"),a=r.addGroup(),o=this.get("textStyle"),s=this.get("titleShape"),u=this.get("titleGap");s&&(u+=s.getBBox().height),"vertical"===this.get("layout")?a.addShape("text",{attrs:i.mix({x:t+this.get("textOffset"),y:e,text:0===n?"0":n},o)}):(e+=u+this.get("textOffset")-20,s||(e+=10),a.addShape("text",{attrs:i.mix({x:t,y:e,text:0===n?"0":n},o)}))},e}(a);t.exports=o},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(3),a=i.DomUtil,o=i.Group,s=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.getDefaultCfg=function(){return{range:null,middleAttr:{fill:"#fff",fillOpacity:0},backgroundElement:null,minHandleElement:null,maxHandleElement:null,middleHandleElement:null,currentTarget:null,layout:"vertical",width:null,height:null,pageX:null,pageY:null}},n._beforeRenderUI=function(){var t=this.get("layout"),e=this.get("backgroundElement"),n=this.get("minHandleElement"),r=this.get("maxHandleElement"),i=this.addShape("rect",{attrs:this.get("middleAttr")}),a="vertical"===t?"ns-resize":"ew-resize";this.add([e,n,r]),this.set("middleHandleElement",i),e.set("zIndex",0),i.set("zIndex",1),n.set("zIndex",2),r.set("zIndex",2),i.attr("cursor","move"),n.attr("cursor",a),r.attr("cursor",a),this.sort()},n._renderUI=function(){"horizontal"===this.get("layout")?this._renderHorizontal():this._renderVertical()},n._transform=function(t){var e=this.get("range"),n=e[0]/100,r=e[1]/100,i=this.get("width"),a=this.get("height"),o=this.get("minHandleElement"),s=this.get("maxHandleElement"),u=this.get("middleHandleElement");o.resetMatrix(),s.resetMatrix(),"horizontal"===t?(u.attr({x:i*n,y:0,width:(r-n)*i,height:a}),o.translate(n*i,a),s.translate(r*i,a)):(u.attr({x:0,y:a*(1-r),width:i,height:(r-n)*a}),o.translate(1,(1-n)*a),s.translate(1,(1-r)*a))},n._renderHorizontal=function(){this._transform("horizontal")},n._renderVertical=function(){this._transform("vertical")},n._bindUI=function(){this.on("mousedown",i.wrapBehavior(this,"_onMouseDown"))},n._isElement=function(t,e){var n=this.get(e);if(t===n)return!0;if(n.isGroup){var r=n.get("children");return r.indexOf(t)>-1}return!1},n._getRange=function(t,e){var n=t+e;return n=n>100?100:n,n=n<0?0:n,n},n._updateStatus=function(t,e){var n="x"===t?this.get("width"):this.get("height");t=i.upperFirst(t);var r,a=this.get("range"),o=this.get("page"+t),s=this.get("currentTarget"),u=this.get("rangeStash"),l=this.get("layout"),c="vertical"===l?-1:1,h=e["page"+t],f=h-o,p=f/n*100*c;a[1]<=a[0]?(this._isElement(s,"minHandleElement")||this._isElement(s,"maxHandleElement"))&&(a[0]=this._getRange(p,a[0]),a[1]=this._getRange(p,a[0])):(this._isElement(s,"minHandleElement")&&(a[0]=this._getRange(p,a[0])),this._isElement(s,"maxHandleElement")&&(a[1]=this._getRange(p,a[1]))),this._isElement(s,"middleHandleElement")&&(r=u[1]-u[0],a[0]=this._getRange(p,a[0]),a[1]=a[0]+r,a[1]>100&&(a[1]=100,a[0]=a[1]-r)),this.emit("sliderchange",{range:a}),this.set("page"+t,h),this._renderUI(),this.get("canvas").draw()},n._onMouseDown=function(t){var e=t.currentTarget,n=t.event,r=this.get("range");n.stopPropagation(),n.preventDefault(),this.set("pageX",n.pageX),this.set("pageY",n.pageY),this.set("currentTarget",e),this.set("rangeStash",[r[0],r[1]]),this._bindCanvasEvents()},n._bindCanvasEvents=function(){var t=this.get("canvas").get("containerDOM");this.onMouseMoveListener=a.addEventListener(t,"mousemove",i.wrapBehavior(this,"_onCanvasMouseMove")),this.onMouseUpListener=a.addEventListener(t,"mouseup",i.wrapBehavior(this,"_onCanvasMouseUp")),this.onMouseLeaveListener=a.addEventListener(t,"mouseleave",i.wrapBehavior(this,"_onCanvasMouseUp"))},n._onCanvasMouseMove=function(t){if(!this._mouseOutArea(t)){var e=this.get("layout");"horizontal"===e?this._updateStatus("x",t):this._updateStatus("y",t)}},n._onCanvasMouseUp=function(){this._removeDocumentEvents()},n._removeDocumentEvents=function(){this.onMouseMoveListener.remove(),this.onMouseUpListener.remove()},n._mouseOutArea=function(t){var e=this.get("canvas").get("el"),n=e.getBoundingClientRect(),r=this.get("parent"),i=r.getBBox(),a=r.attr("matrix")[6],o=r.attr("matrix")[7],s=a+i.width,u=o+i.height,l=t.clientX-n.x,c=t.clientY-n.y;return l<a||l>s||c<o||c>u},e}(o);t.exports=s},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}function i(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}var a=n(64),o=n(3),s=o.DomUtil,u=n(259),l=n(109),c=n(111),h=n(110),f="g2-tooltip",p="g2-tooltip-title",d="g2-tooltip-list",g="g2-tooltip-marker",v="g2-tooltip-value",y="g2-tooltip-list-item";function m(t,e){return t.getElementsByClassName(e)[0]}function x(t,e){return Object.keys(t).forEach(function(n){e[n]&&(t[n]=o.mix(t[n],e[n]))}),t}var b=function(t){r(n,t);var e=n.prototype;function n(e){var n;n=t.call(this,e)||this,o.assign(i(i(n)),c),o.assign(i(i(n)),h);var r=u;n.style=x(r,e),n._init_(),n.get("items")&&n.render();var a=n.get("crosshairs");if(a){var s="rect"===a.type?n.get("backPlot"):n.get("frontPlot"),f=new l(o.mix({plot:s,plotRange:n.get("plotRange"),canvas:n.get("canvas")},n.get("crosshairs")));f.hide(),n.set("crosshairGroup",f)}return n}return e.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return o.mix({},e,{containerTpl:' <div class="'+f+'"> <div class="'+p+'"></div><ul class="'+d+'"></ul></div>',itemTpl:'<li data-index={index}><span style="background-color:{color};" class='+g+"></span>{name}<span class="+v+">{value}</span></li>",htmlContent:null,follow:!0,enterable:!1})},e._init_=function(){var t,e=this,n=e.get("containerTpl"),r=e.get("canvas").get("el").parentNode;if(!this.get("htmlContent")){if(/^\#/.test(n)){var i=n.replace("#","");t=document.getElementById(i)}else t=s.createDom(n),s.modifyCSS(t,e.style[f]),r.appendChild(t),r.style.position="relative";e.set("container",t)}},e.render=function(){var t=this;if(t.clear(),t.get("htmlContent")){var e=t.get("canvas").get("el").parentNode,n=t._getHtmlContent();e.appendChild(n),t.set("container",n)}else t._renderTpl()},e._renderTpl=function(){var t=this,e=t.get("showTitle"),n=t.get("titleContent"),r=t.get("container"),i=m(r,p),a=m(r,d),u=t.get("items");i&&e&&(s.modifyCSS(i,t.style[p]),i.innerHTML=n),a&&(s.modifyCSS(a,t.style[d]),o.each(u,function(e,n){a.appendChild(t._addItem(e,n))}))},e.clear=function(){var t=this.get("container");if(this.get("htmlContent"))t&&t.remove();else{var e=m(t,p),n=m(t,d);e&&(e.innerHTML=""),n&&(n.innerHTML="")}},e.show=function(){var e=this.get("container");e.style.visibility="visible",e.style.display="block";var n=this.get("crosshairGroup");n&&n.show();var r=this.get("markerGroup");r&&r.show(),t.prototype.show.call(this),this.get("canvas").draw()},e.hide=function(){var e=this.get("container");e.style.visibility="hidden",e.style.display="none";var n=this.get("crosshairGroup");n&&n.hide();var r=this.get("markerGroup");r&&r.hide(),t.prototype.hide.call(this),this.get("canvas").draw()},e.destroy=function(){var e=this,n=e.get("container"),r=e.get("containerTpl");n&&!/^\#/.test(r)&&n.parentNode.removeChild(n);var i=this.get("crosshairGroup");i&&i.destroy();var a=this.get("markerGroup");a&&a.remove(),t.prototype.destroy.call(this)},e._addItem=function(t,e){var n=this.get("itemTpl"),r=o.substitute(n,o.mix({index:e},t)),i=s.createDom(r);s.modifyCSS(i,this.style[y]);var a=m(i,g);a&&s.modifyCSS(a,this.style[g]);var u=m(i,v);return u&&s.modifyCSS(u,this.style[v]),i},e._getHtmlContent=function(){var t=this.get("htmlContent"),e=this.get("titleContent"),n=this.get("items"),r=t(e,n),i=s.createDom(r);return i},e.setPosition=function(e,n,r){var i,a=this.get("container"),u=this.get("canvas").get("el"),l=s.getWidth(u),c=s.getHeight(u),h=a.clientWidth,f=a.clientHeight,p=e,d=n,g=this.get("prePosition")||{x:0,y:0};if(this.get("enterable"))n-=a.clientHeight/2,i=[e,n],g&&e-g.x>0?e-=a.clientWidth+1:e+=1;else if(this.get("position")){var v=a.clientWidth,y=a.clientHeight;i=this._calcTooltipPosition(e,n,this.get("position"),v,y,r),e=i[0],n=i[1]}else i=this._constraintPositionInBoundary(e,n,h,f,l,c),e=i[0],n=i[1];if(this.get("inPlot")){var m=this.get("plotRange");i=this._constraintPositionInPlot(e,n,h,f,m,this.get("enterable")),e=i[0],n=i[1]}var x=this.get("markerItems");o.isEmpty(x)||(p=x[0].x,d=x[0].y),this.set("prePosition",i);var b=this.get("follow");b&&(a.style.left=e+"px",a.style.top=n+"px");var _=this.get("crosshairGroup");if(_){var w=this.get("items");_.setPosition(p,d,w)}t.prototype.setPosition.call(this,e,n)},n}(a);t.exports=b},function(t,e,n){var r=n(64);r.Html=n(256),r.Canvas=n(108),r.Mini=n(258),t.exports=r},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(3),a=n(108),o=n(18),s=o.FONT_FAMILY,u=i.DomUtil,l=i.MatrixUtil,c=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return i.mix({},e,{boardStyle:{x:0,y:0,width:0,height:0,radius:3},valueStyle:{x:0,y:0,text:"",fontFamily:s,fontSize:12,stroke:"#fff",lineWidth:2,fill:"black",textBaseline:"top",textAlign:"start"},padding:{top:5,right:5,bottom:0,left:5},triangleWidth:10,triangleHeight:4})},n._init_=function(){var t=this,e=t.get("padding"),n=t.get("frontPlot"),r=n.addGroup();t.set("container",r);var a=r.addShape("rect",{attrs:i.mix({},t.get("boardStyle"))});t.set("board",a);var o=r.addShape("path",{attrs:{fill:t.get("boardStyle").fill}});t.set("triangleShape",o);var s=r.addGroup();s.move(e.left,e.top);var u=s.addShape("text",{attrs:i.mix({},t.get("valueStyle"))});t.set("valueShape",u)},n.render=function(){var t=this;t.clear();var e=t.get("board"),n=t.get("valueShape"),r=t.get("padding"),i=t.get("items")[0];n&&n.attr("text",i.value);var a=n?n.getBBox():{width:80,height:30},o=r.left+a.width+r.right,s=r.top+a.height+r.bottom;e.attr("width",o),e.attr("height",s),t._centerTriangleShape()},n.clear=function(){var t=this.get("valueShape");t.attr("text","")},n.setPosition=function(t,e,n){var r=this,i=r.get("container"),a=r.get("plotRange"),o=i.getBBox(),s=o.width,c=o.height;if(t-=s/2,n&&("point"===n.name||"interval"===n.name)){var h=n.getBBox().y;e=h}if(e-=c,this.get("inPlot"))t<a.tl.x?(t=a.tl.x,r._leftTriangleShape()):t+s/2>a.tr.x?(t=a.tr.x-s,r._rightTriangleShape()):r._centerTriangleShape(),e<a.tl.y?e=a.tl.y:e+c>a.bl.y&&(e=a.bl.y-c);else{var f=this.get("canvas").get("el"),p=u.getWidth(f),d=u.getHeight(f);t<0?(t=0,r._leftTriangleShape()):t+s/2>p?(t=p-s,r._rightTriangleShape()):r._centerTriangleShape(),e<0?e=0:e+c>d&&(e=d-c)}var g=[1,0,0,0,1,0,0,0,1],v=l.transform(g,[["t",t,e]]);i.stopAnimate(),i.animate({matrix:v},this.get("animationDuration"))},n._centerTriangleShape=function(){var t=this.get("triangleShape"),e=this.get("triangleWidth"),n=this.get("triangleHeight"),r=this.get("board").getBBox(),i=r.width,a=r.height,o=[["M",0,0],["L",e,0],["L",e/2,n],["L",0,0],["Z"]];t.attr("path",o),t.move(i/2-e/2,a-1)},n._leftTriangleShape=function(){var t=this.get("triangleShape"),e=this.get("triangleWidth"),n=this.get("triangleHeight"),r=this.get("board").getBBox(),i=r.height,a=[["M",0,0],["L",e,0],["L",0,n+3],["L",0,0],["Z"]];t.attr("path",a),t.move(0,i-3)},n._rightTriangleShape=function(){var t=this.get("triangleShape"),e=this.get("triangleWidth"),n=this.get("triangleHeight"),r=this.get("board").getBBox(),i=r.width,a=r.height,o=[["M",0,0],["L",e,0],["L",e,n+4],["L",0,0],["Z"]];t.attr("path",o),t.move(i-e-1,a-4)},e}(a);t.exports=c},function(t,e,n){var r,i=n(18),a=i.FONT_FAMILY,o="g2-tooltip",s="g2-tooltip-title",u="g2-tooltip-list",l="g2-tooltip-list-item",c="g2-tooltip-marker",h="g2-tooltip-value",f=(r={crosshairs:!1,offset:15},r[""+o]={position:"absolute",visibility:"hidden",zIndex:8,transition:"visibility 0.2s cubic-bezier(0.23, 1, 0.32, 1), left 0.4s cubic-bezier(0.23, 1, 0.32, 1), top 0.4s cubic-bezier(0.23, 1, 0.32, 1)",backgroundColor:"rgba(255, 255, 255, 0.9)",boxShadow:"0px 0px 10px #aeaeae",borderRadius:"3px",color:"rgb(87, 87, 87)",fontSize:"12px",fontFamily:a,lineHeight:"20px",padding:"10px 10px 6px 10px"},r[""+s]={marginBottom:"4px"},r[""+u]={margin:0,listStyleType:"none",padding:0},r[""+l]={marginBottom:"4px"},r[""+c]={width:"5px",height:"5px",borderRadius:"50%",display:"inline-block",marginRight:"8px"},r[""+h]={display:"inline-block",float:"right",marginLeft:"30px"},r);t.exports=f},function(t,e,n){"use strict";function r(t){return r="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){return!e||"object"!==r(e)&&"function"!==typeof e?o(t):e}function o(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function s(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function u(t,e,n){return e&&s(t.prototype,e),n&&s(t,n),t}function l(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&c(t,e)}function c(t,e){return c=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},c(t,e)}function h(t,e,n){return h="undefined"!==typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=f(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(n):i.value}},h(t,e,n||t)}function f(t,e){while(!Object.prototype.hasOwnProperty.call(t,e))if(t=p(t),null===t)break;return t}function p(t){return p=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},p(t)}var d=n(10),g=n(42),v=function(t){function e(t){var n;return i(this,e),n=a(this,p(e).call(this,t)),n._init(),n}return l(e,t),u(e,[{key:"getDefaultCfg",value:function(){var t=h(p(e.prototype),"getDefaultCfg",this).call(this);return d({},t,{start:{x:0,y:0},end:{x:0,y:0},type:"cartesian",isRect:!0})}}]),u(e,[{key:"_init",value:function(){var t=this.start,e=this.end,n={start:t.x,end:e.x},r={start:t.y,end:e.y};this.x=n,this.y=r}},{key:"convertPoint",value:function(t){var e,n;return this.isTransposed?(e=t.y,n=t.x):(e=t.x,n=t.y),{x:this.convertDim(e,"x"),y:this.convertDim(n,"y")}}},{key:"invertPoint",value:function(t){var e=this.invertDim(t.x,"x"),n=this.invertDim(t.y,"y");return this.isTransposed?{x:n,y:e}:{x:e,y:n}}}]),e}(g);t.exports=v},function(t,e,n){"use strict";function r(t){return r="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){return!e||"object"!==r(e)&&"function"!==typeof e?o(t):e}function o(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function s(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function u(t,e,n){return e&&s(t.prototype,e),n&&s(t,n),t}function l(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&c(t,e)}function c(t,e){return c=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},c(t,e)}function h(t,e,n){return h="undefined"!==typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=f(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(n):i.value}},h(t,e,n||t)}function f(t,e){while(!Object.prototype.hasOwnProperty.call(t,e))if(t=p(t),null===t)break;return t}function p(t){return p=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},p(t)}var d=n(52),g=n(51),v=n(10),y=n(42),m=d.vec2,x=function(t){function e(t){var n;return i(this,e),n=a(this,p(e).call(this,t)),n._init(),n}return l(e,t),u(e,[{key:"getDefaultCfg",value:function(){var t=h(p(e.prototype),"getDefaultCfg",this).call(this);return v({},t,{startAngle:1.25*Math.PI,endAngle:7.25*Math.PI,innerRadius:0,type:"helix",isHelix:!0})}}]),u(e,[{key:"_init",value:function(){var t=this.width,e=this.height,n=this.radius,r=this.innerRadius,i=this.startAngle,a=this.endAngle,o=(a-i)/(2*Math.PI)+1,s=Math.min(t,e)/2;n&&n>=0&&n<=1&&(s*=n);var u=Math.floor(s*(1-r)/o),l=u/(2*Math.PI),c={start:i,end:a},h={start:r*s,end:r*s+.99*u};this.a=l,this.d=u,this.x=c,this.y=h}},{key:"getCenter",value:function(){return this.center}},{key:"convertPoint",value:function(t){var e,n,r=this.a,i=this.center;this.isTransposed?(e=t.y,n=t.x):(e=t.x,n=t.y);var a=this.convertDim(e,"x"),o=r*a,s=this.convertDim(n,"y");return{x:i.x+Math.cos(a)*(o+s),y:i.y+Math.sin(a)*(o+s)}}},{key:"invertPoint",value:function(t){var e=this.center,n=this.a,r=this.d+this.y.start,i=m.subtract([],[t.x,t.y],[e.x,e.y]),a=m.angleTo(i,[1,0],!0),o=a*n;m.length(i)<o&&(o=m.length(i));var s=Math.floor((m.length(i)-o)/r);a=2*s*Math.PI+a;var u=n*a,l=m.length(i)-u;l=g(l,0)?0:l;var c=this.invertDim(a,"x"),h=this.invertDim(l,"y");c=g(c,0)?0:c,h=g(h,0)?0:h;var f={};return f.x=this.isTransposed?h:c,f.y=this.isTransposed?c:h,f}}]),e}(y);t.exports=x},function(t,e,n){"use strict";var r=n(42);r.Cartesian=n(260),r.Rect=r.Cartesian,r.Polar=n(263),r.Helix=n(261),t.exports=r},function(t,e,n){"use strict";function r(t){return r="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){return!e||"object"!==r(e)&&"function"!==typeof e?o(t):e}function o(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function s(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function u(t,e,n){return e&&s(t.prototype,e),n&&s(t,n),t}function l(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&c(t,e)}function c(t,e){return c=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},c(t,e)}function h(t,e,n){return h="undefined"!==typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=f(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(n):i.value}},h(t,e,n||t)}function f(t,e){while(!Object.prototype.hasOwnProperty.call(t,e))if(t=p(t),null===t)break;return t}function p(t){return p=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},p(t)}var d=n(52),g=n(51),v=n(10),y=n(42),m=d.mat3,x=d.vec2,b=d.vec3,_=function(t){function e(t){var n;return i(this,e),n=a(this,p(e).call(this,t)),n._init(),n}return l(e,t),u(e,[{key:"getDefaultCfg",value:function(){var t=h(p(e.prototype),"getDefaultCfg",this).call(this);return v({},t,{startAngle:-Math.PI/2,endAngle:3*Math.PI/2,innerRadius:0,type:"polar",isPolar:!0})}}]),u(e,[{key:"_init",value:function(){var t=this.radius,e=this.innerRadius,n=this.center,r=this.startAngle,i=this.endAngle;while(i<r)i+=2*Math.PI;this.endAngle=i;var a,o,s=this.getOneBox(),u=s.maxX-s.minX,l=s.maxY-s.minY,c=Math.abs(s.minX)/u,h=Math.abs(s.minY)/l,f=this.width,p=this.height;p/l>f/u?(a=f/u,o={x:n.x-(.5-c)*f,y:n.y-(.5-h)*a*l}):(a=p/l,o={x:n.x-(.5-c)*a*u,y:n.y-(.5-h)*p}),t?t>0&&t<=1?t*=a:(t<=0||t>a)&&(t=a):t=a;var d={start:r,end:i},g={start:e*t,end:t};this.x=d,this.y=g,this.radius=t,this.circleCentre=o,this.center=o}},{key:"getCenter",value:function(){return this.circleCentre}},{key:"getOneBox",value:function(){var t=this.startAngle,e=this.endAngle;if(Math.abs(e-t)>=2*Math.PI)return{minX:-1,maxX:1,minY:-1,maxY:1};for(var n=[0,Math.cos(t),Math.cos(e)],r=[0,Math.sin(t),Math.sin(e)],i=Math.min(t,e);i<Math.max(t,e);i+=Math.PI/18)n.push(Math.cos(i)),r.push(Math.sin(i));return{minX:Math.min.apply(Math,n),maxX:Math.max.apply(Math,n),minY:Math.min.apply(Math,r),maxY:Math.max.apply(Math,r)}}},{key:"getRadius",value:function(){return this.radius}},{key:"convertPoint",value:function(t){var e=this.getCenter(),n=this.isTransposed?t.y:t.x,r=this.isTransposed?t.x:t.y;return n=this.convertDim(n,"x"),r=this.convertDim(r,"y"),{x:e.x+Math.cos(n)*r,y:e.y+Math.sin(n)*r}}},{key:"invertPoint",value:function(t){var e=this.getCenter(),n=[t.x-e.x,t.y-e.y],r=this.x,i=[1,0,0,0,1,0,0,0,1];m.rotate(i,i,r.start);var a=[1,0,0];b.transformMat3(a,a,i),a=[a[0],a[1]];var o=x.angleTo(a,n,r.end<r.start);g(o,2*Math.PI)&&(o=0);var s=x.length(n),u=o/(r.end-r.start);u=r.end-r.start>0?u:-u;var l=this.invertDim(s,"y"),c={};return c.x=this.isTransposed?l:u,c.y=this.isTransposed?u:l,c}}]),e}(y);t.exports=_},function(t,e,n){var r=n(0),i=n(23),a=r.PathUtil;function o(t){var e,n,r,a,o,s=t.start,u=t.end,l=t.getWidth(),c=t.getHeight(),h=200;return t.isPolar?(a=t.getRadius(),r=t.getCenter(),e=t.startAngle,n=t.endAngle,o=new i.Fan({attrs:{x:r.x,y:r.y,rs:0,re:a+h,startAngle:e,endAngle:e}}),o.endState={endAngle:n}):(o=new i.Rect({attrs:{x:s.x-h,y:u.y-h,width:t.isTransposed?l+2*h:0,height:t.isTransposed?0:c+2*h}}),t.isTransposed?o.endState={height:c+2*h}:o.endState={width:l+2*h}),o.isClip=!0,o}function s(t){if(r.isEmpty(t))return null;var e=t[0].x,n=t[0].x,i=t[0].y,a=t[0].y;return r.each(t,function(t){e=e>t.x?t.x:e,n=n<t.x?t.x:n,i=i>t.y?t.y:i,a=a<t.y?t.y:a}),{minX:e,maxX:n,minY:i,maxY:a,centerX:(e+n)/2,centerY:(i+a)/2}}function u(t,e){var n,r,i=t.points||t.get("origin").points,a=s(i),o=e.startAngle,u=e.endAngle,l=u-o;return e.isTransposed?(n=a.maxY*l,r=a.minY*l):(n=a.maxX*l,r=a.minX*l),n+=o,r+=o,{startAngle:r,endAngle:n}}function l(t,e,n){var i={};return t.delay&&(i.delay=r.isFunction(t.delay)?t.delay(e,n):t.delay),i.easing=r.isFunction(t.easing)?t.easing(e,n):t.easing,i.duration=r.isFunction(t.duration)?t.duration(e,n):t.duration,i.callback=t.callback,i}function c(t,e){var n,r=t._id,i=t.get("index"),a=t.getBBox(),o=t.get("origin").points,s=(a.minX+a.maxX)/2;n=o[0].y-o[1].y<=0?a.maxY:a.minY;var u=[s,n,1];t.apply(u),t.attr("transform",[["t",-s,-n],["s",1,.01],["t",s,n]]);var c={transform:[["t",-s,-n],["s",1,100],["t",s,n]]},h=l(e,i,r,c);t.animate(c,h.duration,h.easing,h.callback,h.delay)}function h(t,e){var n,r=t._id,i=t.get("index"),a=t.getBBox(),o=t.get("origin").points,s=(a.minY+a.maxY)/2;n=o[0].y-o[1].y>0?a.maxX:a.minX;var u=[n,s,1];t.apply(u),t.attr({transform:[["t",-n,-s],["s",.01,1],["t",n,s]]});var c={transform:[["t",-n,-s],["s",100,1],["t",n,s]]},h=l(e,i,r,c);t.animate(c,h.duration,h.easing,h.callback,h.delay)}function f(t,e){var n={lineWidth:0,opacity:0},r=t._id,i=t.get("index"),a=l(e,i,r,n);t.animate(n,a.duration,a.easing,function(){t.remove()},a.delay)}function p(t,e,n){var r,i,a=t._id,o=t.get("index");if(n.isPolar&&"point"!==t.name)r=n.getCenter().x,i=n.getCenter().y;else{var s=t.getBBox();r=(s.minX+s.maxX)/2,i=(s.minY+s.maxY)/2}var u=[r,i,1];t.apply(u),t.attr({transform:[["t",-r,-i],["s",.01,.01],["t",r,i]]});var c={transform:[["t",-r,-i],["s",100,100],["t",r,i]]},h=l(e,o,a,c);t.animate(c,h.duration,h.easing,h.callback,h.delay)}function d(t,e,n){var r,i,a=t._id,o=t.get("index");if(n.isPolar&&"point"!==t.name)r=n.getCenter().x,i=n.getCenter().y;else{var s=t.getBBox();r=(s.minX+s.maxX)/2,i=(s.minY+s.maxY)/2}var u=[r,i,1];t.apply(u);var c={transform:[["t",-r,-i],["s",.01,.01],["t",r,i]]},h=l(e,o,a,c);t.animate(c,h.duration,h.easing,function(){t.remove()},h.delay)}function g(t,e){if("path"===t.get("type")){var n=t._id,r=t.get("index"),i=a.pathToAbsolute(t.attr("path"));t.attr("path",[i[0]]);var o={path:i},s=l(e,r,n,o);t.animate(o,s.duration,s.easing,s.callback,s.delay)}}function v(t,e){if("path"===t.get("type")){var n=t._id,r=t.get("index"),i=a.pathToAbsolute(t.attr("path")),o={path:[i[0]]},s=l(e,r,n,o);t.animate(o,s.duration,s.easing,function(){t.remove()},s.delay)}}function y(t,e,n,r,i){var a,s=o(n),u=t.get("canvas"),c=t._id,h=t.get("index");r?(s.attr("startAngle",r),s.attr("endAngle",r),a={endAngle:i}):a=s.endState,s.set("canvas",u),t.attr("clip",s),t.setSilent("animating",!0);var f=l(e,h,c,a);s.animate(a,f.duration,f.easing,function(){t&&!t.get("destroyed")&&(t.attr("clip",null),t.setSilent("cacheShape",null),t.setSilent("animating",!1),s.remove())},f.delay)}function m(t,e){var n=t._id,i=t.get("index"),a=r.isNil(t.attr("fillOpacity"))?1:t.attr("fillOpacity"),o=r.isNil(t.attr("strokeOpacity"))?1:t.attr("strokeOpacity");t.attr("fillOpacity",0),t.attr("strokeOpacity",0);var s={fillOpacity:a,strokeOpacity:o},u=l(e,i,n,s);t.animate(s,u.duration,u.easing,u.callback,u.delay)}function x(t,e){var n=t._id,r=t.get("index"),i={fillOpacity:0,strokeOpacity:0},a=l(e,r,n,i);t.animate(i,a.duration,a.easing,function(){t.remove()},a.delay)}function b(t,e,n){var r=u(t,n),i=r.endAngle,a=r.startAngle;y(t,e,n,a,i)}t.exports={enter:{clipIn:y,zoomIn:p,pathIn:g,scaleInY:c,scaleInX:h,fanIn:b,fadeIn:m},leave:{lineWidthOut:f,zoomOut:d,pathOut:v,fadeOut:x},appear:{clipIn:y,zoomIn:p,pathIn:g,scaleInY:c,scaleInX:h,fanIn:b,fadeIn:m},update:{fadeIn:m,fanIn:b}}},function(t,e,n){var r=n(0),i=n(112),a=r.MatrixUtil,o=a.mat3;function s(t,e){var n=[];if(!1===t.get("animate"))return[];var i=t.get("children");return r.each(i,function(t){if(t.isGroup)n=n.concat(s(t,e));else if(t.isShape&&t._id){var r=t._id;r=r.split("-")[0],r===e&&n.push(t)}}),n}function u(t){var e={};return r.each(t,function(t){if(t._id&&!t.isClip){var n=t._id;e[n]={_id:n,type:t.get("type"),attrs:r.cloneDeep(t.attr()),name:t.name,index:t.get("index"),animateCfg:t.get("animateCfg"),coord:t.get("coord")}}}),e}function l(t,e,n,r){var a;return a=r?i.Action[n][r]:i.getAnimation(t,e,n),a}function c(t,e,n){var a=i.getAnimateCfg(t,e);return n&&n[e]?r.deepMix({},a,n[e]):a}function h(t,e,n,i){var a,s,u=!1;if(i){var h=[],f=[];r.each(e,function(e){var n=t[e._id];n?(e.setSilent("cacheShape",n),h.push(e),delete t[e._id]):f.push(e)}),r.each(t,function(t){var e=t.name,i=t.coord,h=t._id,f=t.attrs,p=t.index,d=t.type;if(s=c(e,"leave",t.animateCfg),a=l(e,i,"leave",s.animation),r.isFunction(a)){var g=n.addShape(d,{attrs:f,index:p});if(g._id=h,g.name=e,i&&"label"!==e){var v=g.getMatrix(),y=o.multiply([],v,i.matrix);g.setMatrix(y)}u=!0,a(g,s,i)}}),r.each(h,function(t){var e=t.name,n=t.get("coord"),i=t.get("cacheShape").attrs;if(!r.isEqual(i,t.attr())){if(s=c(e,"update",t.get("animateCfg")),a=l(e,n,"update",s.animation),r.isFunction(a))a(t,s,n);else{var o=r.cloneDeep(t.attr());t.attr(i),t.animate(o,s.duration,s.easing,function(){t.setSilent("cacheShape",null)})}u=!0}}),r.each(f,function(t){var e=t.name,n=t.get("coord");s=c(e,"enter",t.get("animateCfg")),a=l(e,n,"enter",s.animation),r.isFunction(a)&&(a(t,s,n),u=!0)})}else r.each(e,function(t){var e=t.name,n=t.get("coord");s=c(e,"appear",t.get("animateCfg")),a=l(e,n,"appear",s.animation),r.isFunction(a)&&(a(t,s,n),u=!0)});return u}t.exports={execAnimation:function(t,e){var n=t.get("middlePlot"),r=t.get("backPlot"),i=t.get("_id"),a=t.get("canvas"),o=a.get(i+"caches")||[];0===o.length&&(e=!1);var l,c=s(n,i),f=s(r,i),p=c.concat(f);a.setSilent(i+"caches",u(p)),l=h(o,e?p:c,a,e),l||a.draw()}}},function(t,e,n){var r=n(0),i=n(29),a=i.Axis,o=r.MatrixUtil.vec2;function s(t){var e=[];if(t.length>0){e=t.slice(0);var n=e[0],r=e[e.length-1];0!==n.value&&e.unshift({value:0}),1!==r.value&&e.push({value:1})}return e}function u(t,e,n){var r=[];return t.length<1?r:(t.length>=2&&e&&n&&r.push({text:"",tickValue:"",value:0}),0!==t[0].value&&r.push({text:"",tickValue:"",value:0}),r=r.concat(t),1!==r[r.length-1].value&&r.push({text:"",tickValue:"",value:1}),r)}function l(t,e){return void 0===e&&(e=0),"middle"===t&&(e=.5),-1!==t.indexOf("%")&&(e=parseInt(t,10)/100),e}var c=function(){function t(t){this.visible=!0,this.canvas=null,this.container=null,this.coord=null,this.options=null,this.axes=[],r.mix(this,t)}var e=t.prototype;return e._isHide=function(t){var e=this.options;return!(!e||!1!==e[t])},e._getMiddleValue=function(t,e,n,r){if(0===t&&!r)return 0;if(1===t)return 1;var i=e[n+1].value;return r||1!==i?(t+i)/2:1},e._getLineRange=function(t,e,n,r){var i,a,o,s=e.field,u=this.options,c="";if(u[s]&&u[s].position&&(c=u[s].position),"x"===n){var h="top"===c?1:0;h=l(c,h),i={x:0,y:h},a={x:1,y:h},o=!1}else{if(r){var f="left"===c?0:1;f=l(c,f),i={x:f,y:0},a={x:f,y:1}}else{var p="right"===c?1:0;p=l(c,p),i={x:p,y:0},a={x:p,y:1}}o=!0}return i=t.convert(i),a=t.convert(a),{start:i,end:a,isVertical:o}},e._getLineCfg=function(t,e,n,r){var i,a=this._getLineRange(t,e,n,r),o=a.isVertical,s=a.start,u=a.end,l=t.center;return t.isTransposed&&(o=!o),i=o&&s.x>l.x||!o&&s.y>l.y?1:-1,{isVertical:o,factor:i,start:s,end:u}},e._getCircleCfg=function(t){var e,n={},r=t.x,i=t.y,a=i.start>i.end;e=t.isTransposed?{x:a?0:1,y:0}:{x:0,y:a?0:1},e=t.convert(e);var s,u=t.circleCentre,l=[e.x-u.x,e.y-u.y],c=[1,0];s=e.y>u.y?o.angle(l,c):-1*o.angle(l,c);var h=s+(r.end-r.start);return n.startAngle=s,n.endAngle=h,n.center=u,n.radius=Math.sqrt(Math.pow(e.x-u.x,2)+Math.pow(e.y-u.y,2)),n.inner=t.innerRadius||0,n},e._getRadiusCfg=function(t){var e,n,r=t.x.start,i=r<0?-1:1;return t.isTransposed?(e={x:0,y:0},n={x:1,y:0}):(e={x:0,y:0},n={x:0,y:1}),{factor:i,start:t.convert(e),end:t.convert(n)}},e._getAxisPosition=function(t,e,n,r){var i="",a=this.options;if(a[r]&&a[r].position)i=a[r].position;else{var o=t.type;t.isRect?"x"===e?i="bottom":"y"===e&&(i=n?"right":"left"):i="helix"===o?"helix":"x"===e?t.isTransposed?"radius":"circle":t.isTransposed?"circle":"radius"}return i},e._getAxisDefaultCfg=function(t,e,n,i){var a=this,o=a.viewTheme,s={},u=a.options,l=e.field;if(s=r.deepMix({},o.axis[i],s,u[l]),s.viewTheme=o,s.title){var c=r.isPlainObject(s.title)?s.title:{};c.text=c.text||e.alias||l,r.deepMix(s,{title:c})}return s.ticks=e.getTicks(),t.isPolar&&!e.isCategory&&"x"===n&&Math.abs(t.endAngle-t.startAngle)===2*Math.PI&&s.ticks.pop(),s.coord=t,s.label&&r.isNil(s.label.autoRotate)&&(s.label.autoRotate=!0),u.hasOwnProperty("xField")&&u.xField.hasOwnProperty("grid")&&"left"===s.position&&r.deepMix(s,u.xField),s},e._getAxisCfg=function(t,e,n,i,a,o){void 0===a&&(a="");var l=this,c=l._getAxisPosition(t,i,a,e.field),h=l._getAxisDefaultCfg(t,e,i,c);if(!r.isEmpty(h.grid)&&n){var f=[],p=[],d=s(n.getTicks());if(d.length){var g=u(h.ticks,e.isLinear,"center"===h.grid.align);r.each(g,function(n,s){p.push(n.tickValue);var u=[],c=n.value;if("center"===h.grid.align&&(c=l._getMiddleValue(c,g,s,e.isLinear)),!r.isNil(c)){var v=t.x,y=t.y;r.each(d,function(e){var n="x"===i?c:e.value,r="x"===i?e.value:c,a=t.convert({x:n,y:r});if(t.isPolar){var o=t.circleCentre;y.start>y.end&&(r=1-r),a.flag=v.start>v.end?0:1,a.radius=Math.sqrt(Math.pow(a.x-o.x,2)+Math.pow(a.y-o.y,2))}u.push(a)}),f.push({_id:o+"-"+i+a+"-grid-"+n.tickValue,points:u})}})}h.grid.items=f,h.grid.tickValues=p}return h.type=e.type,h},e._getHelixCfg=function(t){for(var e={},n=t.a,r=t.startAngle,i=t.endAngle,a=100,o=[],s=0;s<=a;s++){var u=t.convert({x:s/100,y:0});o.push(u.x),o.push(u.y)}var l=t.convert({x:0,y:0});return e.a=n,e.startAngle=r,e.endAngle=i,e.crp=o,e.axisStart=l,e.center=t.center,e.inner=t.y.start,e},e._drawAxis=function(t,e,n,i,o,s,u){var l,c,h=this.container,f=this.canvas;"cartesian"===t.type?(l=a.Line,c=this._getLineCfg(t,e,i,u)):"helix"===t.type&&"x"===i?(l=a.Helix,c=this._getHelixCfg(t)):"x"===i?(l=a.Circle,c=this._getCircleCfg(t)):(l=a.Line,c=this._getRadiusCfg(t));var p=this._getAxisCfg(t,e,n,i,u,o);p=r.mix({},p,c),"y"===i&&s&&"circle"===s.get("type")&&(p.circle=s),p._id=o+"-"+i,r.isNil(u)||(p._id=o+"-"+i+u),r.mix(p,{canvas:f,group:h});var d=new l(p);return d.render(),this.axes.push(d),d},e.createAxis=function(t,e,n){var i,a=this,o=this.coord,s=o.type;"theta"===s||"polar"===s&&o.isTransposed||(t&&!a._isHide(t.field)&&(i=a._drawAxis(o,t,e[0],"x",n)),r.isEmpty(e)||"helix"===s||r.each(e,function(e,r){a._isHide(e.field)||a._drawAxis(o,e,t,"y",n,i,r)}))},e.changeVisible=function(t){var e=this.axes;r.each(e,function(e){e.set("visible",t)})},e.clear=function(){var t=this,e=t.axes;r.each(e,function(t){t.clear()}),t.axes=[]},t}();t.exports=c},function(t,e,n){var r=n(0),i=n(262),a=function(){function t(t){this.type="rect",this.actions=[],this.cfg={},r.mix(this,t),this.option=t||{}}var e=t.prototype;return e.reset=function(t){return this.actions=t.actions||[],this.type=t.type,this.cfg=t.cfg,this.option.actions=this.actions,this.option.type=this.type,this.option.cfg=this.cfg,this},e._execActions=function(t){var e=this.actions;r.each(e,function(e){var n=e[0];t[n](e[1],e[2])})},e.hasAction=function(t){var e=this.actions,n=!1;return r.each(e,function(e){if(t===e[0])return n=!0,!1}),n},e.createCoord=function(t,e){var n,a,o=this,s=o.type,u=o.cfg,l=r.mix({start:t,end:e},u);return"theta"===s?(n=i.Polar,o.hasAction("transpose")||o.transpose(),a=new n(l),a.type=s):(n=i[r.upperFirst(s||"")]||i.Rect,a=new n(l)),o._execActions(a),a},e.rotate=function(t){return t=t*Math.PI/180,this.actions.push(["rotate",t]),this},e.reflect=function(t){return this.actions.push(["reflect",t]),this},e.scale=function(t,e){return this.actions.push(["scale",t,e]),this},e.transpose=function(){return this.actions.push(["transpose"]),this},t}();t.exports=a},function(t,e,n){var r=n(0);function i(t,e){if(r.isNil(t)||r.isNil(e))return!1;var n=t.get("origin"),i=e.get("origin");return r.isNil(n)&&r.isNil(i)?r.isEqual(t,e):r.isEqual(n,i)}function a(t){t.shape&&t.shape.get("origin")&&(t.data=t.shape.get("origin"))}var o=function(){function t(t){this.view=null,this.canvas=null,r.assign(this,t),this._init()}var e=t.prototype;return e._init=function(){this.pixelRatio=this.canvas.get("pixelRatio")},e._getShapeEventObj=function(t){return{x:t.x/this.pixelRatio,y:t.y/this.pixelRatio,target:t.target,toElement:t.event.toElement||t.event.relatedTarget}},e._getShape=function(t,e){var n=this.view,r=n.get("canvas");return r.getShape(t,e)},e._getPointInfo=function(t){var e=this.view,n={x:t.x/this.pixelRatio,y:t.y/this.pixelRatio},r=e.getViewsByPoint(n);return n.views=r,n},e._getEventObj=function(t,e,n){return{x:e.x,y:e.y,target:t.target,toElement:t.event.toElement||t.event.relatedTarget,views:n}},e.bindEvents=function(){var t=this.canvas;t.on("mousedown",r.wrapBehavior(this,"onDown")),t.on("mousemove",r.wrapBehavior(this,"onMove")),t.on("mouseleave",r.wrapBehavior(this,"onOut")),t.on("mouseup",r.wrapBehavior(this,"onUp")),t.on("click",r.wrapBehavior(this,"onClick")),t.on("dblclick",r.wrapBehavior(this,"onClick")),t.on("touchstart",r.wrapBehavior(this,"onTouchstart")),t.on("touchmove",r.wrapBehavior(this,"onTouchmove")),t.on("touchend",r.wrapBehavior(this,"onTouchend"))},e._triggerShapeEvent=function(t,e,n){if(t&&t.name&&!t.get("destroyed")){var r=this.view;if(r.isShapeInView(t)){var i=t.name+":"+e;n.view=r,n.appendInfo=t.get("appendInfo"),r.emit(i,n);var a=r.get("parent");a&&a.emit(i,n)}}},e.onDown=function(t){var e=this.view,n=this._getShapeEventObj(t);n.shape=this.currentShape,a(n),e.emit("mousedown",n),this._triggerShapeEvent(this.currentShape,"mousedown",n)},e.onMove=function(t){var e=this,n=e.view,r=e.currentShape;r&&r.get("destroyed")&&(r=null,e.currentShape=null);var o=e._getShape(t.x,t.y)||t.currentTarget,s=e._getShapeEventObj(t);if(s.shape=o,a(s),n.emit("mousemove",s),e._triggerShapeEvent(o,"mousemove",s),r&&!i(r,o)){var u=e._getShapeEventObj(t);u.shape=r,u.toShape=o,a(u),e._triggerShapeEvent(r,"mouseleave",u)}if(o&&!i(r,o)){var l=e._getShapeEventObj(t);l.shape=o,l.fromShape=r,a(l),e._triggerShapeEvent(o,"mouseenter",l)}e.currentShape=o;var c=e._getPointInfo(t),h=e.curViews||[];0===h.length&&c.views.length&&n.emit("plotenter",e._getEventObj(t,c,c.views)),h.length&&0===c.views.length&&n.emit("plotleave",e._getEventObj(t,c,h)),c.views.length&&(s=e._getEventObj(t,c,c.views),s.shape=o,a(s),n.emit("plotmove",s)),e.curViews=c.views},e.onOut=function(t){var e=this,n=e.view,r=e._getPointInfo(t),i=e.curViews||[],a=e._getEventObj(t,r,i);!e.curViews||0===e.curViews.length||a.toElement&&"CANVAS"===a.toElement.tagName||(n.emit("plotleave",a),e.curViews=[])},e.onUp=function(t){var e=this.view,n=this._getShapeEventObj(t);n.shape=this.currentShape,e.emit("mouseup",n),this._triggerShapeEvent(this.currentShape,"mouseup",n)},e.onClick=function(t){var e=this,n=e.view,i=e._getShape(t.x,t.y)||t.currentTarget,o=e._getShapeEventObj(t);o.shape=i,a(o),n.emit("click",o),e._triggerShapeEvent(i,t.type,o),e.currentShape=i;var s=e._getPointInfo(t),u=s.views;if(!r.isEmpty(u)){var l=e._getEventObj(t,s,u);if(e.currentShape){var c=e.currentShape;l.shape=c,a(l)}n.emit("plotclick",l),"dblclick"===t.type&&(n.emit("plotdblclick",l),n.emit("dblclick",o))}},e.onTouchstart=function(t){var e=this.view,n=this._getShape(t.x,t.y)||t.currentTarget,r=this._getShapeEventObj(t);r.shape=n,a(r),e.emit("touchstart",r),this._triggerShapeEvent(n,"touchstart",r),this.currentShape=n},e.onTouchmove=function(t){var e=this.view,n=this._getShape(t.x,t.y)||t.currentTarget,r=this._getShapeEventObj(t);r.shape=n,a(r),e.emit("touchmove",r),this._triggerShapeEvent(n,"touchmove",r),this.currentShape=n},e.onTouchend=function(t){var e=this.view,n=this._getShapeEventObj(t);n.shape=this.currentShape,a(n),e.emit("touchend",n),this._triggerShapeEvent(this.currentShape,"touchend",n)},e.clearEvents=function(){var t=this.canvas;t.off("mousemove",r.getWrapBehavior(this,"onMove")),t.off("mouseleave",r.getWrapBehavior(this,"onOut")),t.off("mousedown",r.getWrapBehavior(this,"onDown")),t.off("mouseup",r.getWrapBehavior(this,"onUp")),t.off("click",r.getWrapBehavior(this,"onClick")),t.off("dblclick",r.getWrapBehavior(this,"onClick")),t.off("touchstart",r.getWrapBehavior(this,"onTouchstart")),t.off("touchmove",r.getWrapBehavior(this,"onTouchmove")),t.off("touchend",r.getWrapBehavior(this,"onTouchend"))},t}();t.exports=o},function(t,e,n){var r=n(0),i=n(274),a=function(){function t(t){this.guides=[],this.options=[],this.xScales=null,this.yScales=null,this.view=null,this.viewTheme=null,this.frontGroup=null,this.backGroup=null,r.mix(this,t)}var e=t.prototype;return e._creatGuides=function(){var t=this,e=this.options,n=this.xScales,a=this.yScales,o=this.view,s=this.viewTheme;return this.backContainer&&o&&(this.backGroup=this.backContainer.addGroup({viewId:o.get("_id")})),this.frontContainer&&o&&(this.frontGroup=this.frontContainer.addGroup({viewId:o.get("_id")})),e.forEach(function(e){var o=e.type,u=r.deepMix({xScales:n,yScales:a,viewTheme:s},s?s.guide[o]:{},e);o=r.upperFirst(o);var l=new i[o](u);t.guides.push(l)}),t.guides},e.line=function(t){return void 0===t&&(t={}),this.options.push(r.mix({type:"line"},t)),this},e.arc=function(t){return void 0===t&&(t={}),this.options.push(r.mix({type:"arc"},t)),this},e.text=function(t){return void 0===t&&(t={}),this.options.push(r.mix({type:"text"},t)),this},e.image=function(t){return void 0===t&&(t={}),this.options.push(r.mix({type:"image"},t)),this},e.region=function(t){return void 0===t&&(t={}),this.options.push(r.mix({type:"region"},t)),this},e.regionFilter=function(t){return void 0===t&&(t={}),this.options.push(r.mix({type:"regionFilter"},t)),this},e.dataMarker=function(t){return void 0===t&&(t={}),this.options.push(r.mix({type:"dataMarker"},t)),this},e.dataRegion=function(t){return void 0===t&&(t={}),this.options.push(r.mix({type:"dataRegion"},t)),this},e.html=function(t){return void 0===t&&(t={}),this.options.push(r.mix({type:"html"},t)),this},e.render=function(t){var e=this,n=e.view,i=n&&n.get("data"),a=e._creatGuides();r.each(a,function(r){var a;a=r.get("top")?e.frontGroup||e.frontContainer:e.backGroup||e.backContainer,r.render(t,a,i,n)})},e.clear=function(){this.options=[],this.reset()},e.changeVisible=function(t){var e=this.guides;r.each(e,function(e){e.changeVisible(t)})},e.reset=function(){var t=this.guides;r.each(t,function(t){t.clear()}),this.guides=[],this.backGroup&&this.backGroup.remove(),this.frontGroup&&this.frontGroup.remove()},t}();t.exports=a},function(t,e,n){var r=n(0),i=n(29),a=i.Legend,o=n(276),s=n(9),u=n(116),l=n(118),c="_origin",h=4.5,f=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame,p=["cross","tick","plus","hyphen","line","hollowCircle","hollowSquare","hollowDiamond","hollowTriangle","hollowTriangleDown","hollowHexagon","hollowBowtie"];function d(t,e,n){var i;return!r.isNil(n)&&(t=n.translate(t),e=n.translate(e),i=n.isCategory?t===e:Math.abs(t-e)<=1,i)}function g(t,e){var n;return r.each(t,function(t){if(t.get("visible")){var r=t.getYScale();if(r.field===e)return void(n=t)}}),n}var v=function(){function t(t){var e=this;e.options={},r.mix(e,t),e.clear();var n=e.chart;e.container=n.get("frontPlot"),e.plotRange=n.get("plotRange")}var e=t.prototype;return e.clear=function(){var t=this.legends;this.backRange=null,r.each(t,function(t){r.each(t,function(t){t.destroy()})}),this.legends={}},e.getBackRange=function(){var t=this.backRange;if(!t){var e=this.chart.get("backPlot");t=u(e,l(this.chart.get("plotRange")));var n=this.plotRange;t.maxX-t.minX<n.br.x-n.tl.x&&t.maxY-t.minY<n.br.y-n.tl.y&&(t={minX:n.tl.x,minY:n.tl.y,maxX:n.br.x,maxY:n.br.y}),this.backRange=t}return t},e._isFieldInView=function(t,e,n){var i=!1,a=n.get("scales"),o=a[t];return o&&o.values&&(i=r.inArray(o.values,e)),i},e._bindClickEvent=function(t,e,n){var i=this,a=i.chart,o=a.get("views"),s=e.field,u=i.options;t.on("itemclick",function(e){if(u.onClick&&!0!==u.defaultClickHandlerEnabled)u.onClick(e);else{var l=e.item,c=e.checked,h="single"===t.get("selectedMode"),f=l.dataValue;c?(r.Array.remove(n,f),i._isFieldInView(s,f,a)&&a.filter(s,function(t){return h?t===f:!r.inArray(n,t)}),r.each(o,function(t){i._isFieldInView(s,f,t)&&t.filter(s,function(t){return h?t===f:!r.inArray(n,t)})})):h||(n.push(f),i._isFieldInView(s,f,a)&&a.filter(s,function(t){return!r.inArray(n,t)}),r.each(o,function(t){i._isFieldInView(s,f,t)&&t.filter(s,function(t){return!r.inArray(n,t)})})),u.onClick&&u.onClick(e),a.set("keepLegend",!0),a.set("keepPadding",!0),a.repaint(),a.set("keepPadding",!1),a.set("keepLegend",!1)}})},e._bindClickEventForMix=function(t){var e=this,n=e.chart,i=n.getAllGeoms();t.on("itemclick",function(t){var e=t.item.field,n=t.checked;n?r.each(i,function(t){var n=t.getYScale().field;n===e&&t.show()}):r.each(i,function(t){var n=t.getYScale().field;n===e&&t.hide()})})},e._filterLabels=function(t,e,n){if(t.get("gLabel"))t.get("gLabel").set("visible",n);else{var i=e.get("labelCfg");if(i&&i.fields&&i.fields.length>0){var a=e.getXScale(),o=e.getYScale(),s=a.field,u=o.field,l=t.get("origin")._origin,c=e.get("labelContainer"),h=c.get("labelsGroup").get("children");r.each(h,function(e){var r=e.get("origin")||[];r[s]===l[s]&&r[u]===l[u]&&(e.set("visible",n),t.set("gLabel",e))})}}},e._bindFilterEvent=function(t,e){var n=this,i=this.chart,a=e.field;t.on("itemfilter",function(t){var e=t.range;i.filterShape(function(t,i,o){if(!r.isNil(t[a])){var s=t[a]>=e[0]&&t[a]<=e[1];return n._filterLabels(i,o,s),s}return!0});for(var o=i.getAllGeoms()||[],s=function(t){var n=o[t];"heatmap"===n.get("type")&&f(function(){n.drawWithRange(e)})},u=0;u<o.length;u++)s(u)})},e._getShapeData=function(t){var e=t.get("origin");return r.isArray(e)&&(e=e[0]),e[c]},e._bindHoverEvent=function(t,e){var n=this,i=n.chart,a=i.getAllGeoms(),o=n.options,s=i.get("canvas");t.on("itemhover",function(t){var i=t.item.value,u=n.pre;if(u){if(u===i)return}else r.each(a,function(a){var u=a.get("shapeContainer"),l=a.getShapes(),c=[];if(e){var h=a.get("scales")[e];r.each(l,function(t){var r=n._getShapeData(t);r&&d(r[e],i,h)&&c.push(t)})}else a.getYScale().field===i&&(c=l);r.isEmpty(c)||(t.shapes=c,t.geom=a,o.onHover?(o.onHover(t),u.sort(),s.draw()):a.setShapesActived(c))}),n.pre=i}),t.on("itemunhover",function(t){n.pre=null,o.onUnhover&&o.onUnhover(t),r.each(a,function(t){t.get("activeShapes")&&(t.clearActivedShapes(),s.draw())})})},e._isFiltered=function(t,e,n){if(!t.isCategory)return!0;var i=!0;return n=t.invert(n),r.each(e,function(e){if(t.getText(e)===t.getText(n))return i=!1,!1}),i},e._alignLegend=function(t,e,n,r){var i=this,a=i.viewTheme,o=i.container,s=o.get("canvas"),u=s.get("width"),l=s.get("height"),c=i.totalRegion,h=i.plotRange,f=i.getBackRange(),p=t.get("offset")[0]||0,d=t.get("offset")[1]||0,g=t.getHeight(),v=t.getWidth(),y=a.legend.margin,m=a.legend.legendMargin,x=i.legends[r].length,b=r.split("-"),_=0,w=0,M=x>1?c:n;if("left"===b[0]||"right"===b[0])l=h.br.y,_=i._getXAlign(b[0],u,n,f,v,y),w=e?(e.get("y")||e.get("group").get("y"))+e.getHeight()+m:i._getYAlignVertical(b[1],l,M,f,0,y,s.get("height"));else if("top"===b[0]||"bottom"===b[0])if(w=i._getYAlignHorizontal(b[0],l,n,f,g,y),e){var S=e.getWidth();_=(e.get("x")||e.get("group").get("x"))+S+m}else _=i._getXAlign(b[1],u,M,f,0,y),"right"===b[1]&&(_=h.br.x-M.totalWidth);t.move(_+p,w+d)},e._getXAlign=function(t,e,n,r,i,a){var o="left"===t?r.minX-i-a[3]:r.maxX+a[1];return"center"===t&&(o=(e-n.totalWidth)/2),o},e._getYAlignHorizontal=function(t,e,n,r,i,a){var o="top"===t?r.minY-i-a[0]:r.maxY+a[2];return o},e._getYAlignVertical=function(t,e,n,r,i,a,o){var s="top"===t?r.minY-i-a[0]:e-n.totalHeight;return"center"===t&&(s=(o-n.totalHeight)/2),s},e._getSubRegion=function(t){var e=0,n=0,i=0,a=0;return r.each(t,function(t){var r=t.getWidth(),o=t.getHeight();e<r&&(e=r),i+=r,n<o&&(n=o),a+=o}),{maxWidth:e,totalWidth:i,maxHeight:n,totalHeight:a}},e._getRegion=function(){var t=this,e=t.viewTheme,n=t.legends,i=e.legend.legendMargin,a=[],o=0,s=0;return r.each(n,function(e){var n=t._getSubRegion(e);a.push(n),o+=n.totalWidth+i,s+=n.totalHeight+i}),{totalWidth:o,totalHeight:s,subs:a}},e._addCategoryLegend=function(t,e,n,i,u){var l=this,c=t.field,h=l.options,f=h[c];f&&(h=f);var p=l.legends;p[u]=p[u]||[];var d=l.container,g=[],v=t.getTicks(),y=!0,m=n.get("shapeType")||"point",x=n.getDefaultValue("shape")||"circle";h[c]&&h[c].marker?(x=h[c].marker,m="point",y=!1):h.marker&&(x=h.marker,m="point",y=!1);var b=l.chart,_=l.viewTheme,w=b.get("canvas"),M=l.plotRange,S=u.split("-"),C="right"===S[0]||"left"===S[0]?M.bl.y-M.tr.y:w.get("width");r.each(v,function(e){var a=e.text,o=a,u=e.value,c=t.invert(u),h={isInCircle:n.isInCircle()},f=!i||l._isFiltered(t,i,u),p=n.getAttr("color"),d=n.getAttr("shape");if(p)if(p.callback&&p.callback.length>1){var v=Array(p.callback.length-1).fill("");h.color=p.mapping.apply(p,[c].concat(v)).join("")||_.defaultColor}else h.color=p.mapping(c).join("")||_.defaultColor;if(y&&d)if(d.callback&&d.callback.length>1){var b=Array(d.callback.length-1).fill("");x=d.mapping.apply(d,[c].concat(b)).join("")}else x=d.mapping(c).join("");var w=s.getShapeFactory(m),M=w.getMarkerCfg(x,h);r.isFunction(x)&&(M.symbol=x),g.push({value:o,dataValue:c,checked:f,marker:M})});var k,A=r.deepMix({},_.legend[S[0]],h[c]||h,{viewId:b.get("_id"),maxLength:C,items:g,container:d,position:[0,0]});if(A.title&&r.deepMix(A,{title:{text:t.alias||t.field}}),l._isTailLegend(h,n))A.chart=l.chart,A.geom=n,k=new o(A);else if(h.useHtml){var P=d.get("canvas").get("el");if(d=h.container,r.isString(d)&&/^\#/.test(d)){var I=d.replace("#","");d=document.getElementById(I)}d||(d=P.parentNode),A.container=d,void 0===A.legendStyle&&(A.legendStyle={}),A.legendStyle.CONTAINER_CLASS={position:"absolute",overflow:"auto","z-index":""===P.style.zIndex?1:parseInt(P.style.zIndex,10)+1},h.flipPage?(A.legendStyle.CONTAINER_CLASS.height="right"===S[0]||"left"===S[0]?C+"px":"auto",A.legendStyle.CONTAINER_CLASS.width="right"!==S[0]&&"left"!==S[0]?C+"px":"auto",k=new a.CatPageHtml(A)):k=new a.CatHtml(A)}else k=new a.Category(A);return l._bindClickEvent(k,t,i),p[u].push(k),k},e._bindChartMove=function(t){var e=this.chart,n=this.legends;e.on("plotmove",function(e){var i=!1;if(e.target){var a=e.target.get("origin");if(a){var o=a[c]||a[0][c],s=t.field;if(o){var u=o[s];r.each(n,function(t){r.each(t,function(t){i=!0,!t.destroyed&&t.activate(u)})})}}}i||r.each(n,function(t){r.each(t,function(t){!t.destroyed&&t.deactivate()})})})},e._addContinuousLegend=function(t,e,n){var i=this,o=i.legends;o[n]=o[n]||[];var s,u,l,c=i.container,h=t.field,f=t.getTicks(),p=[],d=i.viewTheme;r.each(f,function(n){var r=n.value,i=t.invert(r),a=e.mapping(i).join("");p.push({value:n.tickValue,attrValue:a,color:a,scaleValue:r}),0===r&&(u=!0),1===r&&(l=!0)}),u||p.push({value:t.min,attrValue:e.mapping(0).join(""),color:e.mapping(0).join(""),scaleValue:0}),l||p.push({value:t.max,attrValue:e.mapping(1).join(""),color:e.mapping(1).join(""),scaleValue:1});var g=i.options,v=n.split("-"),y=d.legend[v[0]];(g&&!1===g.slidable||g[h]&&!1===g[h].slidable)&&(y=r.mix({},y,d.legend.gradient));var m=r.deepMix({},y,g[h]||g,{items:p,attr:e,formatter:t.formatter,container:c,position:[0,0]});if(m.title&&r.deepMix(m,{title:{text:t.alias||t.field}}),"color"===e.type)s=new a.Color(m);else{if("size"!==e.type)return;s=g&&"circle"===g.sizeType?new a.CircleSize(m):new a.Size(m)}return i._bindFilterEvent(s,t),o[n].push(s),s},e._isTailLegend=function(t,e){if(t.hasOwnProperty("attachLast")&&t.attachLast){var n=e.get("type");if("line"===n||"lineStack"===n||"area"===n||"areaStack"===n)return!0}return!1},e._adjustPosition=function(t,e){var n;if(e)n="right-top";else if(r.isArray(t))n=String(t[0])+"-"+String(t[1]);else{var i=t.split("-");1===i.length?("left"===i[0]&&(n="left-bottom"),"right"===i[0]&&(n="right-bottom"),"top"===i[0]&&(n="top-center"),"bottom"===i[0]&&(n="bottom-center")):n=t}return n},e.addLegend=function(t,e,n,r){var i=this,a=i.options,o=t.field,s=a[o],u=i.viewTheme;if(!1===s)return null;if(s&&s.custom)i.addCustomLegend(o);else{var l,c=a.position||u.defaultLegendPosition;c=i._adjustPosition(c,i._isTailLegend(a,n)),s&&s.position&&(c=i._adjustPosition(s.position,i._isTailLegend(s,n))),l=t.isLinear?i._addContinuousLegend(t,e,c):i._addCategoryLegend(t,e,n,r,c),l&&(i._bindHoverEvent(l,o),a.reactive&&i._bindChartMove(t))}},e.addCustomLegend=function(t){var e=this,n=e.chart,i=e.viewTheme,o=e.container,s=e.options;t&&(s=s[t]);var u=s.position||i.defaultLegendPosition;u=e._adjustPosition(u);var l=e.legends;l[u]=l[u]||[];var c=s.items;if(c){var f=n.getAllGeoms();r.each(c,function(t){var e=g(f,t.value);r.isPlainObject(t.marker)?t.marker.radius=t.marker.radius||h:(t.marker={symbol:t.marker||"circle",radius:h},-1!==r.indexOf(p,t.marker.symbol)?t.marker.stroke=t.fill:t.marker.fill=t.fill);var n=t.marker.symbol;r.isString(n)&&-1!==n.indexOf("hollow")&&(t.marker.symbol=r.lowerFirst(n.substr(6))),t.checked=!!r.isNil(t.checked)||t.checked,t.geom=e});var d,v=n.get("canvas"),y=e.plotRange,m=u.split("-"),x="right"===m[0]||"left"===m[0]?y.bl.y-y.tr.y:v.get("width"),b=r.deepMix({},i.legend[m[0]],s,{maxLength:x,items:c,container:o,position:[0,0]});if(s.useHtml){var _=s.container;if(/^\#/.test(o)){var w=_.replace("#","");_=document.getElementById(w)}else _||(_=o.get("canvas").get("el").parentNode);b.container=_,void 0===b.legendStyle&&(b.legendStyle={}),b.legendStyle.CONTAINER_CLASS||(b.legendStyle.CONTAINER_CLASS={height:"right"===m[0]||"left"===m[0]?x+"px":"auto",width:"right"!==m[0]&&"left"!==m[0]?x+"px":"auto",position:"absolute",overflow:"auto"}),d=s.flipPage?new a.CatPageHtml(b):new a.CatHtml(b)}else d=new a.Category(b);return l[u].push(d),d.on("itemclick",function(t){s.onClick&&s.onClick(t)}),e._bindHoverEvent(d),d}},e.addMixedLegend=function(t,e){var n=this,i=[];r.each(t,function(t){var n=t.alias||t.field;r.each(e,function(e){if(e.getYScale()===t&&t.values&&t.values.length>0){var r=e.get("shapeType")||"point",a=e.getDefaultValue("shape")||"circle",o=s.getShapeFactory(r),u={color:e.getDefaultValue("color")},l=o.getMarkerCfg(a,u),c={value:n,marker:l,field:t.field};i.push(c)}})});var a={custom:!0,items:i};n.options=r.deepMix({},a,n.options);var o=n.addCustomLegend();n._bindClickEventForMix(o)},e.alignLegends=function(){var t=this,e=t.legends,n=t._getRegion(e);t.totalRegion=n;var i=0;return r.each(e,function(e,a){var o=n.subs[i];r.each(e,function(n,r){var i=e[r-1];n.get("useHtml")&&!n.get("autoPosition")||t._alignLegend(n,i,o,a)}),i++}),this},t}();t.exports=v},function(t,e,n){var r=n(147),i=n(0),a=/^(?:(?!0000)[0-9]{4}([-/.]+)(?:(?:0?[1-9]|1[0-2])\1(?:0?[1-9]|1[0-9]|2[0-8])|(?:0?[13-9]|1[0-2])\1(?:29|30)|(?:0?[13578]|1[02])\1(?:31))|(?:[0-9]{2}(?:0[48]|[2468][048]|[13579][26])|(?:0[48]|[2468][048]|[13579][26])00)([-/.]?)0?2\2(?:29))(\s+([01]|([01][0-9]|2[0-3])):([0-9]|[0-5][0-9]):([0-9]|[0-5][0-9]))?$/,o={LINEAR:"linear",CAT:"cat",TIME:"time"},s=function(){function t(t){this.defs={},this.viewTheme={scales:{}},this.filters={},i.assign(this,t)}var e=t.prototype;return e._getDef=function(t){var e=this.defs,n=this.viewTheme,r=null;return(n.scales[t]||e[t])&&(r=i.mix({},n.scales[t]),i.each(e[t],function(t,e){i.isNil(t)?delete r[e]:r[e]=t}),this.filters[t]&&(delete r.min,delete r.max)),r},e._getDefaultType=function(t,e){var n=o.LINEAR,r=i.Array.firstValue(e,t);return i.isArray(r)&&(r=r[0]),a.test(r)?n=o.TIME:i.isString(r)&&(n=o.CAT),n},e._getScaleCfg=function(t,e,n){var a={field:e},o=i.Array.values(n,e);if(a.values=o,!r.isCategory(t)&&"time"!==t){var s=i.Array.getRange(o);a.min=s.min,a.max=s.max,a.nice=!0}return"time"===t&&(a.nice=!1),a},e.createScale=function(t,e){var n,a=this,o=a._getDef(t),s=e||[],u=i.Array.firstValue(s,t);if(i.isNumber(t)||i.isNil(u)&&!o)n=r.identity({value:t,field:t.toString(),values:[t]});else{var l;o&&(l=o.type),l=l||a._getDefaultType(t,s);var c=a._getScaleCfg(l,t,s);o&&i.mix(c,o),n=r[l](c)}return n},t}();t.exports=s},function(t,e,n){var r=n(0),i=n(9),a=n(29),o=a.Tooltip,s=r.MatrixUtil,u=s.vec2,l=["line","area","path","areaStack"],c=["line","area"],h=["marker","showMarker"];function f(t,e){var n=-1;return r.each(t,function(t,i){var a=!0;for(var o in e)if(e.hasOwnProperty(o)&&-1===h.indexOf(o)&&!r.isObject(e[o])&&e[o]!==t[o]){a=!1;break}if(a)return n=i,!1}),n}function p(t,e){if(!t)return!1;var n="";return!!t.className&&(n=r.isNil(t.className.baseVal)?t.className:t.className.baseVal,-1!==n.indexOf(e))}function d(t,e){var n=t.parentNode,r=!1;while(n&&n!==document.body){if(p(n,e)){r=!0;break}n=n.parentNode}return r}function g(t){var e=[];return r.each(t,function(t){var n=f(e,t);-1===n?e.push(t):e[n]=t}),e}var v=function(){function t(t){r.assign(this,t),this.timeStamp=0}var e=t.prototype;return e._normalizeEvent=function(t){var e=this.chart,n=this._getCanvas(),r=n.getPointByClient(t.clientX,t.clientY),i=n.get("pixelRatio");r.x=r.x/i,r.y=r.y/i;var a=e.getViewsByPoint(r);return r.views=a,r},e._getCanvas=function(){return this.chart.get("canvas")},e._getTriggerEvent=function(){var t,e=this.options,n=e.triggerOn;return n&&"mousemove"!==n?"click"===n?t="plotclick":"none"===n&&(t=null):t="plotmove",t},e._getDefaultTooltipCfg=function(){var t=this,e=t.chart,n=t.viewTheme,i=t.options,a=r.mix({},n.tooltip),o=e.getAllGeoms().filter(function(t){return t.get("visible")}),s=[];r.each(o,function(t){var e=t.get("type"),n=t.get("adjusts"),i=!1;n&&r.each(n,function(t){if("symmetric"===t.type||"Symmetric"===t.type)return i=!0,!1}),-1!==r.indexOf(s,e)||i||s.push(e)});var u,l=!(!o.length||!o[0].get("coord"))&&o[0].get("coord").isTransposed;if(o.length&&o[0].get("coord")&&"cartesian"===o[0].get("coord").type)if("interval"===s[0]&&!1!==i.shared){var h=r.mix({},n.tooltipCrosshairsRect);h.isTransposed=l,u={zIndex:0,crosshairs:h}}else if(r.indexOf(c,s[0])>-1){var f=r.mix({},n.tooltipCrosshairsLine);f.isTransposed=l,u={crosshairs:f}}return r.mix(a,u,{})},e._bindEvent=function(){var t=this.chart,e=this._getTriggerEvent();e&&(t.on(e,r.wrapBehavior(this,"onMouseMove")),t.on("plotleave",r.wrapBehavior(this,"onMouseOut")))},e._offEvent=function(){var t=this.chart,e=this._getTriggerEvent();e&&(t.off(e,r.getWrapBehavior(this,"onMouseMove")),t.off("plotleave",r.getWrapBehavior(this,"onMouseOut")))},e._setTooltip=function(t,e,n,i){var a=this,o=a.tooltip,s=a.prePoint;if(!s||s.x!==t.x||s.y!==t.y){e=g(e),a.prePoint=t;var u=a.chart,l=a.viewTheme,c=r.isArray(t.x)?t.x[t.x.length-1]:t.x,h=r.isArray(t.y)?t.y[t.y.length-1]:t.y;o.get("visible")||u.emit("tooltip:show",{x:c,y:h,tooltip:o});var f=e[0],p=f.title||f.name;o.isContentChange(p,e)&&(u.emit("tooltip:change",{tooltip:o,x:c,y:h,items:e}),p=e[0].title||e[0].name,o.setContent(p,e),r.isEmpty(n)?(o.clearMarkers(),o.set("markerItems",[])):!0===a.options.hideMarkers?o.set("markerItems",n):o.setMarkers(n,l.tooltipMarker));var d=this._getCanvas();i===d&&"mini"===o.get("type")?o.hide():(o.setPosition(c,h,i),o.show())}},e.hideTooltip=function(){var t=this.tooltip,e=this.chart,n=this._getCanvas();this.prePoint=null,t.hide(),e.emit("tooltip:hide",{tooltip:t}),n.draw()},e.onMouseMove=function(t){if(!r.isEmpty(t.views)){var e=this.timeStamp,n=+new Date,i={x:t.x,y:t.y};n-e>16&&!this.chart.get("stopTooltip")&&(this.showTooltip(i,t.views,t.shape),this.timeStamp=n)}},e.onMouseOut=function(t){var e=this.tooltip;e.get("visible")&&e.get("follow")&&(t&&t.toElement&&(p(t.toElement,"g2-tooltip")||d(t.toElement,"g2-tooltip"))||this.hideTooltip())},e.renderTooltip=function(){var t=this;if(!t.tooltip){var e,n=t.chart,i=t.viewTheme,a=t._getCanvas(),s=t._getDefaultTooltipCfg(),u=t.options;u=r.deepMix({plotRange:n.get("plotRange"),capture:!1,canvas:a,frontPlot:n.get("frontPlot"),viewTheme:i.tooltip,backPlot:n.get("backPlot")},s,u),u.crosshairs&&"rect"===u.crosshairs.type&&(u.zIndex=0),u.visible=!1,"mini"===u.type?(u.crosshairs=!1,u.position="top",e=new o.Mini(u)):e=u.useHtml?new o.Html(u):new o.Canvas(u),t.tooltip=e;var l=t._getTriggerEvent();if(!e.get("enterable")&&"plotmove"===l){var c=e.get("container");c&&(c.onmousemove=function(e){var r=t._normalizeEvent(e);n.emit(l,r)})}t._bindEvent()}},e.showTooltip=function(t,e,n){var i=this;if(!r.isEmpty(e)&&t){this.tooltip||this.renderTooltip();var a=i.options,o=[],s=[];if(r.each(e,function(e){if(!e.get("tooltipEnable"))return!0;var n=e.get("geoms"),u=e.get("coord");r.each(n,function(e){var n=e.get("type");if(e.get("visible")&&!1!==e.get("tooltipCfg")){var c=e.get("dataArray");if(e.isShareTooltip()||!1===a.shared&&r.inArray(["area","line","path","polygon"],n))r.each(c,function(c){var h=e.findPoint(t,c);if(h){var f=e.getTipItems(h,a.title);r.each(f,function(t){var a=t.point;if(a&&a.x&&a.y){var s=r.isArray(a.x)?a.x[a.x.length-1]:a.x,c=r.isArray(a.y)?a.y[a.y.length-1]:a.y;a=u.applyMatrix(s,c,1),t.x=a[0],t.y=a[1],t.showMarker=!0;var h=i._getItemMarker(e,t.color);t.marker=h,-1!==r.indexOf(l,n)&&o.push(t)}}),s=s.concat(f)}});else{var h=e.get("shapeContainer"),f=h.get("canvas"),p=f.get("pixelRatio"),d=h.getShape(t.x*p,t.y*p);d&&d.get("visible")&&d.get("origin")&&(s=e.getTipItems(d.get("origin"),a.title))}}}),r.each(s,function(t){var e=t.point,n=r.isArray(e.x)?e.x[e.x.length-1]:e.x,i=r.isArray(e.y)?e.y[e.y.length-1]:e.y;e=u.applyMatrix(n,i,1),t.x=e[0],t.y=e[1]})}),s.length){var c=s[0];if(!s.every(function(t){return t.title===c.title})){var h=c,f=1/0;s.forEach(function(e){var n=u.distance([t.x,t.y],[e.x,e.y]);n<f&&(f=n,h=e)}),s=s.filter(function(t){return t.title===h.title}),o=o.filter(function(t){return t.title===h.title})}if(!1===a.shared&&s.length>1){var p=s[0],d=Math.abs(t.y-p.y);r.each(s,function(e){Math.abs(t.y-e.y)<=d&&(p=e,d=Math.abs(t.y-e.y))}),p&&p.x&&p.y&&(o=[p]),s=[p]}i._setTooltip(t,s,o,n)}else i.hideTooltip()}},e.clear=function(){var t=this.tooltip;t&&t.destroy(),this.tooltip=null,this.prePoint=null,this._offEvent()},e._getItemMarker=function(t,e){var n=t.get("shapeType")||"point",r=t.getDefaultValue("shape")||"circle",a=i.getShapeFactory(n),o={color:e},s=a.getMarkerCfg(r,o);return s},t}();t.exports=v},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}function i(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}var a=n(113),o=n(8),s=n(0),u=n(115),l=n(5),c=n(125),h="_origin",f=n(265);function p(t){var e=t.startAngle,n=t.endAngle;return!(!s.isNil(e)&&!s.isNil(n)&&n-e<2*Math.PI)}function d(t,e,n){var r=(t-e)/(n-e);return r>=0&&r<=1}function g(t,e){var n=!1;if(t){var r=t.type;if("theta"===r){var i=t.start,a=t.end;n=d(e.x,i.x,a.x)&&d(e.y,i.y,a.y)}else{var o=t.invert(e);n=o.x>=0&&o.y>=0&&o.x<=1&&o.y<=1}}return n}var v={};s.each(o,function(t,e){var n=s.lowerFirst(e);v[n]=function(e){var n=new t(e);return this.addGeom(n),n}});var y=function(t){r(n,t);var e=n.prototype;function n(e){var n;n=t.call(this,e)||this;var r=i(i(n));return r._setTheme(),s.each(o,function(t,e){var n=s.lowerFirst(e);r[n]=function(e){void 0===e&&(e={}),e.viewTheme=r.get("viewTheme");var n=new t(e);return r.addGeom(n),n}}),r.init(),n}return e.getDefaultCfg=function(){return{viewContainer:null,coord:null,start:{x:0,y:0},end:{x:1,y:1},geoms:[],scales:{},options:{},scaleController:null,padding:0,theme:null,parent:null,tooltipEnable:!0,animate:l.animate,visible:!0}},e._setTheme=function(){var t=this,e=t.get("theme"),n={},r={};s.isObject(e)?r=e:-1!==s.indexOf(Object.keys(c),e)&&(r=c[e]),s.deepMix(n,l,r),t.set("viewTheme",n)},e.init=function(){this._initViewPlot(),this.get("data")&&this._initData(this.get("data")),this._initOptions(),this._initControllers(),this._bindEvents()},e._initOptions=function(){var t=this,e=s.mix({},t.get("options"));e.scales||(e.scales={}),e.coord||(e.coord={}),!1===e.animate&&this.set("animate",!1),(!1===e.tooltip||s.isNull(e.tooltip))&&this.set("tooltipEnable",!1),e.geoms&&e.geoms.length&&s.each(e.geoms,function(e){t._createGeom(e)});var n=t.get("scaleController");n&&(n.defs=e.scales);var r=t.get("coordController");r&&r.reset(e.coord),this.set("options",e)},e._createGeom=function(t){var e,n=t.type;this[n]&&(e=this[n](),s.each(t,function(t,n){var r;e[n]&&(s.isObject(t)&&t.field?"label"===t?e[n](t.field,t.callback,t.cfg):(s.each(t,function(t,e){"field"!==e&&(r=t)}),e[n](t.field,r)):e[n](t))}))},e._initControllers=function(){var t=this,e=t.get("options"),n=t.get("viewTheme"),r=t.get("canvas"),i=new u.Scale({viewTheme:n,defs:e.scales}),a=new u.Coord(e.coord);this.set("scaleController",i),this.set("coordController",a);var o=new u.Axis({canvas:r,viewTheme:n});this.set("axisController",o);var s=new u.Guide({viewTheme:n,options:e.guides||[]});this.set("guideController",s)},e._initViewPlot=function(){this.get("viewContainer")||this.set("viewContainer",this.get("middlePlot"))},e._initGeoms=function(){for(var t=this.get("geoms"),e=this.get("filteredData"),n=this.get("coord"),r=this.get("_id"),i=0;i<t.length;i++){var a=t[i];a.set("data",e),a.set("coord",n),a.set("_id",r+"-geom"+i),a.set("keyFields",this.get("keyFields")),a.init()}},e._clearGeoms=function(){for(var t=this,e=t.get("geoms"),n=0;n<e.length;n++){var r=e[n];r.clear()}},e._removeGeoms=function(){var t=this,e=t.get("geoms");while(e.length>0){var n=e.shift();n.destroy()}},e._drawGeoms=function(){this.emit("beforedrawgeoms");for(var t=this.get("geoms"),e=this.get("coord"),n=0;n<t.length;n++){var r=t[n];r.setCoord(e),r.paint()}this.emit("afterdrawgeoms")},e.isShapeInView=function(t){var e=this.get("_id"),n=t._id;if(n)return n.split("-")[0]===e;var r=t;while(r){if(r.get("viewId")===e)return!0;r=r.get("parent")}return!1},e.getViewRegion=function(){var t,e,n=this,r=n.get("parent");if(r){var i=r.getViewRegion(),a=n._getViewRegion(i.start,i.end);t=a.start,e=a.end}else t=n.get("start"),e=n.get("end");return{start:t,end:e}},e._getViewRegion=function(t,e){var n=this.get("start"),r=this.get("end"),i=n.x,a=1-r.y,o=r.x,u=1-n.y,l=this.get("padding"),c=s.toAllPadding(l),h=c[0],f=c[1],p=c[2],d=c[3],g={x:i*(e.x-t.x)+t.x+d,y:a*(e.y-t.y)+t.y-p},v={x:o*(e.x-t.x)+t.x-f,y:u*(e.y-t.y)+t.y+h};return{start:g,end:v}},e._createCoord=function(){var t=this.get("coordController"),e=this.getViewRegion(),n=t.createCoord(e.start,e.end);this.set("coord",n)},e._renderAxes=function(){var t=this.get("options"),e=t.axes;if(!1!==e){var n=this.get("axisController");n.container=this.get("backPlot"),n.coord=this.get("coord"),n.options=e||{};var r=this.getXScale(),i=this.getYScales(),a=this.get("_id");n.createAxis(r,i,a)}},e._renderGuides=function(){var t=this.get("guideController");if(!s.isEmpty(t.options)){var e=this.get("coord");t.view=this,t.backContainer=this.get("backPlot"),t.frontContainer=this.get("frontPlot"),t.xScales=this._getScales("x"),t.yScales=this._getScales("y"),t.render(e)}},e._bindEvents=function(){var t=new u.Event({view:this,canvas:this.get("canvas")});t.bindEvents(),this.set("eventController",t)},e._clearEvents=function(){var t=this.get("eventController");t&&t.clearEvents()},e._getScales=function(t){for(var e=this.get("geoms"),n={},r=0;r<e.length;r++){var i=e[r],a="x"===t?i.getXScale():i.getYScale();a&&!n[a.field]&&(n[a.field]=a)}return n},e._adjustScale=function(){this._setCatScalesRange();for(var t=this.get("geoms"),e=this.get("scaleController"),n=e.defs,r=0;r<t.length;r++){var i=t[r];if("interval"===i.get("type")){var a=i.getYScale(),o=a.field,s=a.min,u=a.max,l=a.type;n[o]&&n[o].min||"time"===l||(s>0?a.change({min:0}):u<=0&&a.change({max:0}))}}},e._setCatScalesRange=function(){var t=this,e=t.get("coord"),n=t.get("viewTheme"),r=t.getXScale(),i=t.getYScales(),a=[];r&&a.push(r),a=a.concat(i);var o=e.isPolar&&p(e),u=t.get("scaleController"),l=u.defs;s.each(a,function(t){if((t.isCategory||t.isIdentity)&&t.values&&(!l[t.field]||!l[t.field].range)){var r,i=t.values.length;if(1===i)r=[.5,1];else{var a=1,s=0;o?e.isTransposed?(a=n.widthRatio.multiplePie,s=1/i*a,r=[s/2,1-s/2]):r=[0,1-1/i]:(s=1/i*1/2,r=[s,1-s])}t.range=r}})},e.getXScale=function(){var t=this.get("geoms"),e=null;return s.isEmpty(t)||(e=t[0].getXScale()),e},e.getYScales=function(){for(var t=this.get("geoms"),e=[],n=0;n<t.length;n++){var r=t[n],i=r.getYScale();i&&-1===s.indexOf(e,i)&&e.push(i)}return e},e.getXY=function(t){var e,n,r=this,i=r.get("coord"),a=r._getScales("x"),o=r._getScales("y");for(var u in t)a[u]&&(e=a[u].scale(t[u])),o[u]&&(n=o[u].scale(t[u]));return s.isNil(e)||s.isNil(n)?null:i.convert({x:e,y:n})},e.getSnapRecords=function(t){var e=this,n=e.get("geoms"),r=[];return s.each(n,function(e){var n,i=e.get("dataArray");s.each(i,function(i){n=e.findPoint(t,i),n&&r.push(n)})}),r},e.addGeom=function(t){var e=this,n=e.get("geoms");n.push(t),t.set("view",e);var r=e.get("viewContainer");t.set("container",r),t.set("animate",e.get("animate")),t.bindEvents()},e.removeGeom=function(t){var e=this.get("geoms");s.Array.remove(e,t),t.destroy()},e.createScale=function(t,e){var n=this.get("scales"),r=this.get("parent"),i=n[t];if(!e){var a=this.get("filteredData"),o=this._getFieldsForLegend();e=a.length&&-1===o.indexOf(t)?a:this.get("data")}var s=this.get("scaleController");if(i){if(i.sync){var u=s.createScale(t,e);this._syncScale(i,u)}}else{if(i=s.createScale(t,e),i.sync&&r){var l=r.createScale(t,e);i=this._getSyncScale(l,i)}n[t]=i}return i},e._getFieldsForLegend=function(){var t=[],e=this.get("geoms");return s.each(e,function(e){var n=e.getFieldsForLegend();t=t.concat(n)}),s.uniq(t)},e._getSyncScale=function(t,e){return t.type!==e.type?e:(this._syncScale(t,e),t)},e._syncScale=function(t,e){var n=s.union(t.values,e.values);if(e.isLinear){var r=Math.max(t.max,e.max),i=Math.min(t.min,e.min);t.max===r&&t.min===i||t.change({min:i,max:r,values:n})}n.length!==t.values.length&&t.change({values:n})},e.getFilteredValues=function(t){var e,n=this.get("scales")[t],r=n.values,i=this._getFilters();return e=i&&i[t]?r.filter(i[t]):r.slice(0),e},e.getFilteredOutValues=function(t){var e,n=this.get("scales")[t],r=n.values,i=this._getFilters();return e=i&&i[t]?r.filter(function(e){return!i[t](e)}):[],e},e.filter=function(t,e){var n=this.get("options");n.filters||(n.filters={}),n.filters[t]=e,this.get("scaleController").filters=n.filters},e._getFilters=function(){var t=this.get("options");return t.filters},e.execFilter=function(t){var e=this,n=e._getFilters();return n&&(t=t.filter(function(t){var e=!0;return s.each(n,function(n,r){if(n&&(e=n(t[r],t),!e))return!1}),e})),t},e.axis=function(t,e){var n=this.get("options");if(!1===t)n.axes=!1;else{n.axes||(n.axes={});var r=n.axes;r[t]=e}return this},e.guide=function(){return this.get("guideController")},e._getKeyFields=function(t){var e=[];s.each(t,function(t,n){t.key&&e.push(n)}),this.set("keyFields",e)},e.scale=function(t,e){var n=this.get("options"),r=n.scales;return s.isObject(t)?s.mix(r,t):r[t]=e,this._getKeyFields(r),this},e.tooltip=function(t){return this.set("tooltipEnable",t),this},e.animate=function(t){var e=this.get("options");return e.animate=t,this.set("animate",t),this},e.changeOptions=function(t){return this.set("options",t),this._initOptions(t),this},e.getViewsByPoint=function(t){var e=[],n=this.get("views");return g(this.get("coord"),t)&&e.push(this),s.each(n,function(n){n.get("visible")&&g(n.get("coord"),t)&&e.push(n)}),e},e.eachShape=function(t){var e=this,n=e.get("views"),r=e.get("canvas");s.each(n,function(e){e.eachShape(t)});var i=this.get("geoms");return s.each(i,function(n){var r=n.getShapes();s.each(r,function(r){var i=r.get("origin");if(s.isArray(i)){var a=i.map(function(t){return t[h]});t(a,r,n,e)}else{var o=i[h];t(o,r,n,e)}})}),r.draw(),this},e.filterShape=function(t){var e=function(e,n,r,i){t(e,n,r,i)?n.show():n.hide()};return this.eachShape(e),this},e.clearInner=function(){this.set("scales",{}),this.emit("beforeclearinner");var t=this.get("options");t.geoms=null,this._clearGeoms(),this.get("guideController")&&this.get("guideController").reset(),this.get("axisController")&&this.get("axisController").clear(),this.emit("afterclearinner")},e.clear=function(){var t=this.get("options");return t.filters=null,this._removeGeoms(),this.clearInner(),this.get("guideController")&&this.get("guideController").clear(),this.set("isUpdate",!1),this.set("keyFields",[]),this},e.coord=function(t,e){var n=this.get("coordController");return n.reset({type:t,cfg:e}),n},e.resetCoord=function(){this._createCoord()},e.source=function(t,e){return this._initData(t),e&&this.scale(e),this.emit("setdata"),this},e.changeData=function(t){return this.emit("beforechangedata"),this._initData(t),this.emit("afterchangedata"),this.repaint(),this},e._initData=function(t){var e=this.get("dataView");e&&(e.off("change",s.getWrapBehavior(this,"_onViewChange")),this.set("dataView",null)),t&&t.isDataView&&(t.on("change",s.wrapBehavior(this,"_onViewChange")),this.set("dataView",t),t=t.rows),this.set("data",t)},e._onViewChange=function(){this.emit("beforechangedata");var t=this.get("dataView"),e=t.rows;this.set("data",e),this.emit("afterchangedata"),this.repaint()},e.beforeRender=function(){var t=this.get("views");s.each(t,function(t){t.beforeRender()}),this.initView()},e.drawComponents=function(){var t=this.get("views");s.each(t,function(t){t.drawComponents()}),this._renderAxes(),this._renderGuides()},e.drawCanvas=function(t){if(!t){var e=this.get("views"),n=this.get("backPlot");n.sort();var r=this.get("canvas"),i=this.get("animate");if(i){var a=this.get("isUpdate");s.each(e,function(t){f.execAnimation(t,a)}),f.execAnimation(this,a)}else r.draw()}},e.render=function(t){return this.clearInner(),this.emit("beforerender"),this.beforeRender(),this.emit("beforepaint"),this.drawComponents(),this.paint(),this.emit("afterpaint"),this.drawCanvas(t),this.emit("afterrender"),this.set("rendered",!0),this},e.initView=function(){var t=this.get("data")||[],e=this.execFilter(t);this.set("filteredData",e),this._createCoord(),this.emit("beforeinitgeoms"),this._initGeoms(),this._adjustScale()},e.paint=function(){var t=this.get("views");s.each(t,function(t){t.paint()});var e=this.get("data");s.isEmpty(e)||this._drawGeoms(),this.get("visible")||this.changeVisible(!1,!0)},e.changeVisible=function(t,e){var n=this.get("geoms");if(s.each(n,function(e){e.changeVisible(t,!0)}),this.get("axisController")&&this.get("axisController").changeVisible(t),this.get("guideController")&&this.get("guideController").changeVisible(t),!e){var r=this.get("canvas");r.draw()}},e.repaint=function(){this.set("isUpdate",!0),this.clearInner(),this.render()},e.destroy=function(){this._clearEvents();var e=this.get("dataView");e&&e.off("change",s.getWrapBehavior(this,"_onViewChange")),this.clear(),t.prototype.destroy.call(this)},n}(a);t.exports=y},function(t,e,n){var r=n(29),i=r.Guide,a=n(275);i.RegionFilter=a,t.exports=i},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(0),a=n(19),o=n(35),s=o.Path,u=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return i.mix({},e,{name:"regionFilter",zIndex:1,top:!0,start:null,end:null,color:null,apply:null,style:{opacity:1}})},n.render=function(t,e,n,r){var i=this,a=e.addGroup();a.name="guide-region-filter",r.once("afterpaint",function(){if(!a.get("destroyed")){i._drawShapes(r,a);var e=i._drawClip(t);a.attr({clip:e}),i.set("clip",e),i.get("appendInfo")&&a.setSilent("appendInfo",i.get("appendInfo")),i.set("el",a)}})},n._drawShapes=function(t,e){var n=this,r=[],a=t.getAllGeoms();return a.map(function(t){var a=t.getShapes(),o=t.get("type"),s=n._geomFilter(o);return s&&a.map(function(t){var a=t.type,o=i.cloneDeep(t.attr());n._adjustDisplay(o);var s=e.addShape(a,{attrs:o});return r.push(s),t}),t}),r},n._drawClip=function(t){var e=this,n=e.parsePoint(t,e.get("start")),r=e.parsePoint(t,e.get("end")),i=[["M",n.x,n.y],["L",r.x,n.y],["L",r.x,r.y],["L",n.x,r.y],["z"]],a=new s({attrs:{path:i,opacity:1}});return a},n._adjustDisplay=function(t){var e=this,n=e.get("color");t.fill&&(t.fill=t.fillStyle=n),t.stroke=t.strokeStyle=n},n._geomFilter=function(t){var e=this,n=e.get("apply");return!n||i.contains(n,t)},n.clear=function(){t.prototype.clear.call(this);var e=this.get("clip");e&&e.remove()},e}(a);t.exports=u},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(0),a=n(29),o=n(5),s=a.Legend,u=s.Category,l=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return i.mix({},e,{type:"tail-legend",layout:"vertical",autoLayout:!0})},n._addItem=function(t){var e=this.get("itemsGroup"),n=this._getNextX(),r=0,a=this.get("unCheckColor"),o=e.addGroup({x:0,y:0,value:t.value,scaleValue:t.scaleValue,checked:t.checked});o.translate(n,r),o.set("viewId",e.get("viewId"));var s=this.get("textStyle"),u=this.get("_wordSpaceing"),l=0;if(t.marker){var c=i.mix({},t.marker,{x:t.marker.radius,y:0});t.checked||(c.fill&&(c.fill=a),c.stroke&&(c.stroke=a));var h=o.addShape("marker",{type:"marker",attrs:c});h.attr("cursor","pointer"),h.name="legend-marker",l+=h.getBBox().width+u}var f=i.mix({},s,{x:l,y:0,text:this._formatItemValue(t.value)});t.checked||i.mix(f,{fill:a});var p=o.addShape("text",{attrs:f});p.attr("cursor","pointer"),p.name="legend-text",this.get("appendInfo")&&p.setSilent("appendInfo",this.get("appendInfo"));var d=o.getBBox(),g=this.get("itemWidth"),v=o.addShape("rect",{attrs:{x:n,y:r-d.height/2,fill:"#fff",fillOpacity:0,width:g||d.width,height:d.height}});return v.attr("cursor","pointer"),v.setSilent("origin",t),v.name="legend-item",this.get("appendInfo")&&v.setSilent("appendInfo",this.get("appendInfo")),o.name="legendGroup",o},n._adjust=function(){var t=this,e=t.get("geom");if(e){var n=t.get("group").attr("matrix");n[7]=0;var r=t.get("geom").get("dataArray"),a=this.get("itemsGroup").get("children"),o=0;i.each(a,function(t){var e=r[o],n=e[e.length-1].y;i.isArray(n)&&(n=n[1]);var a=t.getBBox().height,s=t.get("x"),u=n-a/2;t.translate(s,u),o++}),t.get("autoLayout")&&t._antiCollision(a)}},n.render=function(){var e=this;t.prototype.render.call(this);var n=this.get("chart");n.once("afterpaint",function(){e._adjust()})},n._getPreviousY=function(t){var e=t.attr("matrix")[7],n=t.getBBox().height;return e+n},n._adjustDenote=function(t,e,n){var r=o.legend.legendMargin,i=-2,a=2*-r;t.addShape("path",{attrs:{path:"M"+i+","+e+"L"+a+","+(n+3),lineWidth:1,lineDash:[2,2],stroke:"#999999"}})},n._antiCollision=function(t){var e=this;t.sort(function(t,e){var n=t.attr("matrix")[7],r=e.attr("matrix")[7];return n-r});var n=!0,r=e.get("chart").get("plotRange"),i=r.tl.y,a=Math.abs(i-r.bl.y),o=t[0].getBBox().height,s=Number.MIN_VALUE,u=0,l=t.map(function(t){var e=t.attr("matrix")[7];return e>u&&(u=e),e<s&&(s=e),{size:t.getBBox().height,targets:[e-i]}});s-=i;var c=0;while(n){for(var h=0;h<l.length;h++){var f=l[h],p=(Math.min.apply(s,f.targets)+Math.max.apply(s,f.targets))/2;f.pos=Math.min(Math.max(s,p-f.size/2),a-f.size)}n=!1,c=l.length;while(c--)if(c>0){var d=l[c-1],g=l[c];d.pos+d.size>g.pos&&(d.size+=g.size,d.targets=d.targets.concat(g.targets),l.splice(c,1),n=!0)}}c=0;var v=this.get("itemsGroup").addGroup();l.forEach(function(n){var r=i+o;n.targets.forEach(function(){var i=t[c].attr("matrix")[7],a=n.pos+r-o/2,s=Math.abs(i-a);s>o/2&&e._adjustDenote(v,a,i-e.get("group").attr("matrix")[7]/2),t[c].translate(0,-i),t[c].translate(0,a),r+=o,c++})})},e}(u);t.exports=l},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(0),a=n(23),o=a.Group,s="auto",u=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.getDefaultCfg=function(){return{type:"plotBack",padding:null,background:null,plotRange:null,plotBackground:null}},n._beforeRenderUI=function(){this._calculateRange()},n._renderUI=function(){this._renderBackground(),this._renderPlotBackground()},n._renderBackground=function(){var t=this,e=t.get("background");if(e){var n=this.get("canvas"),r=t.get("width")||n.get("width"),a=t.get("height")||n.get("height"),o={x:0,y:0,width:r,height:a},s=t.get("backgroundShape");s?s.attr(o):(s=this.addShape("rect",{attrs:i.mix(o,e)}),this.set("backgroundShape",s))}},n._renderPlotBackground=function(){var t=this,e=t.get("plotBackground");if(e){var n=t.get("plotRange"),r=n.br.x-n.bl.x,a=n.br.y-n.tr.y,o=n.tl,s={x:o.x,y:o.y,width:r,height:a},u=t.get("plotBackShape");u?u.attr(s):(e.image?(s.img=e.image,u=t.addShape("image",{attrs:s})):(i.mix(s,e),u=t.addShape("rect",{attrs:s})),t.set("plotBackShape",u))}},n._convert=function(t,e){if(i.isString(t))if(t===s)t=0;else if(-1!==t.indexOf("%")){var n=this.get("canvas"),r=this.get("width")||n.get("width"),a=this.get("height")||n.get("height");t=parseInt(t,10)/100,t=e?t*r:t*a}return t},n._calculateRange=function(){var t=this,e=t.get("plotRange");i.isNil(e)&&(e={});var n=t.get("padding"),r=this.get("canvas"),a=t.get("width")||r.get("width"),o=t.get("height")||r.get("height"),s=i.toAllPadding(n),u=t._convert(s[0],!1),l=t._convert(s[1],!0),c=t._convert(s[2],!1),h=t._convert(s[3],!0),f=Math.min(h,a-l),p=Math.max(h,a-l),d=Math.min(o-c,u),g=Math.max(o-c,u);e.tl={x:f,y:d},e.tr={x:p,y:d},e.bl={x:f,y:g},e.br={x:p,y:g},e.cc={x:(p+f)/2,y:(g+d)/2},this.set("plotRange",e)},n.repaint=function(){return this._calculateRange(),this._renderBackground(),this._renderPlotBackground(),this},e}(o);t.exports=u},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(43);function a(t,e,n){return{x:t.x+e*Math.cos(n),y:t.y+e*Math.sin(n)}}var o=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return e.type="circle",e},n.getRegion=function(t,e){var n=.5,r=2*Math.PI/t,i=-1*Math.PI/2+r*e,o=n/(1+1/Math.sin(r/2)),s={x:.5,y:.5},u=a(s,n-o,i),l=5*Math.PI/4,c=1*Math.PI/4;return{start:a(u,o,l),end:a(u,o,c)}},n.generateFacets=function(t){var e=this,n=e.fields,r=n[0];if(!r)throw"Please specify for the field for facet!";var i=e.getFieldValues(r,t),a=i.length,o=[];return i.forEach(function(n,s){var u=[{field:r,value:n,values:i}],l=e.getFilter(u),c=t.filter(l),h={type:e.type,colValue:n,colField:r,colIndex:s,cols:a,rows:1,rowIndex:0,data:c,region:e.getRegion(a,s)};o.push(h)}),o},e}(i);t.exports=o},function(t,e,n){var r=n(0),i=n(114),a={};a.Rect=n(120),a.List=n(119),a.Circle=n(278),a.Tree=n(282),a.Mirror=n(281),a.Matrix=n(280),i.prototype.facet=function(t,e){var n=a[r.upperFirst(t)];if(!n)throw new Error("Not support such type of facets as: "+t);var i=this.get("facets");i&&i.destroy(),e.chart=this;var o=new n(e);this.set("facets",o)},t.exports=a},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(120),a=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return e.type="matrix",e.showTitle=!1,e},n.generateFacets=function(t){for(var e=this,n=e.fields,r=n.length,i=r,a=[],o=0;o<i;o++)for(var s=n[o],u=0;u<r;u++){var l=n[u],c={type:e.type,colValue:s,rowValue:l,colField:s,rowField:l,colIndex:o,rowIndex:u,cols:i,rows:r,data:t,region:e.getRegion(r,i,o,u)};a.push(c)}return a},n.setXAxis=function(t,e,n){n.rowIndex!==n.rows-1&&(e[t].title=null,e[t].label=null)},n.setYAxis=function(t,e,n){0!==n.colIndex&&(e[t].title=null,e[t].label=null)},e}(i);t.exports=a},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(119),a=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return e.type="mirror",this.transpose=!1,e},n.init=function(){var e=this;e.transpose?(e.cols=2,e.rows=1):(e.cols=1,e.rows=2),t.prototype.init.call(this)},n.beforeProcessView=function(t,e){this.transpose?e.colIndex%2===0?t.coord().transpose().scale(-1,1):t.coord().transpose():e.rowIndex%2!==0&&t.coord().scale(1,-1)},n.renderTitle=function(t,e){this.transpose?this.drawColTitle(t,e):this.drawRowTitle(t,e)},n.setXAxis=function(t,e,n){1!==n.colIndex&&1!==n.rowIndex||(e[t].label=null,e[t].title=null)},n.setYAxis=function(){},e}(i);t.exports=a},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(43),a=n(0),o=a.assign,s=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return e.type="tree",e.line={lineWidth:1,stroke:"#ddd"},e.lineSmooth=!1,e},n.generateFacets=function(t){var e=this,n=e.fields;if(!n.length)throw"Please specify for the fields for facet!";var r=[],i=e.getRootFacet(t);return r.push(i),i.children=e.getChildFacets(t,1,r),e.setRegion(r),r},n.getRootFacet=function(t){var e=this,n={type:e.type,rows:e.getRows(),rowIndex:0,colIndex:0,colValue:e.rootTitle,data:t};return n},n.getRows=function(){return this.fields.length+1},n.getChildFacets=function(t,e,n){var r=this,i=r.fields,a=i.length;if(!(a<e)){var o=[],s=i[e-1],u=r.getFieldValues(s,t);return u.forEach(function(i,a){var l=[{field:s,value:i,values:u}],c=r.getFilter(l),h=t.filter(c);if(h.length){var f={type:r.type,colValue:i,colField:s,colIndex:a,rows:r.getRows(),rowIndex:e,data:h,children:r.getChildFacets(h,e+1,n)};o.push(f),n.push(f)}}),o}},n.setRegion=function(t){var e=this;e.forceColIndex(t),t.forEach(function(t){t.region=e.getRegion(t.rows,t.cols,t.colIndex,t.rowIndex)})},n.forceColIndex=function(t){var e=this,n=[],r=0;t.forEach(function(t){e.isLeaf(t)&&(n.push(t),t.colIndex=r,r++)}),n.forEach(function(t){t.cols=n.length});for(var i=e.fields.length,a=i-1;a>=0;a--)for(var o=e.getFacetsByLevel(t,a),s=0;s<o.length;s++){var u=o[s];e.isLeaf(u)||(u.originColIndex=u.colIndex,u.colIndex=e.getRegionIndex(u.children),u.cols=n.length)}},n.getFacetsByLevel=function(t,e){var n=[];return t.forEach(function(t){t.rowIndex===e&&n.push(t)}),n},n.getRegion=function(t,e,n,r){var i=1/e,a=1/t,o={x:i*n,y:a*r},s={x:o.x+i,y:o.y+2*a/3};return{start:o,end:s}},n.getRegionIndex=function(t){var e=t[0],n=t[t.length-1];return(n.colIndex-e.colIndex)/2+e.colIndex},n.isLeaf=function(t){return!t.children||!t.children.length},n.setXAxis=function(t,e,n){n.rowIndex!==n.rows-1&&(e[t].label=null,e[t].title=null)},n.setYAxis=function(t,e,n){0!==n.originColIndex&&0!==n.colIndex&&(e[t].title=null,e[t].label=null)},n.onPaint=function(){t.prototype.onPaint.call(this),this.group.clear(),this.facets&&this.line&&this.drawLines(this.facets,this.group)},n.drawLines=function(t,e){var n=this,r=e.addGroup();t.forEach(function(t){if(!n.isLeaf(t)){var e=t.children;n._addFacetLines(t,e,r)}})},n._addFacetLines=function(t,e,n){var r=this,i=t.view,a=i.getViewRegion(),o={x:a.start.x+(a.end.x-a.start.x)/2,y:a.start.y};e.forEach(function(t){var e=t.view.getViewRegion(),i={x:e.start.x+(e.end.x-e.start.x)/2,y:e.end.y},a={x:o.x,y:o.y+(i.y-o.y)/2},s={x:i.x,y:a.y};r._drawLine([o,a,s,i],n)})},n._getPath=function(t){var e=this,n=[],r=e.lineSmooth;return r?(n.push(["M",t[0].x,t[0].y]),n.push(["C",t[1].x,t[1].y,t[2].x,t[2].y,t[3].x,t[3].y])):t.forEach(function(t,e){0===e?n.push(["M",t.x,t.y]):n.push(["L",t.x,t.y])}),n},n._drawLine=function(t,e){var n=this,r=n._getPath(t),i=n.line;e.addShape("path",{attrs:o({path:r},i)})},e}(i);t.exports=s},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}function i(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}var a=n(8),o=n(122),s=n(0);n(298);var u=function(t){r(n,t);var e=n.prototype;function n(e){var n;return n=t.call(this,e)||this,s.assign(i(i(n)),o),n}return e.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return e.type="area",e.shapeType="area",e.generatePoints=!0,e.sortable=!0,e},e.draw=function(t,e,n,r){var i=this,a=this.getDrawCfg(t[0]);i._applyViewThemeShapeStyle(a,a.shape,n);var o=this.splitData(t);a.origin=t,s.each(o,function(t,o){a.splitedIndex=o;var s=t.map(function(t){return t.points});a.points=s;var u=n.drawShape(a.shape,a,e);i.appendShapeInfo(u,r+o)})},n}(a),l=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return e.hasDefaultAdjust=!0,e.adjusts=[{type:"stack"}],e},e}(u);u.Stack=l,a.Area=u,a.AreaStack=l,t.exports=u},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(8);n(299);var a=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return e.type="edge",e.shapeType="edge",e.generatePoints=!0,e},e}(i);i.Edge=a,t.exports=a},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(61),a=i.ColorUtil,o=n(8),s=n(0),u="_origin",l="shadowCanvas",c="valueRange",h="imageShape",f="mappedData",p="grayScaleBlurredCanvas",d="heatmapSize",g=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return e.type="heatmap",e.paletteCache={},e},n._prepareRange=function(){var t=this,e=t.get(f),n=t.getAttr("color"),r=n.field,i=1/0,a=-1/0;e.forEach(function(t){var e=t[u][r];e>a&&(a=e),e<i&&(i=e)}),i===a&&(i=a-1);var o=[i,a];t.set(c,o)},n._prepareSize=function(){var t=this,e=t.getDefaultValue("size");s.isNumber(e)||(e=t._getDefaultSize());var n=t.get("styleOptions"),r=n&&s.isObject(n.style)?n.style.blur:null;s.isFinite(r)&&null!==r||(r=e/2),t.set(d,{blur:r,radius:e})},n._getDefaultSize=function(){var t=this,e=t.getAttr("position"),n=t.get("coord"),r=Math.min(n.width/(4*e.scales[0].ticks.length),n.height/(4*e.scales[1].ticks.length));return r},n._colorize=function(t){for(var e=this,n=e.getAttr("color"),r=t.data,i=e.get("paletteCache"),o=3;o<r.length;o+=4){var s=r[o];if(s){var u=void 0;i[s]?u=i[s]:(u=a.rgb2arr(n.gradient(s/256)),i[s]=u),r[o-3]=u[0],r[o-2]=u[1],r[o-1]=u[2],r[o]=s}}},n._prepareGreyScaleBlurredCircle=function(t,e){var n=this,r=n.get(p);r||(r=document.createElement("canvas"),n.set(p,r));var i=t+e,a=r.getContext("2d");r.width=r.height=2*i,a.clearRect(0,0,r.width,r.height),a.shadowOffsetX=a.shadowOffsetY=2*i,a.shadowBlur=e,a.shadowColor="black",a.beginPath(),a.arc(-i,-i,t,0,2*Math.PI,!0),a.closePath(),a.fill()},n._drawGrayScaleBlurredCircle=function(t,e,n,r,i){var a=this,o=a.get(p);i.globalAlpha=r,i.drawImage(o,t-n,e-n)},n._getShadowCanvasCtx=function(){var t=this,e=t.get(l);e||(e=document.createElement("canvas"),t.set(l,e));var n=t.get("coord");return n&&(e.width=n.width,e.height=n.height),e.getContext("2d")},n._clearShadowCanvasCtx=function(){var t=this._getShadowCanvasCtx();t.clearRect(0,0,t.canvas.width,t.canvas.height)},n._getImageShape=function(){var t=this,e=t.get(h);if(e)return e;var n=t.get("container");return e=n.addShape("Image",{}),t.set(h,e),e},n.clear=function(){this._clearShadowCanvasCtx(),t.prototype.clear.call(this)},n.drawWithRange=function(t){var e=this,n=e.get("coord"),r=n.start,i=n.end,a=n.width,o=n.height,s=e.getAttr("color").field,l=e.get(d);e._clearShadowCanvasCtx();var c=e._getShadowCanvasCtx(),h=e.get(f);t&&(h=h.filter(function(e){return e[u][s]<=t[1]&&e[u][s]>=t[0]}));for(var p=e._getScale(s),g=0;g<h.length;g++){var v=h[g],y=e.getDrawCfg(v),m=p.scale(v[u][s]);e._drawGrayScaleBlurredCircle(y.x-r.x,y.y-i.y,l.radius+l.blur,m,c)}var x=c.getImageData(0,0,a,o);e._clearShadowCanvasCtx(),e._colorize(x),c.putImageData(x,0,0);var b=e._getImageShape();b.attr("x",r.x),b.attr("y",i.y),b.attr("width",a),b.attr("height",o),b.attr("img",c.canvas)},n.draw=function(t){var e=this;e.set(f,t),e._prepareRange(),e._prepareSize();var n=e.get(d);e._prepareGreyScaleBlurredCircle(n.radius,n.blur);var r=e.get(c);e.drawWithRange(r)},e}(o);o.Heatmap=g,t.exports=g},function(t,e,n){var r=n(8);r.Point=n(295),r.PointJitter=r.Point.Jitter,r.PointStack=r.Point.Stack,r.Path=n(123),r.Line=n(291),r.LineStack=r.Line.Stack,r.Interval=n(287),r.IntervalStack=r.Interval.Stack,r.IntervalDodge=r.Interval.Dodge,r.IntervalSymmetric=r.Interval.Symmetric,r.Area=n(283),r.AreaStack=r.Area.Stack,r.Polygon=n(296),r.Schema=n(297),r.SchemaDodge=r.Schema.Dodge,r.Edge=n(284),r.Heatmap=n(285),r.Venn=n(309),r.Violin=n(310),t.exports=r},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}function i(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}var a=n(8),o=n(0),s=n(67);n(300);var u=function(t){r(n,t);var e=n.prototype;function n(e){var n;return n=t.call(this,e)||this,o.assign(i(i(n)),s),n}return e.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return e.type="interval",e.shapeType="interval",e.generatePoints=!0,e},e.createShapePointsCfg=function(e){var n=t.prototype.createShapePointsCfg.call(this,e);return n.size=this.getNormalizedSize(e),n},e.clearInner=function(){t.prototype.clearInner.call(this),this.set("defaultSize",null)},n}(a),l=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return e.hasDefaultAdjust=!0,e.adjusts=[{type:"stack"}],e},e}(u),c=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return e.hasDefaultAdjust=!0,e.adjusts=[{type:"dodge"}],e},e}(u),h=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return e.hasDefaultAdjust=!0,e.adjusts=[{type:"symmetric"}],e},e}(u);u.Stack=l,u.Dodge=c,u.Symmetric=h,a.Interval=u,a.IntervalStack=l,a.IntervalDodge=c,a.IntervalSymmetric=h,t.exports=u},function(t,e,n){var r=n(66),i=n(121),a=n(290),o=n(289),s={getLabelsClass:function(t,e){var n=r;return"polar"===t?n=i:"theta"===t?n=a:"interval"!==e&&"polygon"!==e||(n=o),n}};t.exports=s},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(0),a=n(66),o=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.setLabelPosition=function(t,e,n,r){i.isFunction(r)&&(r=r(t.text,e._origin,n));var a=this.get("coord"),o=a.isTransposed,s=a.convertPoint(e.points[0]),u=a.convertPoint(e.points[2]),l=(s.x-u.x)/2*(o?-1:1),c=(s.y-u.y)/2*(o?-1:1);switch(r){case"right":o?(t.x-=l,t.y+=c,t.textAlign=t.textAlign||"center"):(t.x-=l,t.y+=c,t.textAlign=t.textAlign||"left");break;case"left":o?(t.x-=l,t.y-=c,t.textAlign=t.textAlign||"center"):(t.x+=l,t.y+=c,t.textAlign=t.textAlign||"right");break;case"bottom":o?(t.x-=2*l,t.textAlign=t.textAlign||"left"):(t.y+=2*c,t.textAlign=t.textAlign||"center");break;case"middle":o?t.x-=l:t.y+=c,t.textAlign=t.textAlign||"center";break;case"top":t.textAlign=o?t.textAlign||"left":t.textAlign||"center";break;default:break}},e}(a);t.exports=o},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(0),a=n(121),o=n(25),s=n(5),u=5;function l(t,e,n){return{x:t.x+n*Math.cos(e),y:t.y+n*Math.sin(e)}}function c(t,e,n,r,i){var a,o=!0,s=n.start,u=n.end,l=Math.min(s.y,u.y),c=Math.abs(s.y-u.y),h=0,f=Number.MIN_VALUE,p=t.map(function(t){return t.y>h&&(h=t.y),t.y<f&&(f=t.y),{size:e,targets:[t.y-l]}});f-=l,h-l>c&&(c=h-l);while(o){p.forEach(function(t){var e=(Math.min.apply(f,t.targets)+Math.max.apply(f,t.targets))/2;t.pos=Math.min(Math.max(f,e-t.size/2),c-t.size)}),o=!1,a=p.length;while(a--)if(a>0){var d=p[a-1],g=p[a];d.pos+d.size>g.pos&&(d.size+=g.size,d.targets=d.targets.concat(g.targets),d.pos+d.size>c&&(d.pos=c-d.size),p.splice(a,1),o=!0)}}a=0,p.forEach(function(n){var r=l+e/2;n.targets.forEach(function(){t[a].y=n.pos+r,r+=e,a++})}),t.forEach(function(t){var e=t.r*t.r,n=Math.pow(Math.abs(t.y-r.y),2);if(e<n)t.x=r.x;else{var a=Math.sqrt(e-n);t.x=i?r.x+a:r.x-a}})}var h=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.getDefaultCfg=function(){return{label:s.thetaLabels}},n.getDefaultOffset=function(t){return t.offset||0},n.adjustItems=function(e){var n=this,r=e[0]?e[0].offset:0;return r>0&&(e=n._distribute(e,r)),t.prototype.adjustItems.call(this,e)},n._distribute=function(t,e){var n=this,r=n.get("coord"),i=r.getRadius(),a=n.get("label").labelHeight,o=r.getCenter(),s=i+e,u=2*s+2*a,l={start:r.start,end:r.end},h=n.get("geom");if(h){var f=h.get("view");l=f.getViewRegion()}var p=[[],[]];return t.forEach(function(t){t&&("right"===t.textAlign?p[0].push(t):p[1].push(t))}),p.forEach(function(t,e){var n=parseInt(u/a,10);t.length>n&&(t.sort(function(t,e){return e["..percent"]-t["..percent"]}),t.splice(n,t.length-n)),t.sort(function(t,e){return t.y-e.y}),c(t,a,l,o,e)}),p[0].concat(p[1])},n.lineToLabel=function(t){var e=this,n=e.get("coord"),r=n.getRadius(),i=t.offset,a=t.orignAngle||t.angle,o=n.getCenter(),s=l(o,a,r+u/2),c=l(o,a,r+i/2);t.labelLine||(t.labelLine=e.get("label").labelLine||{}),t.labelLine.path=["M"+s.x,s.y+" Q"+c.x,c.y+" "+t.x,t.y].join(",")},n.getLabelRotate=function(t,e){var n;return e<0&&(n=180*t/Math.PI,n>90&&(n-=180),n<-90&&(n+=180)),n/180*Math.PI},n.getLabelAlign=function(t){var e,n=this,r=n.get("coord"),i=r.getCenter();e=t.angle<=Math.PI/2&&t.x>=i.x?"left":"right";var a=n.getDefaultOffset(t);return a<=0&&(e="right"===e?"left":"right"),e},n.getArcPoint=function(t){return t},n.getPointAngle=function(t){var e=this,n=e.get("coord"),r={x:i.isArray(t.x)?t.x[0]:t.x,y:t.y[0]};e.transLabelPoint(r);var a,s={x:i.isArray(t.x)?t.x[1]:t.x,y:t.y[1]};e.transLabelPoint(s);var u=o.getPointAngle(n,r);if(t.points&&t.points[0].y===t.points[1].y)a=u;else{var l=o.getPointAngle(n,s);u>=l&&(l+=2*Math.PI),a=u+(l-u)/2}return a},n.getCirclePoint=function(t,e){var n=this,r=n.get("coord"),i=r.getCenter(),a=r.getRadius()+e,o=l(i,t,a);return o.angle=t,o.r=a,o},e}(a);t.exports=h},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(8),a=n(123);n(301);var o=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return e.type="line",e.sortable=!0,e},e}(a),s=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return e.hasDefaultAdjust=!0,e.adjusts=[{type:"stack"}],e},e}(o);o.Stack=s,i.Line=o,i.LineStack=s,t.exports=o},function(t,e,n){var r=n(0),i="_origin";function a(t,e){if(r.isNil(t)||r.isNil(e))return!1;var n=t.get("origin"),i=e.get("origin");return r.isEqual(n,i)}function o(t,e){if(!t)return!0;if(t.length!==e.length)return!0;var n=!1;return r.each(e,function(e,r){if(!a(e,t[r]))return n=!0,!1}),n}function s(t,e){var n={};return r.each(t,function(t,i){var a=e.attr(i);r.isArray(a)&&(a=r.cloneDeep(a)),n[i]=a}),n}var u={_isAllowActive:function(){var t=this.get("allowActive");if(!r.isNil(t))return t;var e=this.get("view"),n=this.isShareTooltip(),i=e.get("options");return!1===i.tooltip||!n},_onMouseenter:function(t){var e=this,n=t.shape,r=e.get("shapeContainer");n&&r.contain(n)&&e._isAllowActive()&&e.setShapesActived(n)},_onMouseleave:function(){var t=this,e=t.get("view"),n=e.get("canvas");t.get("activeShapes")&&(t.clearActivedShapes(),n.draw())},_bindActiveAction:function(){var t=this,e=t.get("view"),n=t.get("type");e.on(n+":mouseenter",r.wrapBehavior(t,"_onMouseenter")),e.on(n+":mouseleave",r.wrapBehavior(t,"_onMouseleave"))},_offActiveAction:function(){var t=this,e=t.get("view"),n=t.get("type");e.off(n+":mouseenter",r.getWrapBehavior(t,"_onMouseenter")),e.off(n+":mouseleave",r.getWrapBehavior(t,"_onMouseleave"))},_setActiveShape:function(t){var e=this,n=e.get("activedOptions")||{},i=t.get("origin"),a=i.shape||e.getDefaultValue("shape");r.isArray(a)&&(a=a[0]);var o=e.get("shapeFactory"),u=r.mix({},t.attr(),{origin:i}),l=o.getActiveCfg(a,u);n.style&&r.mix(l,n.style);var c=s(l,t);t.setSilent("_originAttrs",c),n.animate?t.animate(l,300):t.attr(l),t.set("zIndex",1)},setShapesActived:function(t){var e=this;r.isArray(t)||(t=[t]);var n=e.get("activeShapes");if(o(n,t)){var i=e.get("view"),a=i.get("canvas"),s=e.get("shapeContainer"),u=e.get("activedOptions");u&&u.highlight?(r.each(t,function(t){t.get("animating")&&t.stopAnimate()}),e.highlightShapes(t)):(n&&e.clearActivedShapes(),r.each(t,function(t){t.get("animating")&&t.stopAnimate(),t.get("visible")&&!t.get("selected")&&e._setActiveShape(t)})),e.set("activeShapes",t),s.sort(),a.draw()}},clearActivedShapes:function(){var t=this,e=t.get("shapeContainer"),n=t.get("activedOptions"),i=n&&n.animate;if(e&&!e.get("destroyed")){var a=t.get("activeShapes");r.each(a,function(t){if(!t.get("selected")){var e=t.get("_originAttrs");i?(t.stopAnimate(),t.animate(e,300)):t.attr(e),t.setZIndex(0),t.set("_originAttrs",null)}});var o=t.get("preHighlightShapes");if(o){var s=e.get("children");r.each(s,function(t){if(!t.get("selected")){var e=t.get("_originAttrs");e&&(i?(t.stopAnimate(),t.animate(e,300)):t.attr(e),t.setZIndex(0),t.set("_originAttrs",null))}})}var u=e.get("children");u.sort(function(t,e){return t._INDEX-e._INDEX}),t.set("activeShapes",null),t.set("preHighlightShapes",null)}},getGroupShapesByPoint:function(t){var e=this,n=e.get("shapeContainer"),a=[];if(n){var o=e.getXScale().field,s=e.getShapes(),u=e._getOriginByPoint(t);r.each(s,function(t){var e=t.get("origin");if(t.get("visible")&&e){var n=e[i][o];n===u[o]&&a.push(t)}})}return a},getSingleShapeByPoint:function(t){var e,n=this,r=n.get("shapeContainer"),i=r.get("canvas"),a=i.get("pixelRatio");if(r&&(e=r.getShape(t.x*a,t.y*a)),e&&e.get("origin"))return e},highlightShapes:function(t,e){var n=this;r.isArray(t)||(t=[t]);var i=n.get("activeShapes");if(o(i,t)){i&&n.clearActivedShapes();var a=n.getShapes(),u=n.get("activedOptions"),l=u&&u.animate,c=u&&u.style;r.each(a,function(n){var i={};n.stopAnimate(),-1!==r.indexOf(t,n)?(r.mix(i,c,e),n.setZIndex(1)):(r.mix(i,{fillOpacity:.3,opacity:.3}),n.setZIndex(0));var a=s(i,n);n.setSilent("_originAttrs",a),l?n.animate(i,300):n.attr(i)}),n.set("preHighlightShapes",t),n.set("activeShapes",t)}}};t.exports=u},function(t,e,n){var r=n(0),i="_origin";function a(t,e){if(r.isNil(t)||r.isNil(e))return!1;var n=t.get("origin"),i=e.get("origin");return r.isEqual(n,i)}function o(t,e){var n={};return r.each(t,function(t,i){"transform"===i&&(i="matrix");var a=e.attr(i);r.isArray(a)&&(a=r.cloneDeep(a)),n[i]=a}),n}var s={_isAllowSelect:function(){var t=this.get("allowSelect");if(!r.isNil(t))return t;var e=this.get("type"),n=this.get("coord"),i=n&&n.type;return"interval"===e&&"theta"===i},_onClick:function(t){var e=this;if(e._isAllowSelect()){e.clearActivedShapes();var n=t.shape,r=e.get("shapeContainer");n&&!n.get("animating")&&r.contain(n)&&e.setShapeSelected(n)}},_bindSelectedAction:function(){var t=this,e=t.get("view"),n=t.get("type");e.on(n+":click",r.wrapBehavior(t,"_onClick"))},_offSelectedAction:function(){var t=this,e=t.get("view"),n=t.get("type");e.off(n+":click",r.getWrapBehavior(t,"_onClick"))},_setShapeStatus:function(t,e){var n=this,i=n.get("view"),a=n.get("selectedOptions")||{},s=!1!==a.animate,u=i.get("canvas");t.set("selected",e);var l=t.get("origin");if(e){var c=l.shape||n.getDefaultValue("shape");r.isArray(c)&&(c=c[0]);var h=n.get("shapeFactory"),f=r.mix({geom:n,point:l},a),p=h.getSelectedCfg(c,f);r.mix(p,f.style),t.get("_originAttrs")||(t.get("animating")&&t.stopAnimate(),t.set("_originAttrs",o(p,t))),s?t.animate(p,300):(t.attr(p),u.draw())}else{var d=t.get("_originAttrs");t.set("_originAttrs",null),s?t.animate(d,300):(t.attr(d),u.draw())}},setShapeSelected:function(t){var e=this,n=e._getSelectedShapes(),i=e.get("selectedOptions")||{},o=!1!==i.cancelable;if("multiple"===i.mode)-1===r.indexOf(n,t)?(n.push(t),e._setShapeStatus(t,!0)):o&&(r.Array.remove(n,t),e._setShapeStatus(t,!1));else{var s=n[0];o&&(t=a(s,t)?null:t),a(s,t)||(s&&e._setShapeStatus(s,!1),t&&e._setShapeStatus(t,!0))}},clearSelected:function(){var t=this,e=t.get("shapeContainer");if(e&&!e.get("destroyed")){var n=t._getSelectedShapes();r.each(n,function(e){t._setShapeStatus(e,!1),e.set("_originAttrs",null)})}},setSelected:function(t){var e=this,n=e.getShapes();return r.each(n,function(n){var r=n.get("origin");r&&r[i]===t&&e.setShapeSelected(n)}),this},_getSelectedShapes:function(){var t=this,e=t.getShapes(),n=[];return r.each(e,function(t){t.get("selected")&&n.push(t)}),t.set("selectedShapes",n),n}};t.exports=s},function(t,e,n){var r=n(0),i=n(5),a=i.defaultColor,o="_origin";function s(t){return t.alias||t.field}var u={_getIntervalSize:function(t){var e=null,n=this.get("type"),i=this.get("coord");if(i.isRect&&("interval"===n||"schema"===n)){e=this.getSize(t[o]);var a=i.isTransposed?"y":"x";if(r.isArray(t[a])){var s=Math.abs(t[a][1]-t[a][0]);e=e<s?null:e}}return e},_snapEqual:function(t,e,n){var i;return t=n.translate(t),e=n.translate(e),i=n.isCategory?t===e:r.snapEqual(t,e),i},_getScaleValueByPoint:function(t){var e=0,n=this.get("coord"),r=this.getXScale(),i=n.invert(t),a=i.x;return this.isInCircle()&&a>(1+r.rangeMax())/2&&(a=r.rangeMin()),e=r.invert(a),r.isCategory&&(e=r.translate(e)),e},_getOriginByPoint:function(t){var e=this.getXScale(),n=this.getYScale(),r=e.field,i=n.field,a=this.get("coord"),o=a.invert(t),s=e.invert(o.x),u=n.invert(o.y),l={};return l[r]=s,l[i]=u,l},_getScale:function(t){var e=this,n=e.get("scales"),i=null;return r.each(n,function(e){if(e.field===t)return i=e,!1}),i},_getTipValueScale:function(){var t,e=this.getAttrsForLegend();r.each(e,function(e){var n=e.getScale(e.type);if(n.isLinear)return t=n,!1});var n=this.getXScale(),i=this.getYScale();return!t&&i&&"..y"===i.field?n:t||i||n},_getTipTitleScale:function(t){var e=this;if(t)return e._getScale(t);var n,i=e.getAttr("position"),a=i.getFields();return r.each(a,function(t){if(-1===t.indexOf(".."))return n=t,!1}),e._getScale(n)},_filterValue:function(t,e){var n=this.get("coord"),i=this.getYScale(),a=i.field,s=n.invert(e),u=s.y;u=i.invert(u);var l=t[t.length-1];return r.each(t,function(t){var e=t[o];if(e[a][0]<=u&&e[a][1]>=u)return l=t,!1}),l},getXDistance:function(){var t=this,e=t.get("xDistance");if(!e){var n=t.getXScale();if(n.isCategory)e=1;else{var i=n.values,a=n.translate(i[0]),o=a;r.each(i,function(t){t=n.translate(t),t<a&&(a=t),t>o&&(o=t)});var s=i.length;e=(o-a)/(s-1)}t.set("xDistance",e)}return e},findPoint:function(t,e){var n=this,i=n.get("type"),a=n.getXScale(),s=n.getYScale(),u=a.field,l=s.field,c=null;if(r.indexOf(["heatmap","point"],i)>-1){var h=n.get("coord"),f=h.invert(t),p=a.invert(f.x),d=s.invert(f.y),g=1/0;return r.each(e,function(t){var e=Math.pow(t[o][u]-p,2)+Math.pow(t[o][l]-d,2);e<g&&(g=e,c=t)}),c}var v=e[0],y=e[e.length-1];if(!v)return c;var m=n._getScaleValueByPoint(t),x=v[o][u],b=v[o][l],_=y[o][u],w=s.isLinear&&r.isArray(b);if(r.isArray(x))r.each(e,function(t){var e=t[o];if(a.translate(e[u][0])<=m&&a.translate(e[u][1])>=m){if(!w)return c=t,!1;r.isArray(c)||(c=[]),c.push(t)}}),r.isArray(c)&&(c=this._filterValue(c,t));else{var M;if(a.isLinear||"timeCat"===a.type){if((m>a.translate(_)||m<a.translate(x))&&(m>a.max||m<a.min))return null;var S,C=0,k=e.length-1;while(C<=k){S=Math.floor((C+k)/2);var A=e[S][o][u];if(n._snapEqual(A,m,a))return e[S];a.translate(A)<=a.translate(m)?(C=S+1,y=e[S],M=e[S+1]):(0===k&&(y=e[0]),k=S-1)}}else r.each(e,function(t,i){var s=t[o];if(n._snapEqual(s[u],m,a)){if(!w)return c=t,!1;r.isArray(c)||(c=[]),c.push(t)}else a.translate(s[u])<=m&&(y=t,M=e[i+1])}),r.isArray(c)&&(c=this._filterValue(c,t));y&&M&&Math.abs(a.translate(y[o][u])-m)>Math.abs(a.translate(M[o][u])-m)&&(y=M)}var P=n.getXDistance();return!c&&Math.abs(a.translate(y[o][u])-m)<=P/2&&(c=y),c},getTipTitle:function(t,e){var n="",r=this._getTipTitleScale(e);if(r){var i=t[r.field];n=r.getText(i)}else if("heatmap"===this.get("type")){var a=this.getXScale(),o=this.getYScale(),s=a.getText(t[a.field]),u=o.getText(t[o.field]);n="( "+s+", "+u+" )"}return n},getTipValue:function(t,e){var n,i=e.field,a=t.key;if(n=t[i],r.isArray(n)){var o=[];r.each(n,function(t){o.push(e.getText(t))}),n=o.join("-")}else n=e.getText(n,a);return n},getTipName:function(t){var e,n,i=this._getGroupScales();if(i.length&&r.each(i,function(t){return n=t,!1}),n){var a=n.field;e=n.getText(t[a])}else{var o=this._getTipValueScale();e=s(o)}return e},getTipItems:function(t,e){var n,i,u=this,l=t[o],c=u.getTipTitle(l,e),h=u.get("tooltipCfg"),f=[];function p(e,n,i){if(!r.isNil(n)&&""!==n){var o={title:c,point:t,name:e||c,value:n,color:t.color||a,marker:!0};o.size=u._getIntervalSize(t),f.push(r.mix({},o,i))}}if(h){var d=h.fields,g=h.cfg,v=[];if(r.each(d,function(t){v.push(l[t])}),g){r.isFunction(g)&&(g=g.apply(null,v));var y=r.mix({},{point:t,title:c,color:t.color||a,marker:!0},g);y.size=u._getIntervalSize(t),f.push(y)}else r.each(d,function(t){if(!r.isNil(l[t])){var e=u._getScale(t);n=s(e),i=e.getText(l[t]),p(n,i)}})}else{var m=u._getTipValueScale();r.isNil(l[m.field])||(i=u.getTipValue(l,m),n=u.getTipName(l),p(n,i))}return f},isShareTooltip:function(){var t,e=this.get("shareTooltip"),n=this.get("type"),i=this.get("view");if(t=i.get("parent")?i.get("parent").get("options"):i.get("options"),"interval"===n){var a=this.get("coord"),o=a.type;("theta"===o||"polar"===o&&a.isTransposed)&&(e=!1)}else this.getYScale()&&!r.inArray(["contour","point","polygon","edge"],n)||(e=!1);return t.tooltip&&r.isBoolean(t.tooltip.shared)&&(e=t.tooltip.shared),e}};t.exports=u},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(8),a=n(0);n(302);var o=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return e.type="point",e.shapeType="point",e.generatePoints=!0,e},n.drawPoint=function(t,e,n,r){var i,o=this,s=t.shape,u=o.getDrawCfg(t);if(o._applyViewThemeShapeStyle(u,s,n),a.isArray(t.y)){var l=o.hasStack();a.each(t.y,function(t,a){u.y=t,u.yIndex=a,l&&0===a||(i=n.drawShape(s,u,e),o.appendShapeInfo(i,r+a))})}else a.isNil(t.y)||(i=n.drawShape(s,u,e),o.appendShapeInfo(i,r))},e}(i),s=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return e.hasDefaultAdjust=!0,e.adjusts=[{type:"jitter"}],e},e}(o),u=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return e.hasDefaultAdjust=!0,e.adjusts=[{type:"stack"}],e},e}(o);o.Jitter=s,o.Stack=u,i.Point=o,i.PointJitter=s,i.PointStack=u,t.exports=o},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(8),a=n(0);n(303);var o=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return e.type="polygon",e.shapeType="polygon",e.generatePoints=!0,e},n.createShapePointsCfg=function(e){var n,r=t.prototype.createShapePointsCfg.call(this,e),i=this,o=r.x,s=r.y;if(!a.isArray(o)||!a.isArray(s)){var u=i.getXScale(),l=i.getYScale(),c=u.values?u.values.length:u.ticks.length,h=l.values?l.values.length:l.ticks.length,f=.5/c,p=.5/h;u.isCategory&&l.isCategory?(o=[o-f,o-f,o+f,o+f],s=[s-p,s+p,s+p,s-p]):a.isArray(o)?(n=o,o=[n[0],n[0],n[1],n[1]],s=[s-p/2,s+p/2,s+p/2,s-p/2]):a.isArray(s)&&(n=s,s=[n[0],n[1],n[1],n[0]],o=[o-f/2,o-f/2,o+f/2,o+f/2]),r.x=o,r.y=s}return r},e}(i);i.Polygon=o,t.exports=o},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}function i(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}var a=n(8),o=n(0),s=n(67);n(304);var u=function(t){r(n,t);var e=n.prototype;function n(e){var n;return n=t.call(this,e)||this,o.assign(i(i(n)),s),n}return e.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return e.type="schema",e.shapeType="schema",e.generatePoints=!0,e},e.createShapePointsCfg=function(e){var n=t.prototype.createShapePointsCfg.call(this,e);return n.size=this.getNormalizedSize(e),n},n}(a),l=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return e.hasDefaultAdjust=!0,e.adjusts=[{type:"dodge"}],e},e}(u);u.Dodge=l,a.Schema=u,a.SchemaDodge=l,t.exports=u},function(t,e,n){var r=n(0),i=n(9),a=n(25),o=n(22),s=n(5);function u(t){var e=s.shape.hollowArea,n=r.mix({},e,t.style);return o.addStrokeAttrs(n,t),r.isNumber(t.size)&&(n.lineWidth=t.size),n}function l(t){var e=s.shape.area,n=r.mix({},e,t.style);return o.addFillAttrs(n,t),t.color&&(n.stroke=n.stroke||t.color),r.isNumber(t.size)&&(n.lineWidth=t.size),n}function c(t,e,n){var i=[],o=[],s=[],u=[],l=t.isInCircle;return r.each(t.points,function(t){s.push(t[1]),u.push(t[0])}),u=u.reverse(),o.push(s,u),r.each(o,function(r,o){var s=[];r=n.parsePoints(r);var u=r[0];l&&r.push({x:u.x,y:u.y}),s=e?a.getSplinePath(r,!1,t.constraint):a.getLinePath(r,!1),o>0&&(s[0][0]="L"),i=i.concat(s)}),i.push(["Z"]),i}function h(t){return{symbol:function(t,e){return[["M",t-5.5,e-4],["L",t+5.5,e-4],["L",t+5.5,e+4],["L",t-5.5,e+4],["Z"]]},radius:5,fill:t.color,fillOpacity:.6}}function f(t,e){if("line"===t||"smoothLine"===t){var n=e.lineWidth||0;return{lineWidth:n+1}}var r=e.fillOpacity||e.opacity||1;return{fillOpacity:r-.15,strokeOpacity:r-.15}}function p(t,e,n){var i=t._coord,a=i.convertPoint(e.points[0][1]);return n.addShape("circle",{attrs:r.mix({x:a.x,y:a.y,r:2,fill:e.color},e.style)})}var d=i.registerFactory("area",{defaultShapeType:"area",getDefaultPoints:function(t){var e=[],n=t.x,i=t.y,a=t.y0;return i=r.isArray(i)?i:[a,i],r.each(i,function(t){e.push({x:n,y:t})}),e},getActiveCfg:function(t,e){return f(t,e)},drawShape:function(t,e,n){var r,i=this.getShape(t);return r=1===e.points.length&&s.showSinglePoint?p(this,e,n):i.draw(e,n),r&&(r.set("origin",e.origin),r._id=e.splitedIndex?e._id+e.splitedIndex:e._id,r.name=this.name),r},getSelectedCfg:function(t,e){return e&&e.style?e.style:this.getActiveCfg(t,e)}});i.registerShape("area","area",{draw:function(t,e){var n=l(t),i=c(t,!1,this);return e.addShape("path",{attrs:r.mix(n,{path:i})})},getMarkerCfg:function(t){return h(t)}}),i.registerShape("area","smooth",{draw:function(t,e){var n=l(t),i=this._coord;t.constraint=[[i.start.x,i.end.y],[i.end.x,i.start.y]];var a=c(t,!0,this);return e.addShape("path",{attrs:r.mix(n,{path:a})})},getMarkerCfg:function(t){return h(t)}}),i.registerShape("area","line",{draw:function(t,e){var n=u(t),i=c(t,!1,this);return e.addShape("path",{attrs:r.mix(n,{path:i})})},getMarkerCfg:function(t){return h(t)}}),i.registerShape("area","smoothLine",{draw:function(t,e){var n=u(t),i=c(t,!0,this);return e.addShape("path",{attrs:r.mix(n,{path:i})})},getMarkerCfg:function(t){return h(t)}}),d.spline=d.smooth,t.exports=d},function(t,e,n){var r=n(0),i=n(9),a=n(22),o=n(5),s=n(25),u=1/3;function l(t){var e=o.shape.edge,n=r.mix({},e,t.style);return a.addStrokeAttrs(n,t),n}var c=i.registerFactory("edge",{defaultShapeType:"line",getDefaultPoints:function(t){return a.splitPoints(t)},getActiveCfg:function(t,e){var n=e.lineWidth||0;return{lineWidth:n+1}}});function h(t,e){var n=[];n.push({x:t.x,y:.5*t.y+1*e.y/2}),n.push({y:.5*t.y+1*e.y/2,x:e.x}),n.push(e);var i=["C"];return r.each(n,function(t){i.push(t.x,t.y)}),i}function f(t,e){var n=[];n.push({x:e.x,y:e.y}),n.push(t);var i=["Q"];return r.each(n,function(t){i.push(t.x,t.y)}),i}function p(t,e){var n=h(t,e),r=[["M",t.x,t.y]];return r.push(n),r}function d(t,e,n){var r=f(e,n),i=[["M",t.x,t.y]];return i.push(r),i}function g(t,e){var n=f(t[1],e),r=f(t[3],e),i=[["M",t[0].x,t[0].y]];return i.push(r),i.push(["L",t[3].x,t[3].y]),i.push(["L",t[2].x,t[2].y]),i.push(n),i.push(["L",t[1].x,t[1].y]),i.push(["L",t[0].x,t[0].y]),i.push(["Z"]),i}function v(t,e){var n=[];n.push({y:t.y*(1-u)+e.y*u,x:t.x}),n.push({y:t.y*(1-u)+e.y*u,x:e.x}),n.push(e);var i=[["M",t.x,t.y]];return r.each(n,function(t){i.push(["L",t.x,t.y])}),i}i.registerShape("edge","line",{draw:function(t,e){var n=this.parsePoints(t.points),i=l(t),a=s.getLinePath(n),o=e.addShape("path",{attrs:r.mix(i,{path:a})});return o},getMarkerCfg:function(t){return r.mix({symbol:"circle",radius:4.5},l(t))}}),i.registerShape("edge","vhv",{draw:function(t,e){var n=t.points,i=l(t),a=v(n[0],n[1]);a=this.parsePath(a);var o=e.addShape("path",{attrs:r.mix(i,{path:a})});return o},getMarkerCfg:function(t){return r.mix({symbol:"circle",radius:4.5},l(t))}}),i.registerShape("edge","smooth",{draw:function(t,e){var n=t.points,i=l(t),a=p(n[0],n[1]);a=this.parsePath(a);var o=e.addShape("path",{attrs:r.mix(i,{path:a})});return o},getMarkerCfg:function(t){return r.mix({symbol:"circle",radius:4.5},l(t))}}),i.registerShape("edge","arc",{draw:function(t,e){var n,i,a=t.points,o=a.length>2?"weight":"normal",s=l(t);if(t.isInCircle){var u={x:0,y:1};"normal"===o?i=d(a[0],a[1],u):(s.fill=s.stroke,i=g(a,u)),i=this.parsePath(i),n=e.addShape("path",{attrs:r.mix(s,{path:i})})}else if("normal"===o)a=this.parsePoints(a),n=e.addShape("arc",{attrs:r.mix(s,{x:(a[1].x+a[0].x)/2,y:a[0].y,r:Math.abs(a[1].x-a[0].x)/2,startAngle:Math.PI,endAngle:2*Math.PI})});else{i=[["M",a[0].x,a[0].y],["L",a[1].x,a[1].y]];var c=h(a[1],a[3]),f=h(a[2],a[0]);i.push(c),i.push(["L",a[3].x,a[3].y]),i.push(["L",a[2].x,a[2].y]),i.push(f),i.push(["Z"]),i=this.parsePath(i),s.fill=s.stroke,n=e.addShape("path",{attrs:r.mix(s,{path:i})})}return n},getMarkerCfg:function(t){return r.mix({symbol:"circle",radius:4.5},l(t))}}),t.exports=c},function(t,e,n){var r=n(0),i=n(9),a=n(25),o=n(22),s=n(5),u=n(23),l=r.PathUtil;function c(t,e){var n,i,a=t.x,o=t.y,s=t.y0,u=t.size,l=s,c=o;r.isArray(o)&&(c=o[1],l=o[0]),r.isArray(a)?(n=a[0],i=a[1]):(n=a-u/2,i=a+u/2);var h=[];return h.push({x:n,y:l},{x:n,y:c}),e?h.push({x:i,y:(c+l)/2}):h.push({x:i,y:c},{x:i,y:l}),h}function h(t){for(var e=[],n=0;n<t.length;n++){var r=t[n];if(r){var i=0===n?"M":"L";e.push([i,r.x,r.y])}}var a=t[0];return e.push(["L",a.x,a.y]),e.push(["z"]),e}function f(t){var e=t.x,n=t.y,i=t.y0,a=[];return r.isArray(n)?r.each(n,function(t,n){a.push({x:r.isArray(e)?e[n]:e,y:t})}):a.push({x:e,y:n},{x:e,y:i}),a}function p(t){var e=t.x,n=r.isArray(t.y)?t.y[1]:t.y,i=r.isArray(t.y)?t.y[0]:t.y0,a=t.size,o=[];return o.push({x:e-a/2,y:n},{x:e+a/2,y:n},{x:e,y:n},{x:e,y:i},{x:e-a/2,y:i},{x:e+a/2,y:i}),o}function d(t){var e=[];return e.push(["M",t[0].x,t[0].y],["L",t[1].x,t[1].y],["M",t[2].x,t[2].y],["L",t[3].x,t[3].y],["M",t[4].x,t[4].y],["L",t[5].x,t[5].y]),e}function g(t){var e=s.shape.interval,n=r.mix({},e,t.style);return o.addFillAttrs(n,t),t.color&&(n.stroke=n.stroke||t.color),n}function v(t){var e=s.shape.hollowInterval,n=r.mix({},e,t.style);return o.addStrokeAttrs(n,t),n}function y(t,e){var n=[],i=t.points,a=t.nextPoints;return r.isNil(a)?e?n.push(["M",i[0].x,i[0].y],["L",i[1].x,i[1].y],["L",i[2].x,i[2].y],["L",i[3].x,i[3].y],["Z"]):n.push(["M",i[0].x,i[0].y],["L",i[1].x,i[1].y],["L",i[2].x,i[2].y],["L",i[2].x,i[2].y],["Z"]):n.push(["M",i[0].x,i[0].y],["L",i[1].x,i[1].y],["L",a[1].x,a[1].y],["L",a[0].x,a[0].y],["Z"]),n}function m(t,e){var n,i,o,s,u=e.getRadius(),l=e.innerRadius,c=u*l;return!r.isArray(t.x)&&r.isArray(t.y)&&(t.x=[t.x,t.x]),r.isArray(t.x)?(o={x:t.x[0],y:t.y[0]},s={x:t.x[1],y:t.y[1]},n=a.getPointAngle(e,o),i=a.getPointAngle(e,s),i<=n&&(i+=2*Math.PI)):(s=t,n=e.startAngle,i=a.getPointAngle(e,s)),{r:u,ir:c,startAngle:n,endAngle:i}}function x(t,e){var n,i=e.geom,a=i.get("coord"),o=e.point,s=7.5;if(a&&"theta"===a.type){var u=m(o,a),l=(u.endAngle-u.startAngle)/2+u.startAngle,c=s*Math.cos(l),h=s*Math.sin(l);n={transform:[["t",c,h]]}}return r.mix({},n)}var b=i.registerFactory("interval",{defaultShapeType:"rect",getActiveCfg:function(t,e){if(!t||r.inArray(["rect","funnel","pyramid"],t)){var n=e.fillOpacity||e.opacity||1;return{fillOpacity:n-.15}}var i=e.lineWidth||0;return{lineWidth:i+1}},getDefaultPoints:function(t){return c(t)},getSelectedCfg:function(t,e){return x(t,e)}});function _(t,e,n,r){return 0===e?[[t+.5*n/Math.PI/2,r/2],[t+.5*n/Math.PI,r],[t+n/4,r]]:1===e?[[t+.5*n/Math.PI/2*(Math.PI-2),r],[t+.5*n/Math.PI/2*(Math.PI-1),r/2],[t+n/4,0]]:2===e?[[t+.5*n/Math.PI/2,-r/2],[t+.5*n/Math.PI,-r],[t+n/4,-r]]:[[t+.5*n/Math.PI/2*(Math.PI-2),-r],[t+.5*n/Math.PI/2*(Math.PI-1),-r/2],[t+n/4,0]]}function w(t,e,n,r,i,a,o){var s=2*Math.ceil(2*t/n*4),u=[];while(r<2*-Math.PI)r+=2*Math.PI;while(r>0)r-=2*Math.PI;r=r/Math.PI/2*n;var l=a-t+r-2*t;u.push(["M",l,e]);for(var c=0,h=0;h<s;++h){var f=h%4,p=_(h*n/4,f,n,i);u.push(["C",p[0][0]+l,-p[0][1]+e,p[1][0]+l,-p[1][1]+e,p[2][0]+l,-p[2][1]+e]),h===s-1&&(c=p[2][0])}return u.push(["L",c+l,o+t]),u.push(["L",l,o+t]),u.push(["L",l,e]),u}function M(t,e,n,r,i,a,o,u){for(var l=o.getBBox(),c=l.maxX-l.minX,h=l.maxY-l.minY,f=5e3,p=300,d=0;d<r;d++){var g=a.addShape("path",{attrs:{path:w(u,l.minY+h*n,c/4,0,c/64,t,e),fill:i[d],clip:o}});"canvas"===s.renderer&&g.animate({transform:[["t",c/2,0]],repeat:!0},f-d*p)}}i.registerShape("interval","rect",{draw:function(t,e){var n=g(t),i=h(t.points);return i=this.parsePath(i),e.addShape("path",{attrs:r.mix(n,{path:i})})},getMarkerCfg:function(t){var e=g(t),n=t.isInCircle;return r.mix({symbol:n?"circle":"square",radius:n?4.5:4},e)}}),i.registerShape("interval","hollowRect",{draw:function(t,e){var n=v(t),i=h(t.points);return i=this.parsePath(i),e.addShape("path",{attrs:r.mix(n,{path:i})})},getMarkerCfg:function(t){var e=v(t),n=t.isInCircle;return r.mix({symbol:n?"circle":"square",radius:n?4.5:4},e)}}),i.registerShape("interval","line",{getPoints:function(t){return f(t)},draw:function(t,e){var n=v(t);n.lineWidth=t.size||1;var i=h(t.points);return i=this.parsePath(i),e.addShape("path",{attrs:r.mix(n,{path:i})})},getMarkerCfg:function(t){var e=v(t);return r.mix({symbol:"line",radius:5},e)}}),i.registerShape("interval","tick",{getPoints:function(t){return p(t)},draw:function(t,e){var n=v(t);n.lineWidth||(n.lineWidth=2);var i=d(t.points);return i=this.parsePath(i),e.addShape("path",{attrs:r.mix(n,{path:i})})},getMarkerCfg:function(t){var e=v(t);return r.mix({symbol:"tick",radius:5},e)}}),i.registerShape("interval","funnel",{getPoints:function(t){return t.size=2*t.size,c(t)},draw:function(t,e){var n=g(t),i=y(t,!0);return i=this.parsePath(i),e.addShape("path",{attrs:r.mix(n,{path:i})})},getMarkerCfg:function(t){var e=g(t);return r.mix({symbol:"square",radius:4},e)}}),i.registerShape("interval","pyramid",{getPoints:function(t){return t.size=2*t.size,c(t,!0)},draw:function(t,e){var n=g(t),i=y(t,!1);return i=this.parsePath(i),e.addShape("path",{attrs:r.mix(n,{path:i})})},getMarkerCfg:function(t){var e=g(t);return r.mix({symbol:"square",radius:4},e)}}),i.registerShape("interval","liquid-fill-gauge",{draw:function(t,e){var n=this,i=.5,a=0,o=1/0;r.each(t.points,function(t){t.x<o&&(o=t.x),a+=t.x});var s=a/t.points.length,l=n.parsePoint({x:s,y:i}),c=n.parsePoint({x:o,y:.5}),h=l.x-c.x,f=Math.min(h,c.y),p=g(t),d=new u.Circle({attrs:{x:l.x,y:l.y,r:f}});return M(l.x,l.y,t.y/(2*l.y),1,[p.fill],e,d,4*f),e.addShape("circle",{attrs:r.mix(v(t),{x:l.x,y:l.y,r:f+f/8})})}});var S={};i.registerShape("interval","liquid-fill-path",{draw:function(t,e){var n=this,i=r.mix({},g(t)),a=t.shape[1],o=.5,s=0,u=1/0;r.each(t.points,function(t){t.x<u&&(u=t.x),s+=t.x});var c,h=s/t.points.length,f=n.parsePoint({x:h,y:o}),p=n.parsePoint({x:u,y:.5}),d=f.x-p.x,y=Math.min(d,p.y);if(S[a])c=S[a];else{var m=l.parsePathString(a);S[a]=c={segments:m}}var x=[];i.rotate&&(x.push(["r",i.rotate/180*Math.PI]),delete i.rotate);var b=e.addShape("path",{attrs:r.mix(i,{fillOpacity:0,path:c.segments})}),_=r.cloneDeep(b.getBBox()),w=_.maxX-_.minX,C=_.maxY-_.minY,k=Math.max(w,C),A=2*y/k;b.transform(x.concat([["s",A,A]]));var P=A*w/2,I=A*C/2;b.transform([["t",f.x-P,f.y-I]]),M(f.x,f.y,t.y/(2*f.y),1,[i.fill],e,b,4*p.y);var T=e.addShape("path",{attrs:r.mix(v(t),{path:c.segments})});return T.transform(x.concat([["s",A,A],["t",f.x-P,f.y-I]])),T}}),i.registerShape("interval","top-line",{draw:function(t,e){var n=g(t),i=t.style||{},a=[["M",t.points[1].x,t.points[1].y],["L",t.points[2].x,t.points[2].y]],o={stroke:i.stroke||"white",lineWidth:i.lineWidth||1,path:this.parsePath(a)},s=h(t.points);s=this.parsePath(s),delete n.stroke;var u=e.addShape("path",{attrs:r.mix(n,{zIndex:0,path:s})});return e.addShape("path",{zIndex:1,attrs:o}),u},getMarkerCfg:function(t){var e=g(t),n=t.isInCircle;return r.mix({symbol:n?"circle":"square",radius:n?4.5:4},e)}}),t.exports=b},function(t,e,n){var r=n(0),i=n(25),a=n(22),o=n(9),s=n(5),u=[1,1],l=[5.5,1];function c(t){var e=s.shape.line,n=r.mix({},e,t.style);return a.addStrokeAttrs(n,t),t.size&&(n.lineWidth=t.size),n}function h(t){var e=s.shape.line,n=r.mix({lineWidth:2,radius:6},e,t.style);return a.addStrokeAttrs(n,t),n}function f(t,e,n,r){for(var i=[],o=r.isStack,s=[],u=0;u<t.length;u++){var l=t[u],c=a.splitPoints(l);s.push(c[0]),i.push(c[1])}var h=p(i,e,n,r),f=p(s,e,n,r);return o?h:h.concat(f)}function p(t,e,n,r){var a;if(e){var o=r.constraint;n&&t.length&&t.push({x:t[0].x,y:t[0].y}),a=i.getSplinePath(t,!1,o)}else a=i.getLinePath(t,!1),n&&a.push(["Z"]);return a}function d(t,e){var n,i=t.points,a=t.isInCircle,o=i[0];return n=r.isArray(o.y)?f(i,e,a,t):p(i,e,a,t),n}function g(t,e){var n=[];return r.each(t,function(r,i){var a=t[i+1];n.push(r),a&&(n=n.concat(e(r,a)))}),n}function v(t){var e=[];return r.each(t,function(t,n){var r=0===n?["M",t.x,t.y]:["L",t.x,t.y];e.push(r)}),e}function y(t,e){var n=g(t.points,e);return v(n)}function m(t,e,n){return[["M",t-n,e],["L",t+n,e]]}function x(t,e,n){return[["M",t-n,e],["A",n/2,n/2,0,1,1,t,e],["A",n/2,n/2,0,1,0,t+n,e]]}function b(t,e){return r.mix({symbol:e?x:m},h(t))}function _(t,e){return r.mix({symbol:e},h(t))}function w(t,e,n){var i=e.points[0];return n.addShape("circle",{attrs:r.mix({x:i.x,y:i.y,r:2,fill:e.color},e.style)})}var M=o.registerFactory("line",{defaultShapeType:"line",getActiveCfg:function(t,e){var n=e.lineWidth||0;return{lineWidth:n+1}},getDefaultPoints:function(t){return a.splitPoints(t)},drawShape:function(t,e,n){var r,i=this.getShape(t);return r=1===e.points.length&&s.showSinglePoint?w(this,e,n):i.draw(e,n),r&&(r.set("origin",e.origin),r._id=e.splitedIndex?e._id+e.splitedIndex:e._id,r.name=this.name),r}});o.registerShape("line","line",{draw:function(t,e){var n=c(t),i=d(t,!1);return e.addShape("path",{attrs:r.mix(n,{path:i})})},getMarkerCfg:function(t){return b(t)}}),o.registerShape("line","dot",{draw:function(t,e){var n=c(t),i=d(t,!1);return e.addShape("path",{attrs:r.mix(n,{path:i,lineDash:u})})},getMarkerCfg:function(t){var e=b(t,!1);return e.lineDash=u,e}}),o.registerShape("line","dash",{draw:function(t,e){var n=c(t),i=d(t,!1);return e.addShape("path",{attrs:r.mix({path:i,lineDash:l},n)})},getMarkerCfg:function(t){var e=b(t,!1);return e.lineDash=e.lineDash||l,e}}),o.registerShape("line","smooth",{draw:function(t,e){var n=c(t),i=this._coord;t.constraint=[[i.start.x,i.end.y],[i.end.x,i.start.y]];var a=d(t,!0);return e.addShape("path",{attrs:r.mix(n,{path:a})})},getMarkerCfg:function(t){return b(t,!0)}}),o.registerShape("line","hv",{draw:function(t,e){var n=c(t),i=y(t,function(t,e){var n=[];return n.push({x:e.x,y:t.y}),n});return e.addShape("path",{attrs:r.mix(n,{path:i})})},getMarkerCfg:function(t){return _(t,function(t,e,n){return[["M",t-n-1,e-2.5],["L",t,e-2.5],["L",t,e+2.5],["L",t+n+1,e+2.5]]})}}),o.registerShape("line","vh",{draw:function(t,e){var n=c(t),i=y(t,function(t,e){var n=[];return n.push({x:t.x,y:e.y}),n});return e.addShape("path",{attrs:r.mix(n,{path:i})})},getMarkerCfg:function(t){return _(t,function(t,e,n){return[["M",t-n-1,e+2.5],["L",t,e+2.5],["L",t,e-2.5],["L",t+n+1,e-2.5]]})}}),o.registerShape("line","hvh",{draw:function(t,e){var n=c(t),i=y(t,function(t,e){var n=[],r=(e.x-t.x)/2+t.x;return n.push({x:r,y:t.y}),n.push({x:r,y:e.y}),n});return e.addShape("path",{attrs:r.mix(n,{path:i})})},getMarkerCfg:function(t){return _(t,function(t,e,n){return[["M",t-(n+1),e+2.5],["L",t-n/2,e+2.5],["L",t-n/2,e-2.5],["L",t+n/2,e-2.5],["L",t+n/2,e+2.5],["L",t+n+1,e+2.5]]})}}),o.registerShape("line","vhv",{draw:function(t,e){var n=c(t),i=y(t,function(t,e){var n=[],r=(e.y-t.y)/2+t.y;return n.push({x:t.x,y:r}),n.push({x:e.x,y:r}),n});return e.addShape("path",{attrs:r.mix(n,{path:i})})},getMarkerCfg:function(t){return _(t,function(t,e){return[["M",t-5,e+2.5],["L",t-5,e],["L",t,e],["L",t,e-3],["L",t,e+3],["L",t+6.5,e+3]]})}}),M.spline=M.smooth,t.exports=M},function(t,e,n){var r=n(0),i=n(22),a=n(5),o=n(9),s=n(23),u=s.Marker,l=r.PathUtil,c=["circle","square","bowtie","diamond","hexagon","triangle","triangle-down"],h=["cross","tick","plus","hyphen","line","pointerLine","pointerArrow"],f=Math.sqrt(3);function p(t){var e=a.shape.point,n=r.mix({},e,t.style);return i.addFillAttrs(n,t),r.isNumber(t.size)&&(n.radius=t.size),n}function d(t){var e=a.shape.hollowPoint,n=r.mix({},e,t.style);return i.addStrokeAttrs(n,t),r.isNumber(t.size)&&(n.radius=t.size),n}r.mix(u.Symbols,{hexagon:function(t,e,n){var r=n/2*f;return[["M",t,e-n],["L",t+r,e-n/2],["L",t+r,e+n/2],["L",t,e+n],["L",t-r,e+n/2],["L",t-r,e-n/2],["Z"]]},bowtie:function(t,e,n){var r=n-1.5;return[["M",t-n,e-r],["L",t+n,e+r],["L",t+n,e-r],["L",t-n,e+r],["Z"]]},cross:function(t,e,n){return[["M",t-n,e-n],["L",t+n,e+n],["M",t+n,e-n],["L",t-n,e+n]]},tick:function(t,e,n){return[["M",t-n/2,e-n],["L",t+n/2,e-n],["M",t,e-n],["L",t,e+n],["M",t-n/2,e+n],["L",t+n/2,e+n]]},plus:function(t,e,n){return[["M",t-n,e],["L",t+n,e],["M",t,e-n],["L",t,e+n]]},hyphen:function(t,e,n){return[["M",t-n,e],["L",t+n,e]]},line:function(t,e,n){return[["M",t,e-n],["L",t,e+n]]}});var g=o.registerFactory("point",{defaultShapeType:"hollowCircle",getActiveCfg:function(t,e){var n,i=e.radius;return n=t&&(0===t.indexOf("hollow")||-1!==r.indexOf(h,t))||!t?e.stroke||e.strokeStyle:e.fill||e.fillStyle,{radius:i+1,shadowBlur:i,shadowColor:n,stroke:n,strokeOpacity:1,lineWidth:1}},getDefaultPoints:function(t){return i.splitPoints(t)}});function v(t){var e=t.points[0].x,n=t.points[0].y,r=t.size[0],i=t.size[1],a=[["M",e-.5*r,n-.5*i],["L",e+.5*r,n-.5*i],["L",e+.5*r,n+.5*i],["L",e-.5*r,n+.5*i],["z"]];return a}o.registerShape("point","rect",{draw:function(t,e){var n=p(t),i=v(t);i=this.parsePath(i);var a=e.addShape("path",{attrs:r.mix(n,{path:i})});return a},getMarkerCfg:function(t){var e=p(t);return e.symbol="rect",e.radius=4.5,e}}),r.each(c,function(t){o.registerShape("point",t,{draw:function(e,n){var i=p(e);return n.addShape("Marker",{attrs:r.mix(i,{symbol:t,x:e.x,y:e.y})})},getMarkerCfg:function(e){var n=p(e);return n.symbol=t,n.radius=4.5,n}}),o.registerShape("point","hollow"+r.upperFirst(t),{draw:function(e,n){var i=d(e);return n.addShape("Marker",{attrs:r.mix(i,{symbol:t,x:e.x,y:e.y})})},getMarkerCfg:function(e){var n=d(e);return n.symbol=t,n.radius=4.5,n}})}),r.each(h,function(t){o.registerShape("point",t,{draw:function(e,n){var i=d(e);return n.addShape("Marker",{attrs:r.mix(i,{symbol:t,x:e.x,y:e.y})})},getMarkerCfg:function(e){var n=d(e);return n.symbol=t,n.radius=4.5,n}})}),o.registerShape("point","image",{draw:function(t,e){return t.points=this.parsePoints(t.points),e.addShape("image",{attrs:{x:t.points[0].x-t.size/2,y:t.points[0].y-t.size,width:t.size,height:t.size,img:t.shape[1]}})}});var y={};o.registerShape("point","path",{draw:function(t,e){var n,i=r.mix({},d(t),p(t)),a=t.shape[1],o=t.size||10;if(y[a])n=y[a];else{var s=l.parsePathString(a),u=r.flatten(s).filter(function(t){return r.isNumber(t)});y[a]=n={range:Math.max.apply(null,u)-Math.min.apply(null,u),segments:s}}var c=o/n.range,h=[];i.rotate&&(h.push(["r",i.rotate/180*Math.PI]),delete i.rotate);var f=e.addShape("path",{attrs:r.mix(i,{path:n.segments})});return h.push(["s",c,c],["t",t.x,t.y]),f.transform(h),f}}),t.exports=g},function(t,e,n){var r=n(0),i=n(9),a=n(22),o=n(5);function s(t){var e=o.shape.polygon,n=r.mix({},e,t.style);return a.addFillAttrs(n,t),n}function u(t){var e=o.shape.hollowPolygon,n=r.mix({},e,t.style);return a.addStrokeAttrs(n,t),n}function l(t){var e=t[0],n=1,i=[["M",e.x,e.y]];while(n<t.length){var a=t[n];a.x===t[n-1].x&&a.y===t[n-1].y||(i.push(["L",a.x,a.y]),a.x===e.x&&a.y===e.y&&n<t.length-1&&(e=t[n+1],i.push(["Z"]),i.push(["M",e.x,e.y]),n++)),n++}return r.isEqual(i[i.length-1],e)||i.push(["L",e.x,e.y]),i.push(["Z"]),i}var c=i.registerFactory("polygon",{defaultShapeType:"polygon",getDefaultPoints:function(t){var e=[];return r.each(t.x,function(n,r){var i=t.y[r];e.push({x:n,y:i})}),e},getActiveCfg:function(t,e){var n=e.lineWidth||1;if("hollow"===t)return{lineWidth:n+1};var r=e.fillOpacity||e.opacity||1;return{fillOpacity:r-.08}},getSelectedCfg:function(t,e){return e&&e.style?e.style:this.getActiveCfg(t,e)}});i.registerShape("polygon","polygon",{draw:function(t,e){if(!r.isEmpty(t.points)){var n=s(t),i=l(t.points);return i=this.parsePath(i),e.addShape("path",{attrs:r.mix(n,{path:i})})}},getMarkerCfg:function(t){return r.mix({symbol:"square",radius:4},s(t))}}),i.registerShape("polygon","hollow",{draw:function(t,e){if(!r.isEmpty(t.points)){var n=u(t),i=l(t.points);return i=this.parsePath(i),e.addShape("path",{attrs:r.mix(n,{path:i})})}},getMarkerCfg:function(t){return r.mix({symbol:"square",radius:4},s(t))}}),t.exports=c},function(t,e,n){var r=n(0),i=n(9),a=n(22),o=n(5);function s(t){r.isArray(t)||(t=[t]);var e=t[0],n=t[t.length-1],i=t.length>1?t[1]:e,a=t.length>3?t[3]:n,o=t.length>2?t[2]:i;return{min:e,max:n,min1:i,max1:a,median:o}}function u(t,e){r.each(t,function(t){e.push({x:t[0],y:t[1]})})}function l(t){var e=o.shape.schema,n=r.mix({},e,t.style);return a.addStrokeAttrs(n,t),n}function c(t){var e=o.shape.schema,n=r.mix({},e,t.style);return a.addFillAttrs(n,t),t.color&&(n.stroke=t.color||n.stroke),n}function h(t,e,n){var i,a,o=[];return r.isArray(e)?(a=s(e),i=[[t-n/2,a.max],[t+n/2,a.max],[t,a.max],[t,a.max1],[t-n/2,a.min1],[t-n/2,a.max1],[t+n/2,a.max1],[t+n/2,a.min1],[t,a.min1],[t,a.min],[t-n/2,a.min],[t+n/2,a.min],[t-n/2,a.median],[t+n/2,a.median]]):(e=e||.5,a=s(t),i=[[a.min,e-n/2],[a.min,e+n/2],[a.min,e],[a.min1,e],[a.min1,e-n/2],[a.min1,e+n/2],[a.max1,e+n/2],[a.max1,e-n/2],[a.max1,e],[a.max,e],[a.max,e-n/2],[a.max,e+n/2],[a.median,e-n/2],[a.median,e+n/2]]),u(i,o),o}function f(t){r.isArray(t)||(t=[t]);var e=t.sort(function(t,e){return t<e?1:-1}),n=e.length;if(n<4)for(var i=e[n-1],a=0;a<4-n;a++)e.push(i);return e}function p(t,e,n){var r=f(e),i=[{x:t,y:r[0]},{x:t,y:r[1]},{x:t-n/2,y:r[2]},{x:t-n/2,y:r[1]},{x:t+n/2,y:r[1]},{x:t+n/2,y:r[2]},{x:t,y:r[2]},{x:t,y:r[3]}];return i}function d(t){var e=[["M",t[0].x,t[0].y],["L",t[1].x,t[1].y],["M",t[2].x,t[2].y],["L",t[3].x,t[3].y],["M",t[4].x,t[4].y],["L",t[5].x,t[5].y],["L",t[6].x,t[6].y],["L",t[7].x,t[7].y],["L",t[4].x,t[4].y],["Z"],["M",t[8].x,t[8].y],["L",t[9].x,t[9].y],["M",t[10].x,t[10].y],["L",t[11].x,t[11].y],["M",t[12].x,t[12].y],["L",t[13].x,t[13].y]];return e}function g(t){var e=[["M",t[0].x,t[0].y],["L",t[1].x,t[1].y],["M",t[2].x,t[2].y],["L",t[3].x,t[3].y],["L",t[4].x,t[4].y],["L",t[5].x,t[5].y],["Z"],["M",t[6].x,t[6].y],["L",t[7].x,t[7].y]];return e}var v=i.registerFactory("schema",{defaultShapeType:"",getActiveCfg:function(t,e){if("box"===t){var n=e.lineWidth||1;return{lineWidth:n+1}}var r=e.fillOpacity||e.opacity||1;return{fillOpacity:r-.15,strokeOpacity:r-.15}},getSelectedCfg:function(t,e){return e&&e.style?e.style:this.getActiveCfg(t,e)}});i.registerShape("schema","box",{getPoints:function(t){return h(t.x,t.y,t.size)},draw:function(t,e){var n=l(t),i=d(t.points);return i=this.parsePath(i),e.addShape("path",{attrs:r.mix(n,{path:i})})},getMarkerCfg:function(t){return{symbol:function(t,e,n){var r=[e-6,e-3,e,e+3,e+6],i=h(t,r,n);return[["M",i[0].x+1,i[0].y],["L",i[1].x-1,i[1].y],["M",i[2].x,i[2].y],["L",i[3].x,i[3].y],["M",i[4].x,i[4].y],["L",i[5].x,i[5].y],["L",i[6].x,i[6].y],["L",i[7].x,i[7].y],["L",i[4].x,i[4].y],["Z"],["M",i[8].x,i[8].y],["L",i[9].x,i[9].y],["M",i[10].x+1,i[10].y],["L",i[11].x-1,i[11].y],["M",i[12].x,i[12].y],["L",i[13].x,i[13].y]]},radius:6,lineWidth:1,stroke:t.color}}}),i.registerShape("schema","candle",{getPoints:function(t){return p(t.x,t.y,t.size)},draw:function(t,e){var n=c(t),i=g(t.points);return i=this.parsePath(i),e.addShape("path",{attrs:r.mix(n,{path:i})})},getMarkerCfg:function(t){return{symbol:function(t,e,n){e=[e+7.5,e+3,e-3,e-7.5];var r=p(t,e,n);return[["M",r[0].x,r[0].y],["L",r[1].x,r[1].y],["M",r[2].x,r[2].y],["L",r[3].x,r[3].y],["L",r[4].x,r[4].y],["L",r[5].x,r[5].y],["Z"],["M",r[6].x,r[6].y],["L",r[7].x,r[7].y]]},lineWidth:1,stroke:t.color,fill:t.color,radius:6}}}),t.exports=v},function(t,e,n){var r=n(0),i=n(9),a=n(22),o=n(5),s=r.PathUtil;function u(t){var e=o.shape.venn,n=r.mix({},e,t.style);return a.addFillAttrs(n,t),n}function l(t){var e=o.shape.hollowVenn,n=r.mix({},e,t.style);return a.addStrokeAttrs(n,t),n}var c=i.registerFactory("venn",{defaultShapeType:"venn",getActiveCfg:function(t,e){var n=e.lineWidth||1;if("hollow"===t)return{lineWidth:n+1};var r=e.fillOpacity||e.opacity||1;return{fillOpacity:r-.08}},getSelectedCfg:function(t,e){return e&&e.style?e.style:this.getActiveCfg(t,e)}});i.registerShape("venn","venn",{draw:function(t,e){var n=t.origin._origin,i=n.path,a=u(t),o=s.parsePathString(i),l=e.addShape("path",{attrs:r.mix(a,{path:o})});return l},getMarkerCfg:function(t){return r.mix({symbol:"circle",radius:4},u(t))}}),i.registerShape("venn","hollow",{draw:function(t,e){var n=t.origin._origin,i=n.path,a=l(t),o=s.parsePathString(i),u=e.addShape("path",{attrs:r.mix(a,{path:o})});return u},getMarkerCfg:function(t){return r.mix({symbol:"circle",radius:4},u(t))}}),t.exports=c},function(t,e,n){var r=n(0),i=n(9),a=n(22),o=n(5),s=n(25);function u(t){var e=o.shape.venn,n=r.mix({},e,t.style);return a.addFillAttrs(n,t),t.color&&(n.stroke=n.stroke||t.color),n}function l(t){var e=o.shape.hollowVenn,n=r.mix({},e,t.style);return a.addStrokeAttrs(n,t),n}function c(t){for(var e=[],n=0;n<t.length;n++){var r=t[n];if(r){var i=0===n?"M":"L";e.push([i,r.x,r.y])}}var a=t[0];return a&&(e.push(["L",a.x,a.y]),e.push(["z"])),e}function h(t){for(var e=t.length/2,n=[],r=[],i=0;i<t.length;i++)i<e?n.push(t[i]):r.push(t[i]);var a=s.getSplinePath(n,!1),o=s.getSplinePath(r,!1);r.length&&a.push(["L",r[0].x,r[0].y]),o.shift();var u=a.concat(o);return n.length&&u.push(["L",n[0].x,n[0].y]),u.push(["z"]),u}function f(t){var e=Math.max.apply(null,t);return t.map(function(t){return t/e})}var p=i.registerFactory("violin",{defaultShapeType:"violin",getDefaultPoints:function(t){var e=t.size/2,n=[],i=f(t._size);return r.each(t.y,function(r,a){var o=i[a]*e,s=0===a,u=a===t.y.length-1;n.push({isMin:s,isMax:u,x:t.x-o,y:r}),n.unshift({isMin:s,isMax:u,x:t.x+o,y:r})}),n},getActiveCfg:function(t,e){var n=e.lineWidth||1;if("hollow"===t)return{lineWidth:n+1};var r=e.fillOpacity||e.opacity||1;return{fillOpacity:r-.08}},getSelectedCfg:function(t,e){return e&&e.style?e.style:this.getActiveCfg(t,e)}});i.registerShape("violin","violin",{draw:function(t,e){var n=u(t),i=c(t.points);i=this.parsePath(i);var a=e.addShape("path",{attrs:r.mix(n,{path:i})});return a},getMarkerCfg:function(t){return r.mix({symbol:"circle",radius:4},u(t))}}),i.registerShape("violin","smooth",{draw:function(t,e){var n=u(t),i=h(t.points);i=this.parsePath(i);var a=e.addShape("path",{attrs:r.mix(n,{path:i})});return a},getMarkerCfg:function(t){return r.mix({symbol:"circle",radius:4},u(t))}}),i.registerShape("violin","hollow",{draw:function(t,e){var n=l(t),i=c(t.points);i=this.parsePath(i);var a=e.addShape("path",{attrs:r.mix(n,{path:i})});return a},getMarkerCfg:function(t){return r.mix({symbol:"circle",radius:4},l(t))}}),i.registerShape("violin","smoothHollow",{draw:function(t,e){var n=l(t),i=h(t.points);i=this.parsePath(i);var a=e.addShape("path",{attrs:r.mix(n,{path:i})});return a},getMarkerCfg:function(t){return r.mix({symbol:"circle",radius:4},l(t))}}),t.exports=p},function(t,e,n){var r=n(0);t.exports=function(t){return r.isArray(t)?t:r.isString(t)?t.split("*"):[t]}},function(t,e,n){var r=n(0).MatrixUtil,i=r.vec2;function a(t,e,n,r){var a,o,s,u,l=[],c=!!r;if(c){s=[1/0,1/0],u=[-1/0,-1/0];for(var h=0,f=t.length;h<f;h++){var p=t[h];s=i.min([],s,p),u=i.max([],u,p)}s=i.min([],s,r[0]),u=i.max([],u,r[1])}for(var d=0,g=t.length;d<g;d++){var v=t[d];if(n)a=t[d?d-1:g-1],o=t[(d+1)%g];else{if(0===d||d===g-1){l.push(v);continue}a=t[d-1],o=t[d+1]}var y=[];y=i.sub(y,o,a),y=i.scale(y,y,e);var m=i.distance(v,a),x=i.distance(v,o),b=m+x;0!==b&&(m/=b,x/=b);var _=i.scale([],y,-m),w=i.scale([],y,x),M=i.add([],v,_),S=i.add([],v,w);c&&(M=i.max([],M,s),M=i.min([],M,u),S=i.max([],S,s),S=i.min([],S,u)),l.push(M),l.push(S)}return n&&l.push(l.shift()),l}function o(t,e,n){for(var r=!!e,i=[],o=0,s=t.length;o<s;o+=2)i.push([t[o],t[o+1]]);for(var u,l,c,h=a(i,.4,r,n),f=i.length,p=[],d=0;d<f-1;d++)u=h[2*d],l=h[2*d+1],c=i[d+1],p.push(["C",u[0],u[1],l[0],l[1],c[0],c[1]]);return r&&(u=h[f],l=h[f+1],c=i[0],p.push(["C",u[0],u[1],l[0],l[1],c[0],c[1]])),p}t.exports={catmullRom2bezier:o}},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(8),a=n(0),o=n(526),s=o.venn,u=o.scaleSolution,l=o.circlePath,c=o.intersectionAreaPath,h=o.computeTextCentres;n(305);var f=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return e.type="venn",e.shapeType="venn",e.generatePoints=!1,e},n._getAttrValues=function(e,n){return"position"===e.type?[n.x,n.y]:t.prototype._getAttrValues.call(this,e,n)},n.sets=function(t){return this.set("setsField",t),this},n._initAttrs=function(){var e=this;t.prototype._initAttrs.call(this);var n=e.get("attrOptions"),r=e.get("setsField")||"sets",i=e.get("data"),o=n.size?n.size.field:"size";i.forEach(function(t){t.sets=t[r],t._sets=t[r].join("&"),t.size=t[o]});var f=s(i),p=e.get("coord"),d=[Math.min(p.x.end,p.x.start),Math.max(p.x.end,p.x.start)],g=[Math.min(p.y.end,p.y.start),Math.max(p.y.end,p.y.start)],v=d[1]-d[0],y=g[1]-g[0],m=e.get("styleOptions"),x=m&&a.isObject(m.style)?m.style.padding:0;a.isFinite(x)||(x=0);var b=u(f,v,y,x),_=h(b,i);i.forEach(function(t){var e=t.sets,n=e.join(",");if(t.id=n,1===e.length){var r=b[n];t.path=l(r.x,r.y,r.radius),a.assign(t,r)}else{var i=e.map(function(t){return b[t]}),o=c(i);/[zZ]$/.test(o)||(o+="Z"),t.path=o;var s=_[n]||{x:0,y:0};a.assign(t,s)}})},e}(i);i.Venn=f,t.exports=f},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}function i(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}var a=n(8),o=n(0),s=n(67);n(306);var u=function(t){r(n,t);var e=n.prototype;function n(e){var n;return n=t.call(this,e)||this,o.assign(i(i(n)),s),n}return e.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return e.type="violin",e.shapeType="violin",e.generatePoints=!0,e},e.createShapePointsCfg=function(e){var n=this,r=t.prototype.createShapePointsCfg.call(this,e);r.size=n.getNormalizedSize(e);var i=n.get("_sizeField");return r._size=e._origin[i],r},e.clearInner=function(){t.prototype.clearInner.call(this),this.set("defaultSize",null)},e._initAttrs=function(){var e=this,n=e.get("attrOptions"),r=n.size?n.size.field:e.get("_sizeField")?e.get("_sizeField"):"size";e.set("_sizeField",r),delete n.size,t.prototype._initAttrs.call(this)},n}(a),l=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return e.hasDefaultAdjust=!0,e.adjusts=[{type:"dodge"}],e},e}(u);u.Dodge=l,a.Violin=u,a.ViolinDodge=l,t.exports=u},function(t,e,n){var r,i,a=n(0),o=n(124),s="g2-tooltip",u="g2-legend",l=a.deepMix({},o,{background:{fill:"#1F1F1F",radius:2},plotBackground:{fill:"#1F1F1F"},axis:{top:{label:{textStyle:{fill:"#A6A6A6"}},line:{stroke:"#737373"},tickLine:{stroke:"#737373"}},bottom:{label:{textStyle:{fill:"#A6A6A6"}},line:{stroke:"#737373"},tickLine:{stroke:"#737373"}},left:{label:{textStyle:{fill:"#A6A6A6"}},grid:{lineStyle:{stroke:"#404040"}}},right:{label:{textStyle:{fill:"#A6A6A6"}},grid:{lineStyle:{stroke:"#404040"}}},circle:{label:{textStyle:{fill:"#A6A6A6"}},line:{stroke:"#737373"},tickLine:{stroke:"#737373"},grid:{lineStyle:{stroke:"#404040"}}},radius:{label:{textStyle:{fill:"#A6A6A6"}},line:{stroke:"#737373"},tickLine:{stroke:"#737373"},grid:{lineStyle:{stroke:"#404040"}}},helix:{line:{stroke:"#737373"},tickLine:{stroke:"#737373"}}},label:{textStyle:{fill:"#A6A6A6"}},legend:{right:{textStyle:{fill:"#737373"},unCheckColor:"#bfbfbf"},left:{textStyle:{fill:"#737373"},unCheckColor:"#bfbfbf"},top:{textStyle:{fill:"#737373"},unCheckColor:"#bfbfbf"},bottom:{textStyle:{fill:"#737373"},unCheckColor:"#bfbfbf"},html:(r={},r[""+u]={color:"#D9D9D9"},r),gradient:{textStyle:{fill:"#D9D9D9"},lineStyle:{stroke:"#404040"}}},tooltip:(i={},i[""+s]={color:"#D9D9D9",backgroundColor:"rgba(0, 0, 0, 0.5)",boxShadow:"0px 0px 2px #000"},i),tooltipCrosshairsRect:{type:"rect",rectStyle:{fill:"#fff",opacity:.1}},tooltipCrosshairsLine:{lineStyle:{stroke:"rgba(255, 255, 255, 0.45)"}},guide:{line:{text:{style:{fill:"#A6A6A6"}}},text:{style:{fill:"#A6A6A6"}},region:{style:{lineWidth:0,fill:"#000",fillOpacity:.04}}}});t.exports=l},function(t,e,n){var r=n(1),i=n(128),a=n(127),o=n(316),s=n(321),u=function t(e){t.superclass.constructor.call(this,e)};u.CFG={eventEnable:!0,width:null,height:null,widthCanvas:null,heightCanvas:null,widthStyle:null,heightStyle:null,containerDOM:null,canvasDOM:null,pixelRatio:null,renderer:"canvas"},r.extend(u,a),r.augment(u,{init:function(){u.superclass.init.call(this),this._setGlobalParam(),this._setContainer(),this._initPainter(),this._scale(),this.get("eventEnable")&&this._registEvents()},getEmitter:function(t,e){if(t){if(!r.isEmpty(t._getEvents()))return t;var n=t.get("parent");if(n&&!e.propagationStopped)return this.getEmitter(n,e)}},_getEventObj:function(t,e,n,r){var a=new i(t,e,!0,!0);return a.x=n.x,a.y=n.y,a.clientX=e.clientX,a.clientY=e.clientY,a.currentTarget=r,a.target=r,a},_triggerEvent:function(t,e){var n,r=this.getPointByClient(e.clientX,e.clientY),i=this.getShape(r.x,r.y,e),a=this.get("el");if("mousemove"===t){var o=this.get("preShape");if(o&&o!==i){var s=this._getEventObj("mouseleave",e,r,o);n=this.getEmitter(o,e),n&&n.emit("mouseleave",s),a.style.cursor="default"}if(i){var u=this._getEventObj("mousemove",e,r,i);if(n=this.getEmitter(i,e),n&&n.emit("mousemove",u),o!==i){var l=this._getEventObj("mouseenter",e,r,i);n&&n.emit("mouseenter",l,e)}}else{var c=this._getEventObj("mousemove",e,r,this);this.emit("mousemove",c)}this.set("preShape",i)}else{var h=this._getEventObj(t,e,r,i||this);n=this.getEmitter(i,e),n&&n!==this&&n.emit(t,h),this.emit(t,h)}i&&!i.get("destroyed")&&(a.style.cursor=i.attr("cursor")||"default")},_registEvents:function(){var t=this,e=t.get("el"),n=["mouseout","mouseover","mousemove","mousedown","mouseleave","mouseup","click","dblclick"];r.each(n,function(n){e.addEventListener(n,function(e){t._triggerEvent(n,e)},!1)}),e.addEventListener("touchstart",function(e){r.isEmpty(e.touches)||t._triggerEvent("touchstart",e.touches[0])},!1),e.addEventListener("touchmove",function(e){r.isEmpty(e.touches)||t._triggerEvent("touchmove",e.touches[0])},!1),e.addEventListener("touchend",function(e){r.isEmpty(e.changedTouches)||t._triggerEvent("touchend",e.changedTouches[0])},!1)},_scale:function(){var t=this.get("pixelRatio");this.scale(t,t)},_setGlobalParam:function(){var t=this.get("pixelRatio");t||this.set("pixelRatio",r.getRatio());var e=s[this.get("renderer")||"canvas"];this._cfg.renderer=e,this._cfg.canvas=this;var n=new o(this);this._cfg.timeline=n},_setContainer:function(){var t=this.get("containerId"),e=this.get("containerDOM");e||(e=document.getElementById(t),this.set("containerDOM",e)),r.modifyCSS(e,{position:"relative"})},_initPainter:function(){var t=this.get("containerDOM"),e=new this._cfg.renderer.painter(t);this._cfg.painter=e,this._cfg.canvasDOM=this._cfg.el=e.canvas,this.changeSize(this.get("width"),this.get("height"))},_resize:function(){var t=this.get("canvasDOM"),e=this.get("widthCanvas"),n=this.get("heightCanvas"),r=this.get("widthStyle"),i=this.get("heightStyle");t.style.width=r,t.style.height=i,t.setAttribute("width",e),t.setAttribute("height",n)},getWidth:function(){var t=this.get("pixelRatio"),e=this.get("width");return e*t},getHeight:function(){var t=this.get("pixelRatio"),e=this.get("height");return e*t},changeSize:function(t,e){var n=this.get("pixelRatio"),r=t*n,i=e*n;this.set("widthCanvas",r),this.set("heightCanvas",i),this.set("widthStyle",t+"px"),this.set("heightStyle",e+"px"),this.set("width",t),this.set("height",e),this._resize()},getPointByClient:function(t,e){var n=this.get("el"),r=this.get("pixelRatio")||1,i=n.getBoundingClientRect();return{x:(t-i.left)*r,y:(e-i.top)*r}},getClientByPoint:function(t,e){var n=this.get("el"),r=n.getBoundingClientRect(),i=this.get("pixelRatio")||1;return{clientX:t/i+r.left,clientY:e/i+r.top}},draw:function(){this._cfg.painter.draw(this)},getShape:function(t,e,n){return 3===arguments.length&&this._cfg.renderer.getShape?this._cfg.renderer.getShape.call(this,t,e,n):u.superclass.getShape.call(this,t,e)},_drawSync:function(){this._cfg.painter.drawSync(this)},destroy:function(){var t=this._cfg,e=t.containerDOM,n=t.canvasDOM;n&&e&&e.removeChild(n),t.timeline.stop(),u.superclass.destroy.call(this)}}),t.exports=u},function(t,e,n){var r=n(1),i={delay:"delay",rotate:"rotate"},a={fill:"fill",stroke:"stroke",fillStyle:"fillStyle",strokeStyle:"strokeStyle"};function o(t,e){var n={},r=e._attrs;for(var i in t.attrs)n[i]=r[i];return n}function s(t,e){var n={matrix:null,attrs:{}},o=e._attrs;for(var s in t)if("transform"===s)n.matrix=r.transform(e.getMatrix(),t[s]);else if("rotate"===s)n.matrix=r.transform(e.getMatrix(),[["r",t[s]]]);else if("matrix"===s)n.matrix=t[s];else{if(a[s]&&/^[r,R,L,l]{1}[\s]*\(/.test(t[s]))continue;i[s]||o[s]===t[s]||(n.attrs[s]=t[s])}return n}function u(t,e){var n=e.delay,i=Object.prototype.hasOwnProperty;return r.each(e.toAttrs,function(e,a){r.each(t,function(t){n<t.startTime+t.duration&&i.call(t.toAttrs,a)&&(delete t.toAttrs[a],delete t.fromAttrs[a])})}),e.toMatrix&&r.each(t,function(t){n<t.startTime+t.duration&&t.toMatrix&&delete t.toMatrix}),t}t.exports={animate:function(t,e,n,i,a){void 0===a&&(a=0);var l=this;l.set("animating",!0);var c=l.get("timeline");c||(c=l.get("canvas").get("timeline"),l.setSilent("timeline",c));var h=l.get("animators")||[];c._timer||c.initTimer(),r.isNumber(i)&&(a=i,i=null),r.isFunction(n)?(i=n,n="easeLinear"):n=n||"easeLinear";var f=s(t,l),p={fromAttrs:o(f,l),toAttrs:f.attrs,fromMatrix:r.clone(l.getMatrix()),toMatrix:f.matrix,duration:e,easing:n,callback:i,delay:a,startTime:c.getTime(),id:r.uniqueId()};h.length>0?h=u(h,p):c.addAnimator(l),h.push(p),l.setSilent("animators",h),l.setSilent("pause",{isPaused:!1})},stopAnimate:function(){var t=this,e=this.get("animators");r.each(e,function(e){t.attr(e.toAttrs),e.toMatrix&&t.attr("matrix",e.toMatrix),e.callback&&e.callback()}),this.setSilent("animating",!1),this.setSilent("animators",[])},pauseAnimate:function(){var t=this,e=t.get("timeline");return t.setSilent("pause",{isPaused:!0,pauseTime:e.getTime()}),t},resumeAnimate:function(){var t=this,e=t.get("timeline"),n=e.getTime(),i=t.get("animators"),a=t.get("pause").pauseTime;return r.each(i,function(t){t.startTime=t.startTime+(n-a),t._paused=!1,t._pauseTime=null}),t.setSilent("pause",{isPaused:!1}),t.setSilent("animators",i),t}}},function(t,e,n){var r=n(1);t.exports={canFill:!1,canStroke:!1,initAttrs:function(t){return this._attrs={opacity:1,fillOpacity:1,strokeOpacity:1,matrix:[1,0,0,0,1,0,0,0,1]},this.attr(r.assign(this.getDefaultAttrs(),t)),this},getDefaultAttrs:function(){return{}},attr:function(t,e){var n=this;if(0===arguments.length)return n._attrs;if(r.isObject(t)){for(var i in t)this._setAttr(i,t[i]);return n.clearBBox(),this._cfg.hasUpdate=!0,n}return 2===arguments.length?(this._setAttr(t,e),n.clearBBox(),this._cfg.hasUpdate=!0,n):n._attrs[t]},_setAttr:function(t,e){var n=this,r=this._attrs;r[t]=e,"fill"!==t&&"stroke"!==t?"opacity"!==t?"clip"===t&&e?n._setClip(e):"path"===t&&n._afterSetAttrPath?n._afterSetAttrPath(e):"transform"!==t?"rotate"===t&&n.rotateAtStart(e):n.transform(e):r.globalAlpha=e:r[t+"Style"]=e},clearBBox:function(){this.setSilent("box",null)},hasFill:function(){return this.canFill&&this._attrs.fillStyle},hasStroke:function(){return this.canStroke&&this._attrs.strokeStyle},_setClip:function(t){t._cfg.renderer=this._cfg.renderer,t._cfg.canvas=this._cfg.canvas,t._cfg.parent=this._cfg.parent,t.hasFill=function(){return!0}}}},function(t,e,n){var r=n(1),i=n(70),a={arc:n(44),ellipse:n(136),line:n(45)},o=r.createDom('<canvas width="500" height="500"></canvas>'),s=o.getContext("2d");function u(t,e,n){return n.createPath(s),s.isPointInPath(t,e)}var l=function(t,e){var n=this._attrs,r=n.x,a=n.y,o=n.r,s=n.startAngle,u=n.endAngle,l=n.clockwise,c=this.getHitLineWidth();return!!this.hasStroke()&&i.arcline(r,a,o,s,u,l,c,t,e)},c=function(t,e){var n=this._attrs,r=n.x,a=n.y,o=n.r,s=this.getHitLineWidth(),u=this.hasFill(),l=this.hasStroke();return u&&l?i.circle(r,a,o,t,e)||i.arcline(r,a,o,0,2*Math.PI,!1,s,t,e):u?i.circle(r,a,o,t,e):!!l&&i.arcline(r,a,o,0,2*Math.PI,!1,s,t,e)},h=function(t,e){var n=this._attrs,a=this.hasFill(),o=this.hasStroke(),s=n.x,u=n.y,l=n.rx,c=n.ry,h=this.getHitLineWidth(),f=l>c?l:c,p=l>c?1:l/c,d=l>c?c/l:1,g=[t,e,1],v=[1,0,0,0,1,0,0,0,1];r.mat3.scale(v,v,[p,d]),r.mat3.translate(v,v,[s,u]);var y=r.mat3.invert([],v);return r.vec3.transformMat3(g,g,y),a&&o?i.circle(0,0,f,g[0],g[1])||i.arcline(0,0,f,0,2*Math.PI,!1,h,g[0],g[1]):a?i.circle(0,0,f,g[0],g[1]):!!o&&i.arcline(0,0,f,0,2*Math.PI,!1,h,g[0],g[1])},f=function(t,e){var n=this,o=n.hasFill(),s=n.hasStroke(),u=n._attrs,l=u.x,c=u.y,h=u.rs,f=u.re,p=u.startAngle,d=u.endAngle,g=u.clockwise,v=[1,0],y=[t-l,e-c],m=r.vec2.angleTo(v,y);function x(){var t=a.arc.nearAngle(m,p,d,g);if(r.isNumberEqual(m,t)){var e=r.vec2.squaredLength(y);if(h*h<=e&&e<=f*f)return!0}return!1}function b(){var r=n.getHitLineWidth(),a={x:Math.cos(p)*h+l,y:Math.sin(p)*h+c},o={x:Math.cos(p)*f+l,y:Math.sin(p)*f+c},s={x:Math.cos(d)*h+l,y:Math.sin(d)*h+c},u={x:Math.cos(d)*f+l,y:Math.sin(d)*f+c};return!!i.line(a.x,a.y,o.x,o.y,r,t,e)||(!!i.line(s.x,s.y,u.x,u.y,r,t,e)||(!!i.arcline(l,c,h,p,d,g,r,t,e)||!!i.arcline(l,c,f,p,d,g,r,t,e)))}return o&&s?x()||b():o?x():!!s&&b()},p=function(t,e){var n=this._attrs;if(this.get("toDraw")||!n.img)return!1;this._cfg.attrs&&this._cfg.attrs.img===n.img||this._setAttrImg();var r=n.x,a=n.y,o=n.width,s=n.height;return i.rect(r,a,o,s,t,e)},d=function(t,e){var n=this._attrs,r=n.x1,a=n.y1,o=n.x2,s=n.y2,u=this.getHitLineWidth();return!!this.hasStroke()&&i.line(r,a,o,s,u,t,e)},g=function(t,e){var n=this,i=n.get("segments"),a=n.hasFill(),o=n.hasStroke();function s(){if(!r.isEmpty(i)){for(var a=n.getHitLineWidth(),o=0,s=i.length;o<s;o++)if(i[o].isInside(t,e,a))return!0;return!1}}return a&&o?u(t,e,n)||s():a?u(t,e,n):!!o&&s()},v=function(t,e){var n=this,r=n.hasFill(),a=n.hasStroke();function o(){var r=n._attrs,a=r.points;if(a.length<2)return!1;var o=n.getHitLineWidth(),s=a.slice(0);return a.length>=3&&s.push(a[0]),i.polyline(s,o,t,e)}return r&&a?u(t,e,n)||o():r?u(t,e,n):!!a&&o()},y=function(t,e){var n=this._attrs,r=n.x,a=n.y,o=n.radius||n.r,s=this.getHitLineWidth();return i.circle(r,a,o+s/2,t,e)},m=function(t,e){var n=this,r=n._attrs;if(n.hasStroke()){var a=r.points;if(a.length<2)return!1;var o=r.lineWidth;return i.polyline(a,o,t,e)}return!1},x=function(t,e){var n=this,r=n.hasFill(),a=n.hasStroke();function o(){var r=n._attrs,a=r.x,o=r.y,s=r.width,u=r.height,l=r.radius,c=n.getHitLineWidth();if(0===l){var h=c/2;return i.line(a-h,o,a+s+h,o,c,t,e)||i.line(a+s,o-h,a+s,o+u+h,c,t,e)||i.line(a+s+h,o+u,a-h,o+u,c,t,e)||i.line(a,o+u+h,a,o-h,c,t,e)}return i.line(a+l,o,a+s-l,o,c,t,e)||i.line(a+s,o+l,a+s,o+u-l,c,t,e)||i.line(a+s-l,o+u,a+l,o+u,c,t,e)||i.line(a,o+u-l,a,o+l,c,t,e)||i.arcline(a+s-l,o+l,l,1.5*Math.PI,2*Math.PI,!1,c,t,e)||i.arcline(a+s-l,o+u-l,l,0,.5*Math.PI,!1,c,t,e)||i.arcline(a+l,o+u-l,l,.5*Math.PI,Math.PI,!1,c,t,e)||i.arcline(a+l,o+l,l,Math.PI,1.5*Math.PI,!1,c,t,e)}return r&&a?u(t,e,n)||o():r?u(t,e,n):!!a&&o()},b=function(t,e){var n=this,r=n.getBBox();if(n.hasFill()||n.hasStroke())return i.box(r.minX,r.maxX,r.minY,r.maxY,t,e)},_=function(t,e){if(!this._cfg.el)return!1;var n=this._cfg.el.getBBox();return i.box(n.x,n.x+n.width,n.y,n.y+n.height,t,e)},w={arc:l,circle:c,dom:_,ellipse:h,fan:f,image:p,line:d,path:g,marker:y,polygon:v,polyline:m,rect:x,text:b};t.exports={isPointInPath:function(t,e){var n=w[this.type];return!!n&&n.call(this,t,e)}}},function(t,e,n){var r=n(1),i=n(71),a=n(96),o=n(193),s=n(438),u=s.interpolate,l=s.interpolateArray,c=function(t){this._animators=[],this._current=0,this._timer=null,this.canvas=t};function h(t,e,n){var a={},o=e.toAttrs,s=e.fromAttrs,c=e.toMatrix;if(!t.get("destroyed")){var h;for(var f in o)if(!r.isEqual(s[f],o[f]))if("path"===f){var p=o[f],d=s[f];p.length>d.length?(p=i.parsePathString(o[f]),d=i.parsePathString(s[f]),d=i.fillPathByDiff(d,p),d=i.formatPath(d,p),e.fromAttrs.path=d,e.toAttrs.path=p):e.pathFormatted||(p=i.parsePathString(o[f]),d=i.parsePathString(s[f]),d=i.formatPath(d,p),e.fromAttrs.path=d,e.toAttrs.path=p,e.pathFormatted=!0),a[f]=[];for(var g=0;g<p.length;g++){for(var v=p[g],y=d[g],m=[],x=0;x<v.length;x++)r.isNumber(v[x])&&y&&r.isNumber(y[x])?(h=u(y[x],v[x]),m.push(h(n))):m.push(v[x]);a[f].push(m)}}else h=u(s[f],o[f]),a[f]=h(n);if(c){var b=l(e.fromMatrix,c),_=b(n);t.setMatrix(_)}t.attr(a)}}function f(t,e,n){var r,i=e.startTime;if(n<i+e.delay||e.isPaused)return!1;var a=e.duration,s=e.easing;if(n=n-i-e.delay,e.toAttrs.repeat)r=n%a/a,r=o[s](r);else{if(r=n/a,!(r<1))return t.attr(e.toAttrs),e.toMatrix&&t.setMatrix(e.toMatrix),!0;r=o[s](r)}return h(t,e,r),!1}r.augment(c,{initTimer:function(){var t,e,n,r=this,i=this,o=!1;i._timer=a.timer(function(a){if(i._current=a,r._animators.length>0){for(var s=r._animators.length-1;s>=0;s--)if(t=r._animators[s],t.get("destroyed"))i.removeAnimator(s);else{if(!t.get("pause").isPaused){e=t.get("animators");for(var u=e.length-1;u>=0;u--)n=e[u],o=f(t,n,a),o&&(e.splice(u,1),o=!1,n.callback&&n.callback())}0===e.length&&i.removeAnimator(s)}r.canvas.draw()}})},addAnimator:function(t){this._animators.push(t)},removeAnimator:function(t){this._animators.splice(t,1)},isAnimating:function(){return!!this._animators.length},stop:function(){this._timer&&this._timer.stop()},stopAllAnimations:function(){this._animators.forEach(function(t){t.stopAnimate()}),this._animators=[],this.canvas.draw()},getTime:function(){return this._current}}),t.exports=c},function(t,e,n){var r=n(1);function i(t){return 1===t[0]&&0===t[1]&&0===t[3]&&1===t[4]&&0===t[6]&&0===t[7]}function a(t){return 0===t[1]&&0===t[3]&&0===t[6]&&0===t[7]}function o(t,e){i(e)||(a(e)?(t[0]*=e[0],t[4]*=e[4]):r.mat3.multiply(t,t,e))}t.exports={initTransform:function(){},resetMatrix:function(){this.attr("matrix",[1,0,0,0,1,0,0,0,1])},translate:function(t,e){var n=this._attrs.matrix;return r.mat3.translate(n,n,[t,e]),this.clearTotalMatrix(),this.attr("matrix",n),this},rotate:function(t){var e=this._attrs.matrix;return r.mat3.rotate(e,e,t),this.clearTotalMatrix(),this.attr("matrix",e),this},scale:function(t,e){var n=this._attrs.matrix;return r.mat3.scale(n,n,[t,e]),this.clearTotalMatrix(),this.attr("matrix",n),this},rotateAtStart:function(t){var e=this._attrs.x||this._cfg.attrs.x,n=this._attrs.y||this._cfg.attrs.y;return Math.abs(t)>2*Math.PI&&(t=t/180*Math.PI),this.transform([["t",-e,-n],["r",t],["t",e,n]])},move:function(t,e){var n=this.get("x")||0,r=this.get("y")||0;return this.translate(t-n,e-r),this.set("x",t),this.set("y",e),this},transform:function(t){var e=this,n=this._attrs.matrix;return r.each(t,function(t){switch(t[0]){case"t":e.translate(t[1],t[2]);break;case"s":e.scale(t[1],t[2]);break;case"r":e.rotate(t[1]);break;case"m":e.attr("matrix",r.mat3.multiply([],n,t[1])),e.clearTotalMatrix();break;default:break}}),e},setTransform:function(t){return this.attr("matrix",[1,0,0,0,1,0,0,0,1]),this.transform(t)},getMatrix:function(){return this.attr("matrix")},setMatrix:function(t){return this.attr("matrix",t),this.clearTotalMatrix(),this},apply:function(t,e){var n;return n=e?this._getMatrixByRoot(e):this.attr("matrix"),r.vec3.transformMat3(t,t,n),this},_getMatrixByRoot:function(t){var e=this;t=t||e;var n=e,i=[];while(n!==t)i.unshift(n),n=n.get("parent");i.unshift(n);var a=[1,0,0,0,1,0,0,0,1];return r.each(i,function(t){r.mat3.multiply(a,t.attr("matrix"),a)}),a},getTotalMatrix:function(){var t=this._cfg.totalMatrix;if(!t){t=[1,0,0,0,1,0,0,0,1];var e=this._cfg.parent;if(e){var n=e.getTotalMatrix();o(t,n)}o(t,this.attr("matrix")),this._cfg.totalMatrix=t}return t},clearTotalMatrix:function(){},invert:function(t){var e=this.getTotalMatrix();if(a(e))t[0]/=e[0],t[1]/=e[4];else{var n=r.mat3.invert([],e);n&&r.vec3.transformMat3(t,t,n)}return this},resetTransform:function(t){var e=this.attr("matrix");i(e)||t.transform(e[0],e[1],e[3],e[4],e[6],e[7])}}},function(t,e,n){t.exports={painter:n(319)}},function(t,e,n){var r=n(1),i=n(320),a=["fillStyle","font","globalAlpha","lineCap","lineWidth","lineJoin","miterLimit","shadowBlur","shadowColor","shadowOffsetX","shadowOffsetY","strokeStyle","textAlign","textBaseline","lineDash","lineDashOffset"],o=function(){function t(t){if(!t)return null;var e=r.uniqueId("canvas_"),n=r.createDom('<canvas id="'+e+'"></canvas>');return t.appendChild(n),this.type="canvas",this.canvas=n,this.context=n.getContext("2d"),this.toDraw=!1,this}var e=t.prototype;return e.beforeDraw=function(){var t=this.canvas;this.context&&this.context.clearRect(0,0,t.width,t.height)},e.draw=function(t){var e=this;function n(){e.animateHandler=r.requestAnimationFrame(function(){e.animateHandler=void 0,e.toDraw&&n()}),e.beforeDraw();try{e._drawGroup(t)}catch(t){console.warn("error in draw canvas, detail as:"),console.warn(t),e.toDraw=!1}e.toDraw=!1}e.animateHandler?e.toDraw=!0:n()},e.drawSync=function(t){this.beforeDraw(),this._drawGroup(t)},e._drawGroup=function(t){if(!t._cfg.removed&&!t._cfg.destroyed&&t._cfg.visible){var e=this,n=t._cfg.children,r=null;this.setContext(t);for(var i=0;i<n.length;i++)r=n[i],n[i].isGroup?e._drawGroup(r):e._drawShape(r);this.restoreContext(t)}},e._drawShape=function(t){t._cfg.removed||t._cfg.destroyed||!t._cfg.visible||(this.setContext(t),t.drawInner(this.context),this.restoreContext(t),t._cfg.attrs=t._attrs,t._cfg.hasUpdate=!1)},e.setContext=function(t){var e=this.context,n=t._attrs.clip;e.save(),n&&(n.resetTransform(e),n.createPath(e),e.clip()),this.resetContext(t),t.resetTransform(e)},e.restoreContext=function(){this.context.restore()},e.resetContext=function(t){var e=this.context,n=t._attrs;if(!t.isGroup)for(var o in n)if(a.indexOf(o)>-1){var s=n[o];"fillStyle"===o&&(s=i.parseStyle(s,t,e)),"strokeStyle"===o&&(s=i.parseStyle(s,t,e)),"lineDash"===o&&e.setLineDash?r.isArray(s)?e.setLineDash(s):r.isString(s)&&e.setLineDash(s.split(" ")):e[o]=s}},t}();t.exports=o},function(t,e,n){var r=n(1),i=/[MLHVQTCSAZ]([^MLHVQTCSAZ]*)/gi,a=/[^\s\,]+/gi,o=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,s=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,u=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,l=/[\d.]+:(#[^\s]+|[^\)]+\))/gi,c={};function h(t,e){var n=t.match(l);r.each(n,function(t){t=t.split(":"),e.addColorStop(t[0],t[1])})}function f(t,e,n){var i,a,s=o.exec(t),u=r.mod(r.toRadian(parseFloat(s[1])),2*Math.PI),l=s[2],c=e.getBBox();u>=0&&u<.5*Math.PI?(i={x:c.minX,y:c.minY},a={x:c.maxX,y:c.maxY}):.5*Math.PI<=u&&u<Math.PI?(i={x:c.maxX,y:c.minY},a={x:c.minX,y:c.maxY}):Math.PI<=u&&u<1.5*Math.PI?(i={x:c.maxX,y:c.maxY},a={x:c.minX,y:c.minY}):(i={x:c.minX,y:c.maxY},a={x:c.maxX,y:c.minY});var f=Math.tan(u),p=f*f,d=(a.x-i.x+f*(a.y-i.y))/(p+1)+i.x,g=f*(a.x-i.x+f*(a.y-i.y))/(p+1)+i.y,v=n.createLinearGradient(i.x,i.y,d,g);return h(l,v),v}function p(t,e,n){var r=s.exec(t),i=parseFloat(r[1]),a=parseFloat(r[2]),o=parseFloat(r[3]),u=r[4];if(0===o){var c=u.match(l);return c[c.length-1].split(":")[1]}var f=e.getBBox(),p=f.maxX-f.minX,d=f.maxY-f.minY,g=Math.sqrt(p*p+d*d)/2,v=n.createRadialGradient(f.minX+p*i,f.minY+d*a,o*g,f.minX+p/2,f.minY+d/2,g);return h(u,v),v}function d(t,e,n){if(e.get("patternSource")&&e.get("patternSource")===t)return e.get("pattern");var r,i,a=u.exec(t),o=a[1],s=a[2];function l(){r=n.createPattern(i,o),e.setSilent("pattern",r),e.setSilent("patternSource",t)}switch(o){case"a":o="repeat";break;case"x":o="repeat-x";break;case"y":o="repeat-y";break;case"n":o="no-repeat";break;default:o="no-repeat"}return i=new Image,s.match(/^data:/i)||(i.crossOrigin="Anonymous"),i.src=s,i.complete?l():(i.onload=l,i.src=i.src),r}t.exports={parsePath:function(t){return t=t||[],r.isArray(t)?t:r.isString(t)?(t=t.match(i),r.each(t,function(e,n){if(e=e.match(a),e[0].length>1){var i=e[0].charAt(0);e.splice(1,0,e[0].substr(1)),e[0]=i}r.each(e,function(t,n){isNaN(t)||(e[n]=+t)}),t[n]=e}),t):void 0},parseStyle:function(t,e,n){if(r.isString(t)){if("("===t[1]||"("===t[2]){if("l"===t[0])return f(t,e,n);if("r"===t[0])return p(t,e,n);if("p"===t[0])return d(t,e,n)}return t}},numberToColor:function(t){var e=c[t];if(!e){for(var n=t.toString(16),r=n.length;r<6;r++)n="0"+n;e="#"+n,c[t]=e}return e}}},function(t,e,n){t.exports={canvas:n(318),svg:n(329)}},function(t,e,n){var r=n(1),i=n(325),a=n(327),o=n(323),s=n(324),u=n(326),l=function(){function t(t){var e=document.createElementNS("http://www.w3.org/2000/svg","defs"),n=r.uniqueId("defs_");e.id=n,t.appendChild(e),this.children=[],this.defaultArrow={},this.el=e,this.canvas=t}var e=t.prototype;return e.find=function(t,e){for(var n=this.children,r=null,i=0;i<n.length;i++)if(n[i].match(t,e)){r=n[i].id;break}return r},e.findById=function(t){for(var e=this.children,n=null,r=0;r<e.length;r++)if(e[r].id===t){n=e[r];break}return n},e.add=function(t){this.children.push(t),t.canvas=this.canvas,t.parent=this},e.getDefaultArrow=function(t,e){var n=t.stroke||t.strokeStyle;if(this.defaultArrow[n])return this.defaultArrow[n].id;var r=new o(t,e);return this.defaultArrow[n]=r,this.el.appendChild(r.el),r.id},e.addGradient=function(t){var e=new i(t);return this.el.appendChild(e.el),this.add(e),e.id},e.addArrow=function(t,e){var n=new o(t,e);return this.el.appendChild(n.el),n.id},e.addShadow=function(t){var e=new a(t);return this.el.appendChild(e.el),this.add(e),e.id},e.addPattern=function(t){var e=new u(t);return this.el.appendChild(e.el),this.add(e),e.id},e.addClip=function(t){var e=new s(t);return this.el.appendChild(e.el),this.add(e),e.id},t}();t.exports=l},function(t,e,n){var r=n(1),i=function(){function t(t,e){var n=document.createElementNS("http://www.w3.org/2000/svg","marker"),i=r.uniqueId("marker_");n.setAttribute("id",i);var a=document.createElementNS("http://www.w3.org/2000/svg","path");return a.setAttribute("stroke","none"),a.setAttribute("fill",t.stroke||"#000"),n.appendChild(a),n.setAttribute("overflow","visible"),n.setAttribute("orient","auto-start-reverse"),this.el=n,this.child=a,this.id=i,this.cfg=t["marker-start"===e?"startArrow":"endArrow"],this.stroke=t.stroke||"#000",!0===this.cfg?this._setDefaultPath(e,a):this._setMarker(t.lineWidth,a),this}var e=t.prototype;return e.match=function(){return!1},e._setDefaultPath=function(t,e){var n=this.el;e.setAttribute("d","M0,0 L6,3 L0,6 L3,3Z"),n.setAttribute("refX",3),n.setAttribute("refY",3)},e._setMarker=function(t,e){var n=this.el,i=this.cfg.path,a=this.cfg.d;r.isArray(i)&&(i=i.map(function(t){return t.join(" ")}).join("")),e.setAttribute("d",i),n.appendChild(e),a&&n.setAttribute("refX",a/t)},e.update=function(t){var e=this.child;e.attr?e.attr("fill",t):e.setAttribute("fill",t)},t}();t.exports=i},function(t,e,n){var r=n(1),i=function(){function t(t){this.type="clip";var e=document.createElementNS("http://www.w3.org/2000/svg","clipPath");this.el=e,this.id=r.uniqueId("clip_"),e.id=this.id;var n=t._cfg.el;return e.appendChild(n.cloneNode(!0)),this.cfg=t,this}var e=t.prototype;return e.match=function(){return!1},e.remove=function(){var t=this.el;t.parentNode.removeChild(t)},t}();t.exports=i},function(t,e,n){var r=n(1),i=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,a=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,o=/[\d.]+:(#[^\s]+|[^\)]+\))/gi;function s(t){var e=t.match(o);if(!e)return"";var n="";return e.sort(function(t,e){return t=t.split(":"),e=e.split(":"),Number(t[0])-Number(e[0])}),r.each(e,function(t){t=t.split(":"),n+='<stop offset="'+t[0]+'" stop-color="'+t[1]+'"></stop>'}),n}function u(t,e){var n,a,o=i.exec(t),u=r.mod(r.toRadian(parseFloat(o[1])),2*Math.PI),l=o[2];u>=0&&u<.5*Math.PI?(n={x:0,y:0},a={x:1,y:1}):.5*Math.PI<=u&&u<Math.PI?(n={x:1,y:0},a={x:0,y:1}):Math.PI<=u&&u<1.5*Math.PI?(n={x:1,y:1},a={x:0,y:0}):(n={x:0,y:1},a={x:1,y:0});var c=Math.tan(u),h=c*c,f=(a.x-n.x+c*(a.y-n.y))/(h+1)+n.x,p=c*(a.x-n.x+c*(a.y-n.y))/(h+1)+n.y;e.setAttribute("x1",n.x),e.setAttribute("y1",n.y),e.setAttribute("x2",f),e.setAttribute("y2",p),e.innerHTML=s(l)}function l(t,e){var n=a.exec(t),r=parseFloat(n[1]),i=parseFloat(n[2]),o=parseFloat(n[3]),u=n[4];e.setAttribute("cx",r),e.setAttribute("cy",i),e.setAttribute("r",o),e.innerHTML=s(u)}var c=function(){function t(t){var e=null,n=r.uniqueId("gradient_");return"l"===t.toLowerCase()[0]?(e=document.createElementNS("http://www.w3.org/2000/svg","linearGradient"),u(t,e)):(e=document.createElementNS("http://www.w3.org/2000/svg","radialGradient"),l(t,e)),e.setAttribute("id",n),this.el=e,this.id=n,this.cfg=t,this}var e=t.prototype;return e.match=function(t,e){return this.cfg===e},t}();t.exports=c},function(t,e,n){var r=n(1),i=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,a=function(){function t(t){var e=document.createElementNS("http://www.w3.org/2000/svg","pattern");e.setAttribute("patternUnits","userSpaceOnUse");var n=document.createElementNS("http://www.w3.org/2000/svg","image");e.appendChild(n);var a=r.uniqueId("pattern_");e.id=a,this.el=e,this.id=a,this.cfg=t;var o=i.exec(t),s=o[2];n.setAttribute("href",s);var u=new Image;function l(){console.log(u.width,u.height),e.setAttribute("width",u.width),e.setAttribute("height",u.height)}return s.match(/^data:/i)||(u.crossOrigin="Anonymous"),u.src=s,u.complete?l():(u.onload=l,u.src=u.src),this}var e=t.prototype;return e.match=function(t,e){return this.cfg===e},t}();t.exports=a},function(t,e,n){var r=n(1),i={shadowColor:"color",shadowOpacity:"opacity",shadowBlur:"blur",shadowOffsetX:"dx",shadowOffsetY:"dy"},a={x:"-40%",y:"-40%",width:"200%",height:"200%"},o=function(){function t(t){this.type="filter";var e=document.createElementNS("http://www.w3.org/2000/svg","filter");return r.each(a,function(t,n){e.setAttribute(n,t)}),this.el=e,this.id=r.uniqueId("filter_"),this.el.id=this.id,this.cfg=t,this._parseShadow(t,e),this}var e=t.prototype;return e.match=function(t,e){if(this.type!==t)return!1;var n=!0,i=this.cfg;return r.each(Object.keys(i),function(t){if(i[t]!==e[t])return n=!1,!1}),n},e.update=function(t,e){var n=this.cfg;return n[i[t]]=e,this._parseShadow(n,this.el),this},e._parseShadow=function(t,e){var n='<feDropShadow \n dx="'+(t.dx||0)+'" \n dy="'+(t.dy||0)+'" \n stdDeviation="'+(t.blur?t.blur/10:0)+'"\n flood-color="'+(t.color?t.color:"#000")+'"\n flood-opacity="'+(t.opacity?t.opacity:1)+'"\n />';e.innerHTML=n},t}();t.exports=o},function(t,e){var n={svg:"svg",circle:"circle",rect:"rect",text:"text",path:"path",foreignObject:"foreignObject",polygon:"polygon",ellipse:"ellipse",image:"image"};t.exports=function(t,e,r){var i=r.target||r.srcElement;if(!n[i.tagName]){var a=i.parentNode;while(a&&!n[a.tagName])a=a.parentNode;i=a}return this._cfg.el===i?this:this.find(function(t){return t._cfg&&t._cfg.el===i})}},function(t,e,n){t.exports={painter:n(330),getShape:n(328)}},function(t,e,n){var r=n(1),i=n(36),a=i.parseRadius,o=n(68),s=n(322),u={rect:"path",circle:"circle",line:"line",path:"path",marker:"path",text:"text",polygon:"polygon",image:"image",ellipse:"ellipse",dom:"foreignObject",fan:"path",group:"g"},l=.3,c={opacity:"opacity",fillStyle:"fill",strokeOpacity:"stroke-opacity",fillOpacity:"fill-opacity",strokeStyle:"stroke",x:"x",y:"y",r:"r",width:"width",height:"height",x1:"x1",x2:"x2",y1:"y1",y2:"y2",lineCap:"stroke-linecap",lineJoin:"stroke-linejoin",lineWidth:"stroke-width",lineDash:"stroke-dasharray",lineDashOffset:"stroke-dashoffset",miterLimit:"stroke-miterlimit",font:"font",fontSize:"font-size",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",fontFamily:"font-family",startArrow:"marker-start",endArrow:"marker-end",path:"d",class:"class",id:"id",style:"style",preserveAspectRatio:"preserveAspectRatio"},h={top:"before-edge",middle:"central",bottom:"after-edge",alphabetic:"baseline",hanging:"hanging"},f={left:"left",start:"left",center:"middle",right:"end",end:"end"},p=function(){function t(t){if(!t)return null;var e=r.uniqueId("canvas_"),n=r.createDom('<svg id="'+e+'"></svg>');return t.appendChild(n),this.type="svg",this.canvas=n,this.context=new s(n),this.toDraw=!1,this}var e=t.prototype;return e.draw=function(t){var e=this;function n(){e.animateHandler=r.requestAnimationFrame(function(){e.animateHandler=void 0,e.toDraw&&n()});try{t.resetMatrix(),e._drawGroup(t,!1)}catch(t){console.warn("error in draw canvas, detail as:"),console.warn(t),e.toDraw=!1}e.toDraw=!1}e.animateHandler?e.toDraw=!0:n()},e.drawSync=function(t){this._drawChildren(t,!1)},e._drawGroup=function(t,e){var n=t._cfg;n.removed||n.destroyed||(!n.el&&n.attrs&&(e=!0),n.tobeRemoved&&(r.each(n.tobeRemoved,function(t){t.parentNode&&t.parentNode.removeChild(t)}),n.tobeRemoved=[]),this._drawShape(t,e),n.children&&n.children.length>0&&this._drawChildren(t,e))},e._drawChildren=function(t,e){var n,r=this,i=t._cfg.children;if(i){if(t._cfg.el&&!e){var a=t._cfg.el.childNodes.length+1;0!==a&&a!==i.length&&(e=!0)}for(var o=0;o<i.length;o++)n=i[o],n.isGroup?r._drawGroup(n,e):r._drawShape(n,e)}},e._drawShape=function(t,e){var n=this,r=t._attrs,i=t._cfg,a=i.el;i.removed||i.destroyed?a&&a.parentNode.removeChild(i.el):(e&&a&&(a.parentNode&&a.parentNode.removeChild(a),a=null),!a&&i.parent&&(n._createDom(t),n._updateShape(t)),a=i.el,!1!==i.visible?(i.visible&&a.hasAttribute("visibility")&&a.removeAttribute("visibility"),i.hasUpdate&&n._updateShape(t),r.clip&&r.clip._cfg.hasUpdate&&n._updateShape(r.clip)):a.setAttribute("visibility","hidden"))},e._updateShape=function(t){var e=this,n=t._attrs,i=t._cfg.attrs;if(i)if(t._cfg.el||e._createDom(t),"clip"in n&&this._setClip(t,n.clip),("shadowOffsetX"in n||"shadowOffsetY"in n||"shadowBlur"in n||"shadowColor"in n)&&this._setShadow(t),"text"!==t.type){for(var a in"fan"===t.type&&e._updateFan(t),"marker"===t.type&&t._cfg.el.setAttribute("d",e._assembleMarker(n)),"rect"===t.type&&t._cfg.el.setAttribute("d",e._assembleRect(n)),n)n[a]!==i[a]&&e._setAttribute(t,a,n[a]);t._cfg.attrs=r.deepMix({},t._attrs),t._cfg.hasUpdate=!1}else e._updateText(t)},e._setAttribute=function(t,e,n){var i=t.type,a=t._attrs,o=t._cfg.el,s=this.context;if("marker"!==i&&"rect"!==i||!~["x","y","radius","r"].indexOf(e))if(~["circle","ellipse"].indexOf(i)&&~["x","y"].indexOf(e))o.setAttribute("c"+e,parseInt(n,10));else{if("polygon"===i&&"points"===e)return n&&0!==n.length||(n=""),r.isArray(n)&&(n=n.map(function(t){return t[0]+","+t[1]}),n=n.join(" ")),void o.setAttribute("points",n);if("path"===e&&r.isArray(n))o.setAttribute("d",this._formatPath(n));else if("img"!==e){if("transform"===e)return n?void this._setTransform(t):void o.removeAttribute("transform");if("rotate"===e)return n?void this._setTransform(t):void o.removeAttribute("transform");if("matrix"!==e)if("fillStyle"!==e&&"strokeStyle"!==e){if("clip"!==e)if(~e.indexOf("Arrow"))if(e=c[e],n){var u=null;u="boolean"===typeof n?s.getDefaultArrow(a,e):s.addArrow(a,e),o.setAttribute(e,"url(#"+u+")"),t._cfg[e]=u}else t._cfg[e]=null,o.removeAttribute(e);else"html"===e&&("string"===typeof n?o.innerHTML=n:(o.innerHTML="",o.appendChild(n))),c[e]&&o.setAttribute(c[e],n)}else this._setColor(t,e,n);else this._setTransform(t)}else this._setImage(t,n)}},e._createDom=function(t){var e=u[t.type],n=t._attrs;if(!e)throw new Error("the type"+t.type+"is not supported by svg");var r=document.createElementNS("http://www.w3.org/2000/svg",e);return t._cfg.el=r,t._cfg.parent&&t._cfg.parent.get("el").appendChild(r),t._cfg.attrs={},"text"===t.type?(r.setAttribute("paint-order","stroke"),r.setAttribute("style","stroke-linecap:butt; stroke-linejoin:miter;")):(n.stroke||n.strokeStyle||r.setAttribute("stroke","none"),n.fill||n.fillStyle||r.setAttribute("fill","none")),r},e._assembleMarker=function(t){var e=t.r;if("undefined"===typeof t.r&&(e=t.radius),isNaN(Number(t.x))||isNaN(Number(t.y))||isNaN(Number(e)))return"";var n="";return n="function"===typeof t.symbol?t.symbol(t.x,t.y,e):o.Symbols[t.symbol||"circle"](t.x,t.y,e),r.isArray(n)&&(n=n.map(function(t){return t.join(" ")}).join("")),n},e._assembleRect=function(t){var e=t.x,n=t.y,i=t.width,o=t.height,s=t.radius;if(!s)return"M "+e+","+n+" l "+i+",0 l 0,"+o+" l"+-i+" 0 z";var u=a(s);r.isArray(s)?1===s.length?u.r1=u.r2=u.r3=u.r4=s[0]:2===s.length?(u.r1=u.r3=s[0],u.r2=u.r4=s[1]):3===s.length?(u.r1=s[0],u.r2=u.r4=s[1],u.r3=s[2]):(u.r1=s[0],u.r2=s[1],u.r3=s[2],u.r4=s[3]):u.r1=u.r2=u.r3=u.r4=s;var l=[["M "+(e+u.r1)+","+n],["l "+(i-u.r1-u.r2)+",0"],["a "+u.r2+","+u.r2+",0,0,1,"+u.r2+","+u.r2],["l 0,"+(o-u.r2-u.r3)],["a "+u.r3+","+u.r3+",0,0,1,"+-u.r3+","+u.r3],["l "+(u.r3+u.r4-i)+",0"],["a "+u.r4+","+u.r4+",0,0,1,"+-u.r4+","+-u.r4],["l 0,"+(u.r4+u.r1-o)],["a "+u.r1+","+u.r1+",0,0,1,"+u.r1+","+-u.r1],["z"]];return l.join(" ")},e._formatPath=function(t){return t=t.map(function(t){return t.join(" ")}).join(""),~t.indexOf("NaN")?"":t},e._setTransform=function(t){for(var e=t._attrs.matrix,n=t._cfg.el,r=[],i=0;i<9;i+=3)r.push(e[i]+","+e[i+1]);r=r.join(","),-1===r.indexOf("NaN")?n.setAttribute("transform","matrix("+r+")"):console.warn("invalid matrix:",e)},e._setImage=function(t,e){var n=t._attrs,i=t._cfg.el;if(r.isString(e))i.setAttribute("href",e);else if(e instanceof Image)n.width||(i.setAttribute("width",e.width),t._attrs.width=e.width),n.height||(i.setAttribute("height",e.height),t._attrs.height=e.height),i.setAttribute("href",e.src);else if(e instanceof HTMLElement&&r.isString(e.nodeName)&&"CANVAS"===e.nodeName.toUpperCase())i.setAttribute("href",e.toDataURL());else if(e instanceof ImageData){var a=document.createElement("canvas");a.setAttribute("width",e.width),a.setAttribute("height",e.height),a.getContext("2d").putImageData(e,0,0),n.width||(i.setAttribute("width",e.width),t._attrs.width=e.width),n.height||(i.setAttribute("height",e.height),t._attrs.height=e.height),i.setAttribute("href",a.toDataURL())}},e._updateFan=function(t){function e(t,e,n){return{x:e*Math.cos(t)+n.x,y:e*Math.sin(t)+n.y}}var n=t._attrs,i=t._cfg,a={x:n.x,y:n.y},o=[],s=n.startAngle,u=n.endAngle;r.isNumberEqual(u-s,2*Math.PI)&&(u-=1e-5);var l=e(s,n.re,a),c=e(u,n.re,a),h=u>s?1:0,f=Math.abs(u-s)>Math.PI?1:0,p=n.rs,d=n.re,g=e(s,n.rs,a),v=e(u,n.rs,a);n.rs>0?(o.push("M "+c.x+","+c.y),o.push("L "+v.x+","+v.y),o.push("A "+p+","+p+",0,"+f+","+(1===h?0:1)+","+g.x+","+g.y),o.push("L "+l.x+" "+l.y)):(o.push("M "+a.x+","+a.y),o.push("L "+l.x+","+l.y)),o.push("A "+d+","+d+",0,"+f+","+h+","+c.x+","+c.y),n.rs>0?o.push("L "+v.x+","+v.y):o.push("Z"),i.el.setAttribute("d",o.join(" "))},e._updateText=function(t){var e=this,n=t._attrs,r=t._cfg.attrs,i=t._cfg.el;for(var a in this._setFont(t),n)if(n[a]!==r[a]){if("text"===a){e._setText(t,""+n[a]);continue}if("fillStyle"===a||"strokeStyle"===a){this._setColor(t,a,n[a]);continue}if("matrix"===a){this._setTransform(t);continue}c[a]&&i.setAttribute(c[a],n[a])}t._cfg.attrs=Object.assign({},t._attrs),t._cfg.hasUpdate=!1},e._setFont=function(t){var e=t.get("el"),n=t._attrs,r=n.fontSize;e.setAttribute("alignment-baseline",h[n.textBaseline]||"baseline"),e.setAttribute("text-anchor",f[n.textAlign]||"left"),r&&+r<12&&(n.matrix=[1,0,0,0,1,0,0,0,1],t.transform([["t",-n.x,-n.y],["s",+r/12,+r/12],["t",n.x,n.y]]))},e._setText=function(t,e){var n=t._cfg.el,i=t._attrs.textBaseline||"bottom";if(e)if(~e.indexOf("\n")){var a=t._attrs.x,o=e.split("\n"),s=o.length-1,u="";r.each(o,function(t,e){0===e?"alphabetic"===i?u+='<tspan x="'+a+'" dy="'+-s+'em">'+t+"</tspan>":"top"===i?u+='<tspan x="'+a+'" dy="0.9em">'+t+"</tspan>":"middle"===i?u+='<tspan x="'+a+'" dy="'+-(s-1)/2+'em">'+t+"</tspan>":"bottom"===i?u+='<tspan x="'+a+'" dy="-'+(s+l)+'em">'+t+"</tspan>":"hanging"===i&&(u+='<tspan x="'+a+'" dy="'+(-(s-1)-l)+'em">'+t+"</tspan>"):u+='<tspan x="'+a+'" dy="1em">'+t+"</tspan>"}),n.innerHTML=u}else n.innerHTML=e;else n.innerHTML=""},e._setClip=function(t,e){var n=t._cfg.el;if(e)if(n.hasAttribute("clip-path"))e._cfg.hasUpdate&&this._updateShape(e);else{this._createDom(e),this._updateShape(e);var r=this.context.addClip(e);n.setAttribute("clip-path","url(#"+r+")")}else n.removeAttribute("clip-path")},e._setColor=function(t,e,n){var r=t._cfg.el,i=this.context;if(n)if(n=n.trim(),/^[r,R,L,l]{1}[\s]*\(/.test(n)){var a=i.find("gradient",n);a||(a=i.addGradient(n)),r.setAttribute(c[e],"url(#"+a+")")}else if(/^[p,P]{1}[\s]*\(/.test(n)){var o=i.find("pattern",n);o||(o=i.addPattern(n)),r.setAttribute(c[e],"url(#"+o+")")}else r.setAttribute(c[e],n);else r.setAttribute(c[e],"none")},e._setShadow=function(t){var e=t._cfg.el,n=t._attrs,r={dx:n.shadowOffsetX,dy:n.shadowOffsetY,blur:n.shadowBlur,color:n.shadowColor};if(r.dx||r.dy||r.blur||r.color){var i=this.context.find("filter",r);i||(i=this.context.addShadow(r,this)),e.setAttribute("filter","url(#"+i+")")}else e.removeAttribute("filter")},t}();t.exports=p},function(t,e,n){var r=n(7);r.Arc=n(129),r.Circle=n(130),r.Dom=n(131),r.Ellipse=n(132),r.Fan=n(133),r.Image=n(134),r.Line=n(135),r.Marker=n(68),r.Path=n(138),r.Polygon=n(139),r.Polyline=n(140),r.Rect=n(141),r.Text=n(142),t.exports=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.sub=e.mul=void 0,e.create=o,e.fromMat4=s,e.clone=u,e.copy=l,e.fromValues=c,e.set=h,e.identity=f,e.transpose=p,e.invert=d,e.adjoint=g,e.determinant=v,e.multiply=y,e.translate=m,e.rotate=x,e.scale=b,e.fromTranslation=_,e.fromRotation=w,e.fromScaling=M,e.fromMat2d=S,e.fromQuat=C,e.normalFromMat4=k,e.projection=A,e.str=P,e.frob=I,e.add=T,e.subtract=O,e.multiplyScalar=E,e.multiplyScalarAndAdd=L,e.exactEquals=D,e.equals=F;var r=n(72),i=a(r);function a(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function o(){var t=new i.ARRAY_TYPE(9);return i.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function s(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t}function u(t){var e=new i.ARRAY_TYPE(9);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function l(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function c(t,e,n,r,a,o,s,u,l){var c=new i.ARRAY_TYPE(9);return c[0]=t,c[1]=e,c[2]=n,c[3]=r,c[4]=a,c[5]=o,c[6]=s,c[7]=u,c[8]=l,c}function h(t,e,n,r,i,a,o,s,u,l){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=u,t[8]=l,t}function f(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function p(t,e){if(t===e){var n=e[1],r=e[2],i=e[5];t[1]=e[3],t[2]=e[6],t[3]=n,t[5]=e[7],t[6]=r,t[7]=i}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t}function d(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],s=e[5],u=e[6],l=e[7],c=e[8],h=c*o-s*l,f=-c*a+s*u,p=l*a-o*u,d=n*h+r*f+i*p;return d?(d=1/d,t[0]=h*d,t[1]=(-c*r+i*l)*d,t[2]=(s*r-i*o)*d,t[3]=f*d,t[4]=(c*n-i*u)*d,t[5]=(-s*n+i*a)*d,t[6]=p*d,t[7]=(-l*n+r*u)*d,t[8]=(o*n-r*a)*d,t):null}function g(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],s=e[5],u=e[6],l=e[7],c=e[8];return t[0]=o*c-s*l,t[1]=i*l-r*c,t[2]=r*s-i*o,t[3]=s*u-a*c,t[4]=n*c-i*u,t[5]=i*a-n*s,t[6]=a*l-o*u,t[7]=r*u-n*l,t[8]=n*o-r*a,t}function v(t){var e=t[0],n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],u=t[7],l=t[8];return e*(l*a-o*u)+n*(-l*i+o*s)+r*(u*i-a*s)}function y(t,e,n){var r=e[0],i=e[1],a=e[2],o=e[3],s=e[4],u=e[5],l=e[6],c=e[7],h=e[8],f=n[0],p=n[1],d=n[2],g=n[3],v=n[4],y=n[5],m=n[6],x=n[7],b=n[8];return t[0]=f*r+p*o+d*l,t[1]=f*i+p*s+d*c,t[2]=f*a+p*u+d*h,t[3]=g*r+v*o+y*l,t[4]=g*i+v*s+y*c,t[5]=g*a+v*u+y*h,t[6]=m*r+x*o+b*l,t[7]=m*i+x*s+b*c,t[8]=m*a+x*u+b*h,t}function m(t,e,n){var r=e[0],i=e[1],a=e[2],o=e[3],s=e[4],u=e[5],l=e[6],c=e[7],h=e[8],f=n[0],p=n[1];return t[0]=r,t[1]=i,t[2]=a,t[3]=o,t[4]=s,t[5]=u,t[6]=f*r+p*o+l,t[7]=f*i+p*s+c,t[8]=f*a+p*u+h,t}function x(t,e,n){var r=e[0],i=e[1],a=e[2],o=e[3],s=e[4],u=e[5],l=e[6],c=e[7],h=e[8],f=Math.sin(n),p=Math.cos(n);return t[0]=p*r+f*o,t[1]=p*i+f*s,t[2]=p*a+f*u,t[3]=p*o-f*r,t[4]=p*s-f*i,t[5]=p*u-f*a,t[6]=l,t[7]=c,t[8]=h,t}function b(t,e,n){var r=n[0],i=n[1];return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=i*e[3],t[4]=i*e[4],t[5]=i*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function _(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=e[0],t[7]=e[1],t[8]=1,t}function w(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=0,t[3]=-n,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function M(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=e[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function S(t,e){return t[0]=e[0],t[1]=e[1],t[2]=0,t[3]=e[2],t[4]=e[3],t[5]=0,t[6]=e[4],t[7]=e[5],t[8]=1,t}function C(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],o=n+n,s=r+r,u=i+i,l=n*o,c=r*o,h=r*s,f=i*o,p=i*s,d=i*u,g=a*o,v=a*s,y=a*u;return t[0]=1-h-d,t[3]=c-y,t[6]=f+v,t[1]=c+y,t[4]=1-l-d,t[7]=p-g,t[2]=f-v,t[5]=p+g,t[8]=1-l-h,t}function k(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],s=e[5],u=e[6],l=e[7],c=e[8],h=e[9],f=e[10],p=e[11],d=e[12],g=e[13],v=e[14],y=e[15],m=n*s-r*o,x=n*u-i*o,b=n*l-a*o,_=r*u-i*s,w=r*l-a*s,M=i*l-a*u,S=c*g-h*d,C=c*v-f*d,k=c*y-p*d,A=h*v-f*g,P=h*y-p*g,I=f*y-p*v,T=m*I-x*P+b*A+_*k-w*C+M*S;return T?(T=1/T,t[0]=(s*I-u*P+l*A)*T,t[1]=(u*k-o*I-l*C)*T,t[2]=(o*P-s*k+l*S)*T,t[3]=(i*P-r*I-a*A)*T,t[4]=(n*I-i*k+a*C)*T,t[5]=(r*k-n*P-a*S)*T,t[6]=(g*M-v*w+y*_)*T,t[7]=(v*b-d*M-y*x)*T,t[8]=(d*w-g*b+y*m)*T,t):null}function A(t,e,n){return t[0]=2/e,t[1]=0,t[2]=0,t[3]=0,t[4]=-2/n,t[5]=0,t[6]=-1,t[7]=1,t[8]=1,t}function P(t){return"mat3("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+")"}function I(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2)+Math.pow(t[4],2)+Math.pow(t[5],2)+Math.pow(t[6],2)+Math.pow(t[7],2)+Math.pow(t[8],2))}function T(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t[6]=e[6]+n[6],t[7]=e[7]+n[7],t[8]=e[8]+n[8],t}function O(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t[6]=e[6]-n[6],t[7]=e[7]-n[7],t[8]=e[8]-n[8],t}function E(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*n,t}function L(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t[4]=e[4]+n[4]*r,t[5]=e[5]+n[5]*r,t[6]=e[6]+n[6]*r,t[7]=e[7]+n[7]*r,t[8]=e[8]+n[8]*r,t}function D(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]}function F(t,e){var n=t[0],r=t[1],a=t[2],o=t[3],s=t[4],u=t[5],l=t[6],c=t[7],h=t[8],f=e[0],p=e[1],d=e[2],g=e[3],v=e[4],y=e[5],m=e[6],x=e[7],b=e[8];return Math.abs(n-f)<=i.EPSILON*Math.max(1,Math.abs(n),Math.abs(f))&&Math.abs(r-p)<=i.EPSILON*Math.max(1,Math.abs(r),Math.abs(p))&&Math.abs(a-d)<=i.EPSILON*Math.max(1,Math.abs(a),Math.abs(d))&&Math.abs(o-g)<=i.EPSILON*Math.max(1,Math.abs(o),Math.abs(g))&&Math.abs(s-v)<=i.EPSILON*Math.max(1,Math.abs(s),Math.abs(v))&&Math.abs(u-y)<=i.EPSILON*Math.max(1,Math.abs(u),Math.abs(y))&&Math.abs(l-m)<=i.EPSILON*Math.max(1,Math.abs(l),Math.abs(m))&&Math.abs(c-x)<=i.EPSILON*Math.max(1,Math.abs(c),Math.abs(x))&&Math.abs(h-b)<=i.EPSILON*Math.max(1,Math.abs(h),Math.abs(b))}e.mul=y,e.sub=O},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.forEach=e.sqrLen=e.sqrDist=e.dist=e.div=e.mul=e.sub=e.len=void 0,e.create=o,e.clone=s,e.fromValues=u,e.copy=l,e.set=c,e.add=h,e.subtract=f,e.multiply=p,e.divide=d,e.ceil=g,e.floor=v,e.min=y,e.max=m,e.round=x,e.scale=b,e.scaleAndAdd=_,e.distance=w,e.squaredDistance=M,e.length=S,e.squaredLength=C,e.negate=k,e.inverse=A,e.normalize=P,e.dot=I,e.cross=T,e.lerp=O,e.random=E,e.transformMat2=L,e.transformMat2d=D,e.transformMat3=F,e.transformMat4=R,e.rotate=j,e.angle=B,e.str=N,e.exactEquals=z,e.equals=G;var r=n(72),i=a(r);function a(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function o(){var t=new i.ARRAY_TYPE(2);return i.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0),t}function s(t){var e=new i.ARRAY_TYPE(2);return e[0]=t[0],e[1]=t[1],e}function u(t,e){var n=new i.ARRAY_TYPE(2);return n[0]=t,n[1]=e,n}function l(t,e){return t[0]=e[0],t[1]=e[1],t}function c(t,e,n){return t[0]=e,t[1]=n,t}function h(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t}function f(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t}function p(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t}function d(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t}function g(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t}function v(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t}function y(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t}function m(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t}function x(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t}function b(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t}function _(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t}function w(t,e){var n=e[0]-t[0],r=e[1]-t[1];return Math.sqrt(n*n+r*r)}function M(t,e){var n=e[0]-t[0],r=e[1]-t[1];return n*n+r*r}function S(t){var e=t[0],n=t[1];return Math.sqrt(e*e+n*n)}function C(t){var e=t[0],n=t[1];return e*e+n*n}function k(t,e){return t[0]=-e[0],t[1]=-e[1],t}function A(t,e){return t[0]=1/e[0],t[1]=1/e[1],t}function P(t,e){var n=e[0],r=e[1],i=n*n+r*r;return i>0&&(i=1/Math.sqrt(i),t[0]=e[0]*i,t[1]=e[1]*i),t}function I(t,e){return t[0]*e[0]+t[1]*e[1]}function T(t,e,n){var r=e[0]*n[1]-e[1]*n[0];return t[0]=t[1]=0,t[2]=r,t}function O(t,e,n,r){var i=e[0],a=e[1];return t[0]=i+r*(n[0]-i),t[1]=a+r*(n[1]-a),t}function E(t,e){e=e||1;var n=2*i.RANDOM()*Math.PI;return t[0]=Math.cos(n)*e,t[1]=Math.sin(n)*e,t}function L(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[2]*i,t[1]=n[1]*r+n[3]*i,t}function D(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[2]*i+n[4],t[1]=n[1]*r+n[3]*i+n[5],t}function F(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[3]*i+n[6],t[1]=n[1]*r+n[4]*i+n[7],t}function R(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[4]*i+n[12],t[1]=n[1]*r+n[5]*i+n[13],t}function j(t,e,n,r){var i=e[0]-n[0],a=e[1]-n[1],o=Math.sin(r),s=Math.cos(r);return t[0]=i*s-a*o+n[0],t[1]=i*o+a*s+n[1],t}function B(t,e){var n=t[0],r=t[1],i=e[0],a=e[1],o=n*n+r*r;o>0&&(o=1/Math.sqrt(o));var s=i*i+a*a;s>0&&(s=1/Math.sqrt(s));var u=(n*i+r*a)*o*s;return u>1?0:u<-1?Math.PI:Math.acos(u)}function N(t){return"vec2("+t[0]+", "+t[1]+")"}function z(t,e){return t[0]===e[0]&&t[1]===e[1]}function G(t,e){var n=t[0],r=t[1],a=e[0],o=e[1];return Math.abs(n-a)<=i.EPSILON*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(r-o)<=i.EPSILON*Math.max(1,Math.abs(r),Math.abs(o))}e.len=S,e.sub=f,e.mul=p,e.div=d,e.dist=w,e.sqrDist=M,e.sqrLen=C,e.forEach=function(){var t=o();return function(e,n,r,i,a,o){var s=void 0,u=void 0;for(n||(n=2),r||(r=0),u=i?Math.min(i*n+r,e.length):e.length,s=r;s<u;s+=n)t[0]=e[s],t[1]=e[s+1],a(t,t,o),e[s]=t[0],e[s+1]=t[1];return e}}()},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.forEach=e.sqrLen=e.len=e.sqrDist=e.dist=e.div=e.mul=e.sub=void 0,e.create=o,e.clone=s,e.length=u,e.fromValues=l,e.copy=c,e.set=h,e.add=f,e.subtract=p,e.multiply=d,e.divide=g,e.ceil=v,e.floor=y,e.min=m,e.max=x,e.round=b,e.scale=_,e.scaleAndAdd=w,e.distance=M,e.squaredDistance=S,e.squaredLength=C,e.negate=k,e.inverse=A,e.normalize=P,e.dot=I,e.cross=T,e.lerp=O,e.hermite=E,e.bezier=L,e.random=D,e.transformMat4=F,e.transformMat3=R,e.transformQuat=j,e.rotateX=B,e.rotateY=N,e.rotateZ=z,e.angle=G,e.str=V,e.exactEquals=Y,e.equals=H;var r=n(72),i=a(r);function a(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function o(){var t=new i.ARRAY_TYPE(3);return i.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function s(t){var e=new i.ARRAY_TYPE(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function u(t){var e=t[0],n=t[1],r=t[2];return Math.sqrt(e*e+n*n+r*r)}function l(t,e,n){var r=new i.ARRAY_TYPE(3);return r[0]=t,r[1]=e,r[2]=n,r}function c(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function h(t,e,n,r){return t[0]=e,t[1]=n,t[2]=r,t}function f(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function p(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function d(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t[2]=e[2]*n[2],t}function g(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t[2]=e[2]/n[2],t}function v(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t}function y(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t}function m(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t[2]=Math.min(e[2],n[2]),t}function x(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t[2]=Math.max(e[2],n[2]),t}function b(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t}function _(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}function w(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t}function M(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2];return Math.sqrt(n*n+r*r+i*i)}function S(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2];return n*n+r*r+i*i}function C(t){var e=t[0],n=t[1],r=t[2];return e*e+n*n+r*r}function k(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t}function A(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t}function P(t,e){var n=e[0],r=e[1],i=e[2],a=n*n+r*r+i*i;return a>0&&(a=1/Math.sqrt(a),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a),t}function I(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function T(t,e,n){var r=e[0],i=e[1],a=e[2],o=n[0],s=n[1],u=n[2];return t[0]=i*u-a*s,t[1]=a*o-r*u,t[2]=r*s-i*o,t}function O(t,e,n,r){var i=e[0],a=e[1],o=e[2];return t[0]=i+r*(n[0]-i),t[1]=a+r*(n[1]-a),t[2]=o+r*(n[2]-o),t}function E(t,e,n,r,i,a){var o=a*a,s=o*(2*a-3)+1,u=o*(a-2)+a,l=o*(a-1),c=o*(3-2*a);return t[0]=e[0]*s+n[0]*u+r[0]*l+i[0]*c,t[1]=e[1]*s+n[1]*u+r[1]*l+i[1]*c,t[2]=e[2]*s+n[2]*u+r[2]*l+i[2]*c,t}function L(t,e,n,r,i,a){var o=1-a,s=o*o,u=a*a,l=s*o,c=3*a*s,h=3*u*o,f=u*a;return t[0]=e[0]*l+n[0]*c+r[0]*h+i[0]*f,t[1]=e[1]*l+n[1]*c+r[1]*h+i[1]*f,t[2]=e[2]*l+n[2]*c+r[2]*h+i[2]*f,t}function D(t,e){e=e||1;var n=2*i.RANDOM()*Math.PI,r=2*i.RANDOM()-1,a=Math.sqrt(1-r*r)*e;return t[0]=Math.cos(n)*a,t[1]=Math.sin(n)*a,t[2]=r*e,t}function F(t,e,n){var r=e[0],i=e[1],a=e[2],o=n[3]*r+n[7]*i+n[11]*a+n[15];return o=o||1,t[0]=(n[0]*r+n[4]*i+n[8]*a+n[12])/o,t[1]=(n[1]*r+n[5]*i+n[9]*a+n[13])/o,t[2]=(n[2]*r+n[6]*i+n[10]*a+n[14])/o,t}function R(t,e,n){var r=e[0],i=e[1],a=e[2];return t[0]=r*n[0]+i*n[3]+a*n[6],t[1]=r*n[1]+i*n[4]+a*n[7],t[2]=r*n[2]+i*n[5]+a*n[8],t}function j(t,e,n){var r=n[0],i=n[1],a=n[2],o=n[3],s=e[0],u=e[1],l=e[2],c=i*l-a*u,h=a*s-r*l,f=r*u-i*s,p=i*f-a*h,d=a*c-r*f,g=r*h-i*c,v=2*o;return c*=v,h*=v,f*=v,p*=2,d*=2,g*=2,t[0]=s+c+p,t[1]=u+h+d,t[2]=l+f+g,t}function B(t,e,n,r){var i=[],a=[];return i[0]=e[0]-n[0],i[1]=e[1]-n[1],i[2]=e[2]-n[2],a[0]=i[0],a[1]=i[1]*Math.cos(r)-i[2]*Math.sin(r),a[2]=i[1]*Math.sin(r)+i[2]*Math.cos(r),t[0]=a[0]+n[0],t[1]=a[1]+n[1],t[2]=a[2]+n[2],t}function N(t,e,n,r){var i=[],a=[];return i[0]=e[0]-n[0],i[1]=e[1]-n[1],i[2]=e[2]-n[2],a[0]=i[2]*Math.sin(r)+i[0]*Math.cos(r),a[1]=i[1],a[2]=i[2]*Math.cos(r)-i[0]*Math.sin(r),t[0]=a[0]+n[0],t[1]=a[1]+n[1],t[2]=a[2]+n[2],t}function z(t,e,n,r){var i=[],a=[];return i[0]=e[0]-n[0],i[1]=e[1]-n[1],i[2]=e[2]-n[2],a[0]=i[0]*Math.cos(r)-i[1]*Math.sin(r),a[1]=i[0]*Math.sin(r)+i[1]*Math.cos(r),a[2]=i[2],t[0]=a[0]+n[0],t[1]=a[1]+n[1],t[2]=a[2]+n[2],t}function G(t,e){var n=l(t[0],t[1],t[2]),r=l(e[0],e[1],e[2]);P(n,n),P(r,r);var i=I(n,r);return i>1?0:i<-1?Math.PI:Math.acos(i)}function V(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"}function Y(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}function H(t,e){var n=t[0],r=t[1],a=t[2],o=e[0],s=e[1],u=e[2];return Math.abs(n-o)<=i.EPSILON*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(r-s)<=i.EPSILON*Math.max(1,Math.abs(r),Math.abs(s))&&Math.abs(a-u)<=i.EPSILON*Math.max(1,Math.abs(a),Math.abs(u))}e.sub=p,e.mul=d,e.div=g,e.dist=M,e.sqrDist=S,e.len=u,e.sqrLen=C,e.forEach=function(){var t=o();return function(e,n,r,i,a,o){var s=void 0,u=void 0;for(n||(n=3),r||(r=0),u=i?Math.min(i*n+r,e.length):e.length,s=r;s<u;s+=n)t[0]=e[s],t[1]=e[s+1],t[2]=e[s+2],a(t,t,o),e[s]=t[0],e[s+1]=t[1],e[s+2]=t[2];return e}}()},function(t,e,n){var r=n(6),i=n(11),a=n(145),o=5,s=7,u=[0,1,1.2,1.5,1.6,2,2.2,2.4,2.5,3,4,5,6,7.5,8,10],l=[0,1,2,4,5,10];t.exports=function(t){var e=t.min,n=t.max,c=t.interval,h=t.minTickInterval,f=[],p=t.minCount||o,d=t.maxCount||s,g=p===d,v=r(t.minLimit)?-1/0:t.minLimit,y=r(t.maxLimit)?1/0:t.maxLimit,m=(p+d)/2,x=m,b=t.snapArray?t.snapArray:g?u:l;if(e===v&&n===y&&g&&(c=(n-e)/(x-1)),r(e)&&(e=0),r(n)&&(n=0),n===e&&(0===e?n=1:e>0?e=0:n=0,n-e<5&&!c&&n-e>=1&&(c=1)),r(c)){var _=(n-e)/(m-1);c=a.snapFactorTo(_,b,"ceil"),d!==p&&(x=parseInt((n-e)/c,10),x>d&&(x=d),x<p&&(x=p),c=a.snapFactorTo((n-e)/(x-1),b,"floor"))}if(i(h)&&c<h&&(c=h),t.interval||d!==p)n=Math.min(a.snapMultiple(n,c,"ceil"),y),e=Math.max(a.snapMultiple(e,c,"floor"),v),x=Math.round((n-e)/c),e=a.fixedBase(e,c),n=a.fixedBase(n,c);else{m=parseInt(m,10);var w,M=(n+e)/2,S=a.snapMultiple(M,c,"ceil"),C=Math.floor((m-2)/2),k=S+C*c;w=m%2===0?S-C*c:S-(C+1)*c;while(k<n)k=a.fixedBase(k+c,c);while(w>e)w=a.fixedBase(w-c,c);n=k,e=w}n=Math.min(n,y),e=Math.max(e,v),f.push(e);for(var A=1;A<x;A++){var P=a.fixedBase(c*A+e,c);P<n&&f.push(P)}return f[f.length-1]<n&&f.push(n),{min:e,max:n,interval:c,count:x,ticks:f}}},function(t,e,n){var r=n(145),i=n(6),a=6,o=[1,2,4,6,8,12],s=6e4,u=36e5,l=864e5;function c(t){return new Date(t).getFullYear()}function h(t){return new Date(t,0,1).getTime()}function f(t){return new Date(t).getMonth()}function p(t,e){var n=c(t),r=c(e),i=f(t),a=f(e);return 12*(r-n)+(a-i)%12}function d(t,e){return new Date(t,e,1).getTime()}function g(t,e){return Math.ceil((e-t)/l)}function v(t,e){return Math.ceil((e-t)/u)}function y(t,e){return Math.ceil((e-t)/6e4)}t.exports=function(t){var e,n=t.minInterval,m=[],x=t.min,b=t.max,_=t.interval;if(b===x&&(b=x+l),i(_)){var w=b-x,M=l,S=365*M;_=parseInt(w/(t.maxCount||a),10),n&&n>_&&(_=n);var C=_/S,k=c(x);if(C>.51){for(var A=Math.ceil(C),P=c(b),I=k;I<=P+A;I+=A)m.push(h(I));_=null}else if(C>.0834){for(var T=Math.ceil(C/.0834),O=f(x),E=p(x,b),L=0;L<=E+T;L+=T)m.push(d(k,L+O));_=null}else if(_>.5*M){var D=new Date(x),F=D.getFullYear(),R=D.getMonth(x),j=D.getDate(),B=Math.ceil(_/M),N=g(x,b);_=B*M;for(var z=0;z<N+B;z+=B)m.push(new Date(F,R,j+z).getTime())}else if(_>u){var G=new Date(x),V=G.getFullYear(),Y=G.getMonth(x),H=G.getDate(),W=G.getHours(),X=r.snapTo(o,Math.ceil(_/u)),q=v(x,b);_=X*u;for(var U=0;U<=q+X;U+=X)m.push(new Date(V,Y,H,W+U).getTime())}else if(_>s){var Z=y(x,b),Q=Math.ceil(_/s);_=Q*s;for(var $=0;$<=Z+Q;$+=Q)m.push(x+$*s)}else{_<1e3&&(_=1e3),x=1e3*Math.floor(x/1e3);var J=Math.ceil((b-x)/1e3),K=Math.ceil(_/1e3);_=1e3*K;for(var tt=0;tt<J+K;tt+=K)m.push(x+1e3*tt)}}if(!m.length){x=1e3*Math.floor(x/1e3),b=1e3*Math.ceil(b/1e3),e=(b-x)/_;for(var et=0;et<=e;et++)m.push(r.fixedBase(_*et+x,_))}return{max:b,min:x,interval:_,ticks:m,count:m.length}}},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(26),a=n(11),o=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n._initDefaultCfg=function(){t.prototype._initDefaultCfg.call(this),this.isIdentity=!0,this.type="identity",this.value=null},n.getText=function(){return this.value.toString()},n.scale=function(t){return this.value!==t&&a(t)?t:this.range[0]},n.invert=function(){return this.value},e}(i);i.Identity=o,t.exports=o},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(2),a=n(26),o=n(48);function s(t,e){return 1===t?1:Math.log(e)/Math.log(t)}var u=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n._initDefaultCfg=function(){t.prototype._initDefaultCfg.call(this),this.type="log",this.tickCount=10,this.base=2,this._minTick=null},n.calculateTicks=function(){var t,e=this,n=e.base;if(e.min<0)throw new Error("The minimum value must be greater than zero!");var r=s(n,e.max);if(e.min>0)t=Math.floor(s(n,e.min));else{var a=e.values,o=e.max;i(a,function(t){t>0&&t<o&&(o=t)}),o===e.max&&(o=e.max/n),o>1&&(o=1),t=Math.floor(s(n,o)),e._minTick=t,e.positiveMin=o}for(var u=r-t,l=e.tickCount,c=Math.ceil(u/l),h=[],f=t;f<r+c;f+=c)h.push(Math.pow(n,f));return 0===e.min&&h.unshift(0),h},n._getScalePercent=function(t){var e=this.max,n=this.min;if(e===n)return 0;if(t<=0)return 0;var r,i=this.base,a=this.positiveMin;return a&&(n=1*a/i),r=t<a?t/a/(s(i,e)-s(i,n)):(s(i,t)-s(i,n))/(s(i,e)-s(i,n)),r},n.scale=function(t){var e=this._getScalePercent(t),n=this.rangeMin(),r=this.rangeMax();return n+e*(r-n)},n.invert=function(t){var e,n=this.base,r=s(n,this.max),i=this.rangeMin(),a=this.rangeMax()-i,o=this.positiveMin;if(o){if(0===t)return 0;e=s(n,o/n);var u=1/(r-e)*a;if(t<u)return t/u*o}else e=s(n,this.min);var l=(t-i)/a,c=l*(r-e)+e;return Math.pow(n,c)},e}(o);a.Log=u,t.exports=u},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(26),a=n(48);function o(t,e){var n=Math.E,r=Math.pow(n,Math.log(e)/t);return r}var s=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n._initDefaultCfg=function(){t.prototype._initDefaultCfg.call(this),this.type="pow",this.tickCount=10,this.exponent=2},n.calculateTicks=function(){var t,e=this,n=e.exponent,r=Math.ceil(o(n,e.max));if(t=e.min>=0?Math.floor(o(n,e.min)):0,t>r){var i=r;r=t,t=i}for(var a=r-t,s=e.tickCount,u=Math.ceil(a/s),l=[],c=t;c<r+u;c+=u)l.push(Math.pow(c,n));return l},n._getScalePercent=function(t){var e=this.max,n=this.min;if(e===n)return 0;var r=this.exponent,i=(o(r,t)-o(r,n))/(o(r,e)-o(r,n));return i},n.scale=function(t){var e=this._getScalePercent(t),n=this.rangeMin(),r=this.rangeMax();return n+e*(r-n)},n.invert=function(t){var e=(t-this.rangeMin())/(this.rangeMax()-this.rangeMin()),n=this.exponent,r=o(n,this.max),i=o(n,this.min),a=e*(r-i)+i;return Math.pow(a,n)},e}(a);i.Pow=s,t.exports=s},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(26),a=n(146),o=n(216),s=n(144),u=n(148),l=n(2),c=n(11),h=n(38),f=n(15),p=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n._initDefaultCfg=function(){t.prototype._initDefaultCfg.call(this),this.type="timeCat",this.sortable=!0,this.tickCount=5,this.mask="YYYY-MM-DD"},n.init=function(){var t=this,e=this.values;l(e,function(n,r){e[r]=t._toTimeStamp(n)}),this.sortable&&e.sort(function(t,e){return t-e}),t.ticks||(t.ticks=this.calculateTicks())},n.calculateTicks=function(){var t,e=this,n=e.tickCount;if(n){var r=s({maxCount:n,data:e.values,isRounding:e.isRounding});t=r.ticks}else t=e.values;return t},n.translate=function(t){t=this._toTimeStamp(t);var e=this.values.indexOf(t);return-1===e&&(e=c(t)&&t<this.values.length?t:NaN),e},n.scale=function(t){var e,n=this.rangeMin(),r=this.rangeMax(),i=this.translate(t);return e=1===this.values.length||isNaN(i)?i:i>-1?i/(this.values.length-1):0,n+e*(r-n)},n.getText=function(t){var e="",n=this.translate(t);e=n>-1?this.values[n]:t;var r=this.formatter;return e=parseInt(e,10),e=r?r(e):o.format(e,this.mask),e},n.getTicks=function(){var t=this,e=this.ticks,n=[];return l(e,function(e){var r;r=h(e)?e:{text:f(e)?e:t.getText(e),value:t.scale(e),tickValue:e},n.push(r)}),n},n._toTimeStamp=function(t){return u.toTimeStamp(t)},e}(a);i.TimeCat=p,t.exports=p},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(216),a=n(2),o=n(6),s=n(15),u=n(26),l=n(48),c=n(336),h=n(148),f=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n._initDefaultCfg=function(){t.prototype._initDefaultCfg.call(this),this.type="time",this.mask="YYYY-MM-DD"},n.init=function(){var e=this,n=e.values;if(n&&n.length){var r=[],i=1/0,s=i,u=0;a(n,function(t){var n=e._toTimeStamp(t);if(isNaN(n))throw new TypeError("Invalid Time: "+t);i>n?(s=i,i=n):s>n&&(s=n),u<n&&(u=n),r.push(n)}),n.length>1&&(e.minTickInterval=s-i),(o(e.min)||e._toTimeStamp(e.min)>i)&&(e.min=i),(o(e.max)||e._toTimeStamp(e.max)<u)&&(e.max=u)}t.prototype.init.call(this)},n.calculateTicks=function(){var t=this,e=t.min,n=t.max,r=t.tickCount,i=t.tickInterval,a=c({min:e,max:n,minCount:r,maxCount:r,interval:i,minInterval:t.minTickInterval});return a.ticks},n.getText=function(t){var e=this.formatter;return t=this.translate(t),t=e?e(t):i.format(t,this.mask),t},n.scale=function(e){return s(e)&&(e=this.translate(e)),t.prototype.scale.call(this,e)},n.translate=function(t){return this._toTimeStamp(t)},n._toTimeStamp=function(t){return h.toTimeStamp(t)},e}(l);u.Time=f,t.exports=f},function(t,e,n){var r=n(76),i=n(49),a=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return r(t,function(t){return!i(e,t)})};t.exports=a},function(t,e,n){var r=n(14),i=n(39),a=n(171);function o(t,e){var n=void 0;if(r(e)&&(n=e),i(e)&&(n=function(t){return a(t,e)}),n)for(var o=0;o<t.length;o+=1)if(n(t[o]))return t[o];return null}t.exports=o},function(t,e,n){var r=n(6),i=n(4),a=function(t,e){for(var n=null,a=0;a<t.length;a++){var o=t[a],s=o[e];if(!r(s)){n=i(s)?s[0]:s;break}}return n};t.exports=a},function(t,e,n){var r=n(4),i=function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(r(e))for(var i=0;i<e.length;i+=1)t(e[i],n);else n.push(e);return n};t.exports=i},function(t,e,n){var r=n(4),i=n(2),a=function(t){if(!r(t))return t;var e=[];return i(t,function(t){r(t)?i(t,function(t){e.push(t)}):e.push(t)}),e};t.exports=a},function(t,e,n){var r=n(76),i=n(4),a=function(t){if(t=r(t,function(t){return!isNaN(t)}),!t.length)return{min:0,max:0};if(i(t[0])){for(var e=[],n=0;n<t.length;n++)e=e.concat(t[n]);t=e}var a=Math.max.apply(null,t),o=Math.min.apply(null,t);return{min:o,max:a}};t.exports=a},function(t,e,n){t.exports={contains:n(49),difference:n(342),find:n(343),firstValue:n(344),flatten:n(346),flattenDeep:n(345),getRange:n(347),merge:n(50),pull:n(150),pullAt:n(149),reduce:n(349),remove:n(350),sortBy:n(351),union:n(352),uniq:n(151),valuesOfKey:n(73)}},function(t,e,n){var r=n(4),i=n(39),a=n(2),o=function(t,e,n){if(!r(t)&&!i(t))return t;var o=n;return a(t,function(t,n){o=e(o,t,n)}),o};t.exports=o},function(t,e,n){var r=n(20),i=n(149),a=function(t,e){var n=[];if(!r(t))return n;var a=-1,o=[],s=t.length;while(++a<s){var u=t[a];e(u,a,t)&&(n.push(u),o.push(a))}return i(t,o),n};t.exports=a},function(t,e,n){var r=n(15),i=n(14),a=n(4);function o(t,e){var n=void 0;if(i(e))n=function(t,n){return e(t)-e(n)};else{var o=[];r(e)?o.push(e):a(e)&&(o=e),n=function(t,e){for(var n=0;n<o.length;n+=1){var r=o[n];if(t[r]>e[r])return 1;if(t[r]<e[r])return-1}return 0}}return t.sort(n),t}t.exports=o},function(t,e,n){var r=n(2),i=n(53),a=n(151),o=function(){var t=[],e=i(arguments);return r(e,function(e){t=t.concat(e)}),a(t)};t.exports=o},function(t,e){function n(t,e,n){var r=void 0;return function(){var i=this,a=arguments,o=function(){r=null,n||t.apply(i,a)},s=n&&!r;clearTimeout(r),r=setTimeout(o,e),s&&t.apply(i,a)}}t.exports=n},function(t,e){t.exports=function(t,e,n){if(t){if(t.addEventListener)return t.addEventListener(e,n,!1),{remove:function(){t.removeEventListener(e,n,!1)}};if(t.attachEvent)return t.attachEvent("on"+e,n),{remove:function(){t.detachEvent("on"+e,n)}}}}},function(t,e){t.exports=function(t,e){if(t&&t.getBoundingClientRect){var n=t.getBoundingClientRect(),r=document.documentElement.clientTop,i=document.documentElement.clientLeft;return{top:n.top-r,bottom:n.bottom-r,left:n.left-i,right:n.right-i}}return e||null}},function(t,e){t.exports=function(t,e){var n=this.getStyle(t,"height",e);return"auto"===n&&(n=t.offsetHeight),parseFloat(n)}},function(t,e){t.exports=function(t,e){var n=this.getHeight(t,e),r=parseFloat(this.getStyle(t,"borderTopWidth"))||0,i=parseFloat(this.getStyle(t,"paddingTop"))||0,a=parseFloat(this.getStyle(t,"paddingBottom"))||0,o=parseFloat(this.getStyle(t,"borderBottomWidth"))||0;return n+r+o+i+a}},function(t,e){t.exports=function(t,e){var n=this.getWidth(t,e),r=parseFloat(this.getStyle(t,"borderLeftWidth"))||0,i=parseFloat(this.getStyle(t,"paddingLeft"))||0,a=parseFloat(this.getStyle(t,"paddingRight"))||0,o=parseFloat(this.getStyle(t,"borderRightWidth"))||0;return n+r+o+i+a}},function(t,e){t.exports=function(){return window.devicePixelRatio?window.devicePixelRatio:2}},function(t,e,n){var r=n(6);t.exports=function(t,e,n){try{return window.getComputedStyle?window.getComputedStyle(t,null)[e]:t.currentStyle[e]}catch(t){return r(n)?null:n}}},function(t,e){t.exports=function(t,e){var n=this.getStyle(t,"width",e);return"auto"===n&&(n=t.offsetWidth),parseFloat(n)}},function(t,e,n){t.exports={addEventListener:n(354),createDom:n(153),getBoundingClientRect:n(355),getHeight:n(356),getOuterHeight:n(357),getOuterWidth:n(358),getRatio:n(359),getStyle:n(360),getWidth:n(361),modifyCSS:n(154),requestAnimationFrame:n(155)}},function(t,e){function n(t,e){return t["_wrap_"+e]}t.exports=n},function(t,e,n){t.exports={getWrapBehavior:n(363),wrapBehavior:n(365)}},function(t,e){function n(t,e){if(t["_wrap_"+e])return t["_wrap_"+e];var n=function(n){t[e](n)};return t["_wrap_"+e]=n,n}t.exports=n},function(t,e,n){var r=n(367);t.exports={number2color:r,numberToColor:r,parsePath:n(368),parseRadius:n(369)}},function(t,e){var n={};t.exports=function(t){var e=n[t];if(!e){for(var r=t.toString(16),i=r.length;i<6;i++)r="0"+r;e="#"+r,n[t]=e}return e}},function(t,e,n){var r=n(4),i=n(15),a=n(2),o=/[MLHVQTCSAZ]([^MLHVQTCSAZ]*)/gi,s=/[^\s\,]+/gi;t.exports=function(t){return t=t||[],r(t)?t:i(t)?(t=t.match(o),a(t,function(e,n){if(e=e.match(s),e[0].length>1){var r=e[0].charAt(0);e.splice(1,0,e[0].substr(1)),e[0]=r}a(e,function(t,n){isNaN(t)||(e[n]=+t)}),t[n]=e}),t):void 0}},function(t,e,n){var r=n(4);t.exports=function(t){var e=0,n=0,i=0,a=0;return r(t)?1===t.length?e=n=i=a=t[0]:2===t.length?(e=i=t[0],n=a=t[1]):3===t.length?(e=t[0],n=a=t[1],i=t[2]):(e=t[0],n=t[1],i=t[2],a=t[3]):e=n=i=a=t,{r1:e,r2:n,r3:i,r4:a}}},function(t,e,n){var r=n(20),i=function(t,e){if(!r(t))return-1;var n=Array.prototype.indexOf;if(n)return n.call(t,e);for(var i=-1,a=0;a<t.length;a++)if(t[a]===e){i=a;break}return i};t.exports=i},function(t,e,n){var r=n(14),i=n(77),a=function(t,e,n){return r(n)?!!n(t,e):i(t,e)};t.exports=a},function(t,e,n){var r=n(2),i=n(20),a=function(t,e){if(!i(t))return t;var n=[];return r(t,function(t,r){n.push(e(t,r))}),n};t.exports=a},function(t,e){var n=function(t,e){var n=e.toString(),r=n.indexOf(".");if(-1===r)return Math.round(t);var i=n.substr(r+1).length;return i>20&&(i=20),parseFloat(t.toFixed(i))};t.exports=n},function(t,e,n){var r=n(51);t.exports={clamp:n(78),fixedBase:n(373),isDecimal:n(375),isEven:n(376),isInteger:n(377),isNegative:n(378),isNumberEqual:r,isOdd:n(379),isPositive:n(380),maxBy:n(162),minBy:n(381),mod:n(163),snapEqual:r,toDegree:n(164),toInt:n(165),toInteger:n(165),toRadian:n(166)}},function(t,e,n){var r=n(11),i=function(t){return r(t)&&t%1!==0};t.exports=i},function(t,e,n){var r=n(11),i=function(t){return r(t)&&t%2===0};t.exports=i},function(t,e,n){var r=n(11),i=Number.isInteger?Number.isInteger:function(t){return r(t)&&t%1===0};t.exports=i},function(t,e,n){var r=n(11),i=function(t){return r(t)&&t<0};t.exports=i},function(t,e,n){var r=n(11),i=function(t){return r(t)&&t%2!==0};t.exports=i},function(t,e,n){var r=n(11),i=function(t){return r(t)&&t>0};t.exports=i},function(t,e,n){var r=n(4),i=n(14),a=n(2),o=function(t,e){if(r(t)){var n=t[0],o=void 0;o=i(e)?e(t[0]):t[0][e];var s=void 0;return a(t,function(t){s=i(e)?e(t):t[e],s<o&&(n=t,o=s)}),n}};t.exports=o},function(t,e,n){t.exports=n(2)},function(t,e,n){t.exports=n(170)},function(t,e,n){var r=n(49),i=n(173);t.exports=function(t,e){return r(i(t),e)}},function(t,e,n){t.exports={forIn:n(382),has:n(170),hasKey:n(383),hasValue:n(384),keys:n(172),isMatch:n(171),values:n(173)}},function(t,e,n){var r=n(390);function i(t,e,n){var r=null,i=n;return e<i&&(i=e,r="add"),t<i&&(i=t,r="del"),{type:r,min:i}}var a=function(t,e){var n=t.length,a=e.length,o=void 0,s=void 0,u=0;if(0===n||0===a)return null;for(var l=[],c=0;c<=n;c++)l[c]=[],l[c][0]={min:c};for(var h=0;h<=a;h++)l[0][h]={min:h};for(var f=1;f<=n;f++){o=t[f-1];for(var p=1;p<=a;p++){s=e[p-1],u=r(o,s)?0:1;var d=l[f-1][p].min+1,g=l[f][p-1].min+1,v=l[f-1][p-1].min+u;l[f][p]=i(d,g,v)}}return l};t.exports=function(t,e){var n=a(t,e),r=t.length,i=e.length,o=[],s=1,u=1;if(n[r][i]!==r){for(var l=1;l<=r;l++){var c=n[l][l].min;u=l;for(var h=s;h<=i;h++)n[l][h].min<c&&(c=n[l][h].min,u=h);s=u,n[l][s].type&&o.push({index:l-1,type:n[l][s].type})}for(var f=o.length-1;f>=0;f--)s=o[f].index,"add"===o[f].type?t.splice(s,0,[].concat(t[s])):t.splice(s,1)}if(r=t.length,r<i)for(var p=0;p<i-r;p++)"z"===t[r-1][0]||"Z"===t[r-1][0]?t.splice(r-2,0,t[r-2]):t.push(t[r-1]);return t}},function(t,e){function n(t,e){var n=[],r=[];function i(t,e){if(1===t.length)n.push(t[0]),r.push(t[0]);else{for(var a=[],o=0;o<t.length-1;o++)0===o&&n.push(t[0]),o===t.length-2&&r.push(t[o+1]),a[o]=[(1-e)*t[o][0]+e*t[o+1][0],(1-e)*t[o][1]+e*t[o+1][1]];i(a,e)}}return t.length&&i(t,e),{left:n,right:r.reverse()}}function r(t,e,r){var i=[[t[1],t[2]]];r=r||2;var a=[];"A"===e[0]?(i.push(e[6]),i.push(e[7])):"C"===e[0]?(i.push([e[1],e[2]]),i.push([e[3],e[4]]),i.push([e[5],e[6]])):"S"===e[0]||"Q"===e[0]?(i.push([e[1],e[2]]),i.push([e[3],e[4]])):i.push([e[1],e[2]]);for(var o=i,s=1/r,u=0;u<r-1;u++){var l=s/(1-s*u),c=n(o,l);a.push(c.left),o=c.right}a.push(o);var h=a.map(function(t){var e=[];return 4===t.length&&(e.push("C"),e=e.concat(t[2])),t.length>=3&&(3===t.length&&e.push("Q"),e=e.concat(t[1])),2===t.length&&e.push("L"),e=e.concat(t[t.length-1]),e});return h}function i(t,e,n){if(1===n)return[[].concat(t)];var i=[];if("L"===e[0]||"C"===e[0]||"Q"===e[0])i=i.concat(r(t,e,n));else{var a=[].concat(t);"M"===a[0]&&(a[0]="L");for(var o=0;o<=n-1;o++)i.push(a)}return i}t.exports=function(t,e){if(1===t.length)return t;var n=t.length-1,r=e.length-1,a=n/r,o=[];if(1===t.length&&"M"===t[0][0]){for(var s=0;s<r-n;s++)t.push(t[0]);return t}for(var u=0;u<r;u++){var l=Math.floor(a*u);o[l]=(o[l]||0)+1}var c=o.reduce(function(e,r,a){return a===n?e.concat(t[n]):e.concat(i(t[a],t[a+1],r))},[]);return c.unshift(t[0]),"Z"!==e[r]&&"z"!==e[r]||c.push("Z"),c}},function(t,e){function n(t){var e=[];switch(t[0]){case"M":e.push([t[1],t[2]]);break;case"L":e.push([t[1],t[2]]);break;case"A":e.push([t[6],t[7]]);break;case"Q":e.push([t[3],t[4]]),e.push([t[1],t[2]]);break;case"T":e.push([t[1],t[2]]);break;case"C":e.push([t[5],t[6]]),e.push([t[1],t[2]]),e.push([t[3],t[4]]);break;case"S":e.push([t[3],t[4]]),e.push([t[1],t[2]]);break;case"H":e.push([t[1],t[1]]);break;case"V":e.push([t[1],t[1]]);break;default:}return e}function r(t,e,r){for(var i=[].concat(t),a=void 0,o=1/(r+1),s=n(e)[0],u=1;u<=r;u++)o*=u,a=Math.floor(t.length*o),0===a?i.unshift([s[0]*o+t[a][0]*(1-o),s[1]*o+t[a][1]*(1-o)]):i.splice(a,0,[s[0]*o+t[a][0]*(1-o),s[1]*o+t[a][1]*(1-o)]);return i}t.exports=function(t,e){if(t.length<=1)return t;for(var i=void 0,a=0;a<e.length;a++)if(t[a][0]!==e[a][0])switch(i=n(t[a]),e[a][0]){case"M":t[a]=["M"].concat(i[0]);break;case"L":t[a]=["L"].concat(i[0]);break;case"A":t[a]=[].concat(e[a]),t[a][6]=i[0][0],t[a][7]=i[0][1];break;case"Q":if(i.length<2){if(!(a>0)){t[a]=e[a];break}i=r(i,t[a-1],1)}t[a]=["Q"].concat(i.reduce(function(t,e){return t.concat(e)},[]));break;case"T":t[a]=["T"].concat(i[0]);break;case"C":if(i.length<3){if(!(a>0)){t[a]=e[a];break}i=r(i,t[a-1],2)}t[a]=["C"].concat(i.reduce(function(t,e){return t.concat(e)},[]));break;case"S":if(i.length<2){if(!(a>0)){t[a]=e[a];break}i=r(i,t[a-1],1)}t[a]=["S"].concat(i.reduce(function(t,e){return t.concat(e)},[]));break;default:t[a]=e[a]}return t}},function(t,e,n){var r=n(391),i=n(177),a=n(178),o=n(174);t.exports={catmullRom2Bezier:o,catmullRomToBezier:o,fillPath:n(387),fillPathByDiff:n(386),formatPath:n(388),intersection:r,pathIntersection:r,parsePathArray:n(175),parsePathString:n(176),pathToAbsolute:i,path2absolute:i,pathTocurve:a,path2curve:a,rectPath:n(179)}},function(t,e,n){var r=n(2);t.exports=function(t,e){if(t.length!==e.length)return!1;var n=!0;return r(t,function(t,r){if(t!==e[r])return n=!1,!1}),n}},function(t,e,n){var r=n(4),i=n(179),a=n(178),o=function(t,e,n,r,i){var a=-3*e+9*n-9*r+3*i,o=t*a+6*e-12*n+6*r;return t*o-3*e+3*n},s=function(t,e,n,r,i,a,s,u,l){null===l&&(l=1),l=l>1?1:l<0?0:l;for(var c=l/2,h=12,f=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],p=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],d=0,g=0;g<h;g++){var v=c*f[g]+c,y=o(v,t,n,i,s),m=o(v,e,r,a,u),x=y*y+m*m;d+=p[g]*Math.sqrt(x)}return c*d},u=function(t,e,n,r,i,a,o,s){for(var u=[],l=[[],[]],c=void 0,h=void 0,f=void 0,p=void 0,d=0;d<2;++d)if(0===d?(h=6*t-12*n+6*i,c=-3*t+9*n-9*i+3*o,f=3*n-3*t):(h=6*e-12*r+6*a,c=-3*e+9*r-9*a+3*s,f=3*r-3*e),Math.abs(c)<1e-12){if(Math.abs(h)<1e-12)continue;p=-f/h,p>0&&p<1&&u.push(p)}else{var g=h*h-4*f*c,v=Math.sqrt(g);if(!(g<0)){var y=(-h+v)/(2*c);y>0&&y<1&&u.push(y);var m=(-h-v)/(2*c);m>0&&m<1&&u.push(m)}}var x=u.length,b=x,_=void 0;while(x--)p=u[x],_=1-p,l[0][x]=_*_*_*t+3*_*_*p*n+3*_*p*p*i+p*p*p*o,l[1][x]=_*_*_*e+3*_*_*p*r+3*_*p*p*a+p*p*p*s;return l[0][b]=t,l[1][b]=e,l[0][b+1]=o,l[1][b+1]=s,l[0].length=l[1].length=b+2,{min:{x:Math.min.apply(0,l[0]),y:Math.min.apply(0,l[1])},max:{x:Math.max.apply(0,l[0]),y:Math.max.apply(0,l[1])}}},l=function(t,e,n,r,i,a,o,s){if(!(Math.max(t,n)<Math.min(i,o)||Math.min(t,n)>Math.max(i,o)||Math.max(e,r)<Math.min(a,s)||Math.min(e,r)>Math.max(a,s))){var u=(t*r-e*n)*(i-o)-(t-n)*(i*s-a*o),l=(t*r-e*n)*(a-s)-(e-r)*(i*s-a*o),c=(t-n)*(a-s)-(e-r)*(i-o);if(c){var h=u/c,f=l/c,p=+h.toFixed(2),d=+f.toFixed(2);if(!(p<+Math.min(t,n).toFixed(2)||p>+Math.max(t,n).toFixed(2)||p<+Math.min(i,o).toFixed(2)||p>+Math.max(i,o).toFixed(2)||d<+Math.min(e,r).toFixed(2)||d>+Math.max(e,r).toFixed(2)||d<+Math.min(a,s).toFixed(2)||d>+Math.max(a,s).toFixed(2)))return{x:h,y:f}}}},c=function(t,e,n){return e>=t.x&&e<=t.x+t.width&&n>=t.y&&n<=t.y+t.height},h=function(t,e,n,r){return null===t&&(t=e=n=r=0),null===e&&(e=t.y,n=t.width,r=t.height,t=t.x),{x:t,y:e,width:n,w:n,height:r,h:r,x2:t+n,y2:e+r,cx:t+n/2,cy:e+r/2,r1:Math.min(n,r)/2,r2:Math.max(n,r)/2,r0:Math.sqrt(n*n+r*r)/2,path:i(t,e,n,r),vb:[t,e,n,r].join(" ")}},f=function(t,e){return t=h(t),e=h(e),c(e,t.x,t.y)||c(e,t.x2,t.y)||c(e,t.x,t.y2)||c(e,t.x2,t.y2)||c(t,e.x,e.y)||c(t,e.x2,e.y)||c(t,e.x,e.y2)||c(t,e.x2,e.y2)||(t.x<e.x2&&t.x>e.x||e.x<t.x2&&e.x>t.x)&&(t.y<e.y2&&t.y>e.y||e.y<t.y2&&e.y>t.y)},p=function(t,e,n,i,a,o,s,l){r(t)||(t=[t,e,n,i,a,o,s,l]);var c=u.apply(null,t);return h(c.min.x,c.min.y,c.max.x-c.min.x,c.max.y-c.min.y)},d=function(t,e,n,r,i,a,o,s,u){var l=1-u,c=Math.pow(l,3),h=Math.pow(l,2),f=u*u,p=f*u,d=c*t+3*h*u*n+3*l*u*u*i+p*o,g=c*e+3*h*u*r+3*l*u*u*a+p*s,v=t+2*u*(n-t)+f*(i-2*n+t),y=e+2*u*(r-e)+f*(a-2*r+e),m=n+2*u*(i-n)+f*(o-2*i+n),x=r+2*u*(a-r)+f*(s-2*a+r),b=l*t+u*n,_=l*e+u*r,w=l*i+u*o,M=l*a+u*s,S=90-180*Math.atan2(v-m,y-x)/Math.PI;return{x:d,y:g,m:{x:v,y:y},n:{x:m,y:x},start:{x:b,y:_},end:{x:w,y:M},alpha:S}},g=function(t,e,n){var r=p(t),i=p(e);if(!f(r,i))return n?0:[];for(var a=s.apply(0,t),o=s.apply(0,e),u=~~(a/8),c=~~(o/8),h=[],g=[],v={},y=n?0:[],m=0;m<u+1;m++){var x=d.apply(0,t.concat(m/u));h.push({x:x.x,y:x.y,t:m/u})}for(var b=0;b<c+1;b++){var _=d.apply(0,e.concat(b/c));g.push({x:_.x,y:_.y,t:b/c})}for(var w=0;w<u;w++)for(var M=0;M<c;M++){var S=h[w],C=h[w+1],k=g[M],A=g[M+1],P=Math.abs(C.x-S.x)<.001?"y":"x",I=Math.abs(A.x-k.x)<.001?"y":"x",T=l(S.x,S.y,C.x,C.y,k.x,k.y,A.x,A.y);if(T){if(v[T.x.toFixed(4)]===T.y.toFixed(4))continue;v[T.x.toFixed(4)]=T.y.toFixed(4);var O=S.t+Math.abs((T[P]-S[P])/(C[P]-S[P]))*(C.t-S.t),E=k.t+Math.abs((T[I]-k[I])/(A[I]-k[I]))*(A.t-k.t);O>=0&&O<=1&&E>=0&&E<=1&&(n?y++:y.push({x:T.x,y:T.y,t1:O,t2:E}))}}return y},v=function(t,e,n){t=a(t),e=a(e);for(var r=void 0,i=void 0,o=void 0,s=void 0,u=void 0,l=void 0,c=void 0,h=void 0,f=void 0,p=void 0,d=n?0:[],v=0,y=t.length;v<y;v++){var m=t[v];if("M"===m[0])r=u=m[1],i=l=m[2];else{"C"===m[0]?(f=[r,i].concat(m.slice(1)),r=f[6],i=f[7]):(f=[r,i,r,i,u,l,u,l],r=u,i=l);for(var x=0,b=e.length;x<b;x++){var _=e[x];if("M"===_[0])o=c=_[1],s=h=_[2];else{"C"===_[0]?(p=[o,s].concat(_.slice(1)),o=p[6],s=p[7]):(p=[o,s,o,s,c,h,c,h],o=c,s=h);var w=g(f,p,n);if(n)d+=w;else{for(var M=0,S=w.length;M<S;M++)w[M].segment1=v,w[M].segment2=x,w[M].bez1=f,w[M].bez2=p;d=d.concat(w)}}}}}return d};t.exports=function(t,e){return v(t,e)}},function(t,e,n){var r=n(2),i=n(39),a=Object.prototype.hasOwnProperty,o=function(t,e){if(null===t||!i(t))return{};var n={};return r(e,function(e){a.call(t,e)&&(n[e]=t[e])}),n};t.exports=o},function(t,e,n){var r={lc:n(394),lowerCase:n(180),lowerFirst:n(181),substitute:n(395),uc:n(396),upperCase:n(182),upperFirst:n(183)};t.exports=r},function(t,e,n){t.exports=n(180)},function(t,e){var n=function(t,e){return t&&e?t.replace(/\\?\{([^{}]+)\}/g,function(t,n){return"\\"===t.charAt(0)?t.slice(1):void 0===e[n]?"":e[n]}):t};t.exports=n},function(t,e,n){t.exports=n(182)},function(t,e){function n(t,e,n){var r=void 0,i=void 0,a=void 0,o=void 0,s=0;n||(n={});var u=function(){s=!1===n.leading?0:Date.now(),r=null,o=t.apply(i,a),r||(i=a=null)},l=function(){var l=Date.now();s||!1!==n.leading||(s=l);var c=e-(l-s);return i=this,a=arguments,c<=0||c>e?(r&&(clearTimeout(r),r=null),s=l,o=t.apply(i,a),r||(i=a=null)):r||!1===n.trailing||(r=setTimeout(u,c)),o};return l.cancel=function(){clearTimeout(r),s=0,r=i=a=null},l}t.exports=n},function(t,e,n){var r=n(16),i={getType:n(184),isArray:n(4),isArrayLike:n(20),isBoolean:n(185),isFunction:n(14),isNil:n(6),isNull:n(401),isNumber:n(11),isObject:n(38),isObjectLike:n(80),isPlainObject:n(39),isPrototype:n(187),isType:r,isUndefined:n(403),isString:n(15),isRegExp:n(402),isDate:n(186),isArguments:n(399),isError:n(400)};t.exports=i},function(t,e,n){var r=n(16),i=function(t){return r(t,"Arguments")};t.exports=i},function(t,e,n){var r=n(16),i=function(t){return r(t,"Error")};t.exports=i},function(t,e){var n=function(t){return null===t};t.exports=n},function(t,e,n){var r=n(16),i=function(t){return r(t,"RegExp")};t.exports=i},function(t,e){var n=function(t){return void 0===t};t.exports=n},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(24),i=a(r);function a(t){return t&&t.__esModule?t:{default:t}}e.default=i.default.generateBaseTypedComponent("Axis")},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),i=n(41),a=c(i),o=n(28),s=c(o),u=n(219),l=c(u);function c(t){return t&&t.__esModule?t:{default:t}}function h(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function f(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!==typeof e&&"function"!==typeof e?t:e}function p(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(0,l.default)(a.default.PureComponent,"`React.PureComponent` needs React >=15.3.0");var d=function(t){function e(){return h(this,e),f(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return p(e,t),r(e,[{key:"render",value:function(){var t=this.props,e=t.width,n=t.height,r=t.placeholder;return a.default.createElement("div",{style:{width:e,height:n}},r)}}]),e}(a.default.PureComponent||a.default.Component);d.propTypes={width:s.default.oneOfType([s.default.string,s.default.number]),height:s.default.oneOfType([s.default.string,s.default.number]),placeholder:s.default.node},d.defaultProps={width:"100%",placeholder:a.default.createElement("div",{style:{position:"relative",top:"48%",textAlign:"center"}},"\u6682\u65e0\u6570\u636e")},e.default=d},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},i=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),a=n(41),o=p(a),s=n(407),u=p(s),l=n(405),c=p(l),h=n(409),f=p(h);function p(t){return t&&t.__esModule?t:{default:t}}function d(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function g(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!==typeof e&&"function"!==typeof e?t:e}function v(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function y(t){var e=!0;return null!=t&&0!==t.length||(e=!1),!!e}var m=function(t){function e(){var t,n,r,i;d(this,e);for(var a=arguments.length,s=Array(a),u=0;u<a;u++)s[u]=arguments[u];return r=g(this,(t=e.__proto__||Object.getPrototypeOf(e)).call.apply(t,[this].concat(s))),n=r,r._refCallback=function(t){t&&(r.chart=t.getG2Instance())},r.hasViewSource=function(){var t=!1;return o.default.Children.map(r.props.children,function(e){!t&&e&&"function"===typeof e.type&&"View"===e.type.name&&e.props.data&&y(e.props.data)&&(t=!0)}),t},i=n,g(r,i)}return v(e,t),i(e,[{key:"getG2Instance",value:function(){return this.chart}},{key:"render",value:function(){var t=this.props,e=t.data,n=t.width,i=t.height,a=t.placeholder,s=t.className,l=t.style;return o.default.createElement("div",{className:s,style:l},y(e)||this.hasViewSource()||!a?o.default.createElement(u.default,r({ref:this._refCallback},this.props)):o.default.createElement(c.default,{width:n,height:i,placeholder:!0===a?void 0:a}))}}]),e}(o.default.PureComponent||o.default.Component),x=function(t){function e(){return d(this,e),g(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return v(e,t),i(e,[{key:"render",value:function(){return o.default.createElement(f.default,null,o.default.createElement(m,this.props))}}]),e}(o.default.Component);e.default=x},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},i=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),a=n(41),o=h(a),s=n(28),u=h(s),l=n(421),c=h(l);function h(t){return t&&t.__esModule?t:{default:t}}function f(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function p(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!==typeof e&&"function"!==typeof e?t:e}function d(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var g=function(t){function e(t){f(this,e);var n=p(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return v.call(n),n.name="Chart",n.gId=0,n.id=n.createId(),n.g2Processor=new c.default,n}return d(e,t),i(e,[{key:"getChildContext",value:function(){return{addElement:this.addElement,updateElement:this.updateElement,deleteElement:this.deleteElement,createId:this.createId,getParentInfo:this.getParentInfo,getViewId:this.getViewId}}},{key:"componentDidMount",value:function(){this.addElement(this.name,this.id,r({},this.props,{container:this.containerWrap})),this.chart=this.g2Processor.createG2Instance(),this.notifyG2Instance()}},{key:"componentDidUpdate",value:function(){this.updateElement(this.name,this.id,r({},this.props,{container:this.containerWrap}));var t=this.g2Processor.batchedUpdate();this.chart!==t&&(this.chart=t,this.notifyG2Instance())}},{key:"componentWillUnmount",value:function(){this.g2Processor.destory(),this.chart=null,this.containerWrap=null}},{key:"getG2Instance",value:function(){return this.chart}},{key:"notifyG2Instance",value:function(){this.props.onGetG2Instance&&this.props.onGetG2Instance(this.chart)}},{key:"render",value:function(){return o.default.createElement("div",{ref:this.refHandle},this.props.children)}}]),e}(a.Component);g.propTypes={data:u.default.oneOfType([u.default.arrayOf(u.default.object),u.default.object]),scale:u.default.oneOfType([u.default.object,u.default.array]),animate:u.default.bool,width:u.default.number,height:u.default.number.isRequired,onGetG2Instance:u.default.func},g.childContextTypes={addElement:u.default.func,updateElement:u.default.func,deleteElement:u.default.func,createId:u.default.func,getParentInfo:u.default.func,getViewId:u.default.func};var v=function(){var t=this;this.getViewId=function(){},this.getParentInfo=function(){return{id:t.id,name:t.name}},this.createId=function(){return t.gId+=1,t.gId},this.addElement=function(e,n,r,i,a){return t.g2Processor.addElement(e,n,r,i,a)},this.updateElement=function(e,n,r,i,a){t.g2Processor.updateElement(e,n,r,i,a)},this.deleteElement=function(e,n,r){t.g2Processor.deleteElement(e,n,r)},this.refHandle=function(e){t.containerWrap||(t.containerWrap=e)}};e.default=g},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(24),i=a(r);function a(t){return t&&t.__esModule?t:{default:t}}e.default=i.default.generateBaseTypedComponent("Coord")},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),i=n(41),a=o(i);function o(t){return t&&t.__esModule?t:{default:t}}function s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function u(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!==typeof e&&"function"!==typeof e?t:e}function l(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var c=function(t){function e(t){s(this,e);var n=u(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return n.state={hasError:!1},n}return l(e,t),r(e,[{key:"componentDidCatch",value:function(){this.setState({hasError:!0})}},{key:"unstable_handleError",value:function(){this.setState({hasError:!0})}},{key:"render",value:function(){return this.state.hasError?a.default.createElement("h1",null,"bizcharts error."):this.props.children}}]),e}(a.default.Component);e.default=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),n(279);var r=n(24),i=a(r);function a(t){return t&&t.__esModule?t:{default:t}}e.default=i.default.generateBaseTypedComponent("Facet")},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),n(286);var r=n(24),i=a(r);function a(t){return t&&t.__esModule?t:{default:t}}e.default=i.default.generateBaseTypedComponent("Geom")},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(24),i=a(r);function a(t){return t&&t.__esModule?t:{default:t}}var o=i.default.generateBaseTypedComponent("Guide");o.Line=i.default.generateBaseTypedComponent("GuideLine"),o.Image=i.default.generateBaseTypedComponent("GuideImage"),o.Text=i.default.generateBaseTypedComponent("GuideText"),o.Region=i.default.generateBaseTypedComponent("GuideRegion"),o.Html=i.default.generateBaseTypedComponent("GuideHtml"),o.Arc=i.default.generateBaseTypedComponent("GuideArc"),o.RegionFilter=i.default.generateBaseTypedComponent("GuideRegionFilter"),o.DataMarker=i.default.generateBaseTypedComponent("GuideDataMarker"),o.DataRegion=i.default.generateBaseTypedComponent("GuideDataRegion"),e.default=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),i=n(521),a=c(i),o=n(24),s=c(o),u=n(28),l=c(u);function c(t){return t&&t.__esModule?t:{default:t}}function h(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function f(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!==typeof e&&"function"!==typeof e?t:e}function p(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var d=function(t){function e(t){return h(this,e),f(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,"Label"))}return p(e,t),r(e,[{key:"componentWillMount",value:function(){var t=this.context.getParentInfo();(0,a.default)("Geom"===t.name,"`<Label />` must be wrapped in `<Geom />`"),this.id=this.context.createId(),this.context.addElement(this.name,this.id,this.props,this.context.getParentInfo(),this.context.getViewId())}}]),e}(s.default);d.contextTypes={addElement:l.default.func,updateElement:l.default.func,deleteElement:l.default.func,createId:l.default.func,getParentInfo:l.default.func,getViewId:l.default.func},d.childContextTypes={addElement:l.default.func,updateElement:l.default.func,deleteElement:l.default.func,createId:l.default.func,getParentInfo:l.default.func,getViewId:l.default.func},e.default=d},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(24),i=s(r),a=n(28),o=s(a);function s(t){return t&&t.__esModule?t:{default:t}}function u(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function l(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!==typeof e&&"function"!==typeof e?t:e}function c(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var h=function(t){function e(t){return u(this,e),l(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,"Legend"))}return c(e,t),e}(i.default);h.contextTypes={addElement:o.default.func,updateElement:o.default.func,deleteElement:o.default.func,createId:o.default.func,getParentInfo:o.default.func,getViewId:o.default.func},h.childContextTypes={addElement:o.default.func,updateElement:o.default.func,deleteElement:o.default.func,createId:o.default.func,getParentInfo:o.default.func,getViewId:o.default.func},h.defaultProps={visible:!0},e.default=h},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(24),i=a(r);function a(t){return t&&t.__esModule?t:{default:t}}e.default=i.default.generateBaseTypedComponent("Tooltip")},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),i=n(24),a=u(i),o=n(28),s=u(o);function u(t){return t&&t.__esModule?t:{default:t}}function l(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function c(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!==typeof e&&"function"!==typeof e?t:e}function h(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var f=function(t){function e(t){l(this,e);var n=c(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,"View"));return n.getViewId=function(){return n.id},n}return h(e,t),r(e,[{key:"getChildContext",value:function(){return{addElement:this.context.addElement,updateElement:this.context.updateElement,deleteElement:this.context.deleteElement,createId:this.context.createId,getParentInfo:this.getParentInfo,getViewId:this.getViewId}}}]),e}(a.default);f.contextTypes={addElement:s.default.func,updateElement:s.default.func,deleteElement:s.default.func,createId:s.default.func,getParentInfo:s.default.func,getViewId:s.default.func},f.childContextTypes={addElement:s.default.func,updateElement:s.default.func,deleteElement:s.default.func,createId:s.default.func,getParentInfo:s.default.func,getViewId:s.default.func},e.default=f},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Facet=e.Label=e.Guide=e.View=e.Geom=e.Tooltip=e.Legend=e.Axis=e.Coord=e.Chart=void 0;var r=n(406),i=M(r),a=n(408),o=M(a),s=n(404),u=M(s),l=n(414),c=M(l),h=n(415),f=M(h),p=n(411),d=M(p),g=n(416),v=M(g),y=n(412),m=M(y),x=n(413),b=M(x),_=n(410),w=M(_);function M(t){return t&&t.__esModule?t:{default:t}}e.Chart=i.default,e.Coord=o.default,e.Axis=u.default,e.Legend=c.default,e.Tooltip=f.default,e.Geom=d.default,e.View=v.default,e.Guide=m.default,e.Label=b.default,e.Facet=w.default},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r={Chart:"addChart",Coord:"addCoord",Geom:"addGeom",Axis:"addAxis",Tooltip:"addTooltip",Legend:"addLegend",Label:"addLabel",View:"addView",Guide:"addGuide",GuideLine:"addGuideLine",GuideImage:"addGuideImage",GuideText:"addGuideText",GuideRegion:"addGuideRegion",GuideHtml:"addGuideHtml",GuideArc:"addGuideArc",GuideRegionFilter:"addGuideRegionFilter",GuideDataMarker:"addGuideDataMarker",GuideDataRegion:"addGuideDataRegion",Facet:"addFacet"},i={addElement:function(t,e,n){this[r[t]](e,n,n.id,n.viewId,n.parentInfo)},getConfigContainer:function(t,e){return e&&(t.views||(t.views={}),t=t.views[e],t||(t={},t.views[e]=t)),t},addUniqueElement:function(t,e,n,r,i){var a=this.getConfigContainer(t,i);return a[e],a[e]=n,r},addChart:function(t,e,n){return this.addUniqueElement(t,"chart",e,n,null)},addView:function(t,e,n){return t.views||(t.views={}),t.views[n]=e,n},addAxis:function(t,e,n,r){var i=this.getConfigContainer(t,r);return i.axises||(i.axises={}),i.axises[n]=e,n},addCoord:function(t,e,n,r){return this.addUniqueElement(t,"coord",e,n,r)},addGeom:function(t,e,n,r,i){var a=this.getConfigContainer(t,r);return a.geoms||(a.geoms={}),a.geoms[n]?i?a.geoms[n].label=e.label:(a.geoms[n].label||console.log("geom label error"),e.label=a.geoms[n].label,a.geoms[n]=e):a.geoms[n]=e,n},addLabel:function(t,e,n,r,i){var a=this.getConfigContainer(t,r);return a.geoms||(a.geoms={}),this.addGeom(t,{label:e},i.id,r,!0),n},addTooltip:function(t,e,n,r){return this.addUniqueElement(t,"tooltip",e,n,r)},addFacet:function(t,e,n,r){return this.addUniqueElement(t,"facet",e,n,r)},addLegend:function(t,e,n,r){var i=this.getConfigContainer(t,r);return i.legends||(i.legends={}),i.legends[n]=e,n},addGuide:function(t,e,n,r){return this.addUniqueElement(t,"guide",e,n,r)},addTypedGuide:function(t,e,n,r,i,a){var o=this.getConfigContainer(t,i),s=o.guide;return s||(this.addUniqueElement("guide",{},a.id,i),s=o.guide),s.elements||(s.elements={}),n.type=e,s.elements[r]=n,r},addGuideLine:function(t,e,n,r,i){this.addTypedGuide(t,"line",e,n,r,i)},addGuideImage:function(t,e,n,r,i){this.addTypedGuide(t,"image",e,n,r,i)},addGuideText:function(t,e,n,r,i){this.addTypedGuide(t,"text",e,n,r,i)},addGuideRegion:function(t,e,n,r,i){this.addTypedGuide(t,"region",e,n,r,i)},addGuideHtml:function(t,e,n,r,i){this.addTypedGuide(t,"html",e,n,r,i)},addGuideArc:function(t,e,n,r,i){this.addTypedGuide(t,"arc",e,n,r,i)},addGuideRegionFilter:function(t,e,n,r,i){this.addTypedGuide(t,"regionFilter",e,n,r,i)},addGuideDataMarker:function(t,e,n,r,i){this.addTypedGuide(t,"dataMarker",e,n,r,i)},addGuideDataRegion:function(t,e,n,r,i){this.addTypedGuide(t,"dataRegion",e,n,r,i)}};e.default=i},function(t,e,n){"use strict";function r(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e<t.length;e++)n[e]=t[e];return n}return Array.from(t)}Object.defineProperty(e,"__esModule",{value:!0});var i={Chart:"deleteChart",Coord:"deleteCoord",Geom:"deleteGeom",Axis:"deleteAxis",Tooltip:"deleteTooltip",Legend:"deleteLegend",Label:"deleteLabel",View:"deleteView",Guide:"deleteGuide",GuideLine:"deleteTypedGuide",GuideImage:"deleteTypedGuide",GuideText:"deleteTypedGuide",GuideRegion:"deleteTypedGuide",GuideHtml:"deleteTypedGuide",GuideArc:"deleteTypedGuide",Facet:"deleteFacet"},a={Geom:!0,Label:!0,Facet:!0},o={deleteAxis:function(t,e,n){var r=e.axises[n].props;t.axis(r.name,!1)},deleteTooltip:function(t){t.tooltip(!1)},deleteCoord:function(t){t.coord("rect",{})},deleteLegend:function(t,e,n){var i=e.legends[n].props;t.legend.apply(t,r(i.name?[i.name,!1]:[!1]))},deleteGuide:function(t){t.guide().clear()},deleteView:function(t,e,n){e.views[n].g2Instance&&(t.removeView(e.views[n].g2Instance),delete e.views[n].g2Instance)},deleteViewElement:function(t,e,n,r){var o=this;Object.keys(n).forEach(function(t){var n=r[t],s=n.viewId;s&&(a[n.name]?e.views[s].needReExecute=!0:e.views[s].g2Instance&&o[i[n.name]]&&o[i[n.name]](e.views[s].g2Instance,e.views[s],n.id))})},needReExecute:function(t,e){for(var n in t)if(a[e[n].name]&&!e[n].viewId)return!0;return!1},synchronizeG2Delete:function(t,e,n,r){var a=this;Object.keys(n).forEach(function(n){var o=i[r[n].name];a[o]&&!r[n].viewId&&a[o](t,e,n)}),this.deleteViewElement(t,e,n,r)}};e.default=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},i=n(219),a=g(i),o=n(82),s=n(189),u=g(s),l=n(191),c=g(l),h=n(81),f=g(h),p=n(190),d=g(p);function g(t){return t&&t.__esModule?t:{default:t}}function v(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e<t.length;e++)n[e]=t[e];return n}return Array.from(t)}function y(t,e){var n={};for(var r in t)e.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n}var m=u.default.COORD_FUNC_PROPS,x=u.default.GEOM_FUNC_PROPS,b={needRebuildChart:function(t){if(null==t.chart.props||null==t.chart.updateProps)return!1;var e=t.chart.props,n=t.chart.updateProps;return!(o.Util.shallowEqual(e.padding,n.padding)&&o.Util.shallowEqual(e.background,n.background)&&o.Util.shallowEqual(e.plotBackground,n.plotBackground)&&o.Util.shallowEqual(e.pixelRatio,n.pixelRatio))},needReExecute:function(t){var e=t.geoms;if(null==e)return!1;for(var n in e)if(e[n].props&&e[n].updateProps&&(e[n].props.type!==e[n].updateProps.type||e[n].props.color&&!e[n].updateProps.color||e[n].props.size&&!e[n].updateProps.size||e[n].props.shape&&!e[n].updateProps.shape))return!0;return!1},needRepaint:function(t){var e=t.chart,n=e.props.data,r=e.updateProps.data;return n===r},synchronizeG2Update:function(t,e){this.updateChart(t,e.chart),this.updateAxises(t,e.axises),this.updateTooltip(t,e),this.updateCoord(t,e),this.updateLegends(t,e.legends),this.updateGeoms(t,e.geoms),this.updateGuide(t,e.guide),this.updateFacet(t,e),this.updateViews(t,e)},updateChart:function(t,e){if(e){var n=e.props,r=e.updateProps,i=n.width,a=n.height,s=n.animate,u=n.data,l=n.scale,c=r.width,h=r.height,f=r.animate,p=r.data,g=r.scale;u!==p&&t.changeData(p),o.Util.shallowEqual(l,g)||(o.Util.isArray(g)?t.scale(g[0],g[1]):t.scale(g)),s!==f&&t.animate(f),i!==c&&a!==h?t.changeSize(c,h):i!==c?t.changeWidth(c):a!==h&&t.changeHeight(h),d.default.updateEvents(t,d.default.chartEvents,e.props,r),d.default.updateBaseEvents(t,e.updateProps,r)}},updateAxis:function(t,e){var n=e.props,r=n.name,i=n.visible,s=y(n,["name","visible"]),u=e.updateProps,l=u.name,c=u.visible,h=y(u,["name","visible"]);(0,a.default)(r===l,"`name` propertry should not be changed in `<Axis />`"),i!==c&&t.axis(r,!!c),o.Util.shallowEqual(s,h)||t.axis(r,h)},updateAxises:function(t,e){if(e)for(var n in e)e[n]&&e[n].props&&e[n].updateProps&&this.updateAxis(t,e[n])},updateTooltip:function(t,e){if(e.tooltip){var n=e.tooltip.props,i=e.tooltip.updateProps;null==n&&null==i||o.Util.shallowEqual(n,i)||t.tooltip(r({},i))}},updateCoord:function(t,e){var n=e.coord;if(n){var r=n.props,i=n.updateProps;if(null!=r&&null!=i){var a=o.Util.without(i,m.concat(["type"]));if(!o.Util.shallowEqual(r,i)){var s=t.coord(i.type,a);n.g2Instance=s,o.Prop.init(m,i,function(t,e){"reflect"===e?o.Util.each(t,function(t){return s[e](t)}):s[e].apply(s,v(t))})}}}},updateLegend:function(t,e){var n=e.props,r=e.updateProps;if(r&&!o.Util.shallowEqual(n,r)){var i=r.name,a=r.visible,s=y(r,["name","visible"]),u=a?s:a;t.legend.apply(t,v(i?[i,u]:[u]))}},updateLegends:function(t,e){if(null!=e)for(var n in e)e[n]&&this.updateLegend(t,e[n])},updateLabel:function(t,e,n){if(null!=e&&null!=n){var r=e.content,i=y(e,["content"]),a=n.content,s=y(n,["content"]);o.Util.shallowEqual(i,s)&&o.Util.shallowEqual(r,a)||(o.Util.isArray(a)?t.label(a[0],a[1],s):t.label(a,s))}},updateGeom:function(t,e){var n=e.props,r=e.updateProps;if(n&&r&&n.type===r.type){var i=e.g2Instance;if(o.Util.shallowEqual(n,r))e.label&&this.updateLabel(i,e.label.props,e.label.updateProps);else{var a=n.adjust,s=y(n,["adjust"]),u=r.adjust,l=y(r,["adjust"]);(a||u)&&i.adjust(u),o.Prop.update(x,s,l,function(t,e){i[e].apply(i,v(t))}),e.label&&this.updateLabel(i,e.label.props,e.label.updateProps)}}},updateGeoms:function(t,e){if(null==e)return!1;for(var n in e)e[n]&&this.updateGeom(t,e[n]);return!1},isTypedGuideChanged:function(t){return!o.Util.shallowEqual(t.props,t.updateProps)},updateGuide:function(t,e){if(e&&e.elements){var n=e.elements,r=!1;for(var i in n)if(n[i]&&(n[i].updateProps||this.isTypedGuideChanged(n[i]))){r=!0;break}r&&(f.default.mergeGuide(e,!0),t.guide().clear(),c.default.guide(t,e))}},updateView:function(t,e){if(e&&e.props&&e.updateProps&&"Facet"!==e.parentInfo.name){var n=e.g2Instance,r=e.props,i=e.updateProps,a=r.scale,s=r.data,u=r.animate,l=r.axis,c=r.filter,h=i.scale,f=i.animate,p=i.data,d=i.axis,g=i.filter;u!==f&&n.animate(f),s!==p&&n.changeData(p),o.Util.shallowEqual(a,h)||n.scale(h),o.Util.shallowEqual(c,g)||g.forEach(function(t){n.filter(t[0],t[1])}),l!==d&&n.axis(d),this.updateCoord(n,e),this.updateAxises(n,e.axises),this.updateGeoms(n,e.geoms),this.updateGuide(n,e.guide)}},updateViews:function(t,e){var n=e.views;if(n)for(var r in n){var i=n[r];i&&(i.needReExecute||this.needReExecute(i))?(c.default.synchronizeG2View(i.g2Instance,i),n[r].needReExecute=!1):this.updateView(t,i)}},updateFacet:function(t,e){var n=e.facet;if(n){var r=n.props,i=n.updateProps;if(null!=r&&null!=i){var a=r.type,s=y(r,["type"]),u=i.type,l=y(i,["type"]);a===u&&o.Util.shallowEqual(s,l)||(n.props=i,c.default.facet(t,e))}}}};e.default=b},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},i=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),a=n(418),o=v(a),s=n(81),u=v(s),l=n(420),c=v(l),h=n(419),f=v(h),p=n(191),d=v(p),g=n(82);function v(t){return t&&t.__esModule?t:{default:t}}function y(t,e){var n={};for(var r in t)e.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n}function m(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var x=function(){function t(){m(this,t),this.config={},this.elementInfos={},this.added=!1,this.initedG2=!1,this.updated=!1,this.deleted=!1,this.deleteInfos={}}return i(t,[{key:"calUpdateFlag",value:function(t,e){var n=this.elementInfos[e].props,r=(n.children,y(n,["children"])),i=this.elementInfos[e].updateProps,a=(i.children,y(i,["children"]));if("Chart"===t||"View"===t){var o=r.data,s=y(r,["data"]),u=a.data,l=y(a,["data"]);o===u&&g.Util.isEqual(s,l)||(this.updated=!0)}else g.Util.isEqual(r,a)||(this.updated=!0)}},{key:"addElement",value:function(t,e,n,i,a){!this.chart&&this.initedG2||(this.added=!0,this.elementInfos[e]={id:e,viewId:a,parentInfo:i,name:t,props:r({},n)},i&&!this.elementInfos[i.id]&&(this.elementInfos[i.id]={id:i.id,name:i.name}),o.default.addElement(t,this.config,this.elementInfos[e]))}},{key:"updateElement",value:function(t,e,n){this.elementInfos[e].updateProps=r({},n),this.calUpdateFlag(t,e)}},{key:"deleteElement",value:function(t,e){this.chart&&(this.deleteInfos[e]=e,this.deleted=!0)}},{key:"createG2Instance",value:function(){var t=this.config,e=d.default.createChart(t,this.elementInfos);return d.default.executeChartConfig(e,t,this.elementInfos),d.default.synchronizeG2Add(e,t,this.elementInfos),e.render(),this.chart=e,this.initedG2=!0,this.resetStates(),e}},{key:"destory",value:function(){this.chart.destroy(),this.chart=null}},{key:"resetStates",value:function(){var t=this.elementInfos;for(var e in t)t[e].updateProps&&delete t[e].updateProps,this.deleteInfos[e]&&delete t[e];this.added=!1,this.updated=!1,this.deleteInfos={}}},{key:"reExecuteChart",value:function(){return this.chart.clear(),u.default.merge(this.config,this.deleteInfos,this.elementInfos,!0),d.default.executeChartConfig(this.chart,this.config,this.elementInfos),d.default.synchronizeG2Add(this.chart,this.config,this.elementInfos),this.chart.repaint(),this.resetStates(),this.chart}},{key:"batchedUpdate",value:function(){return null==this.chart?null:this.config.chart.props.forceUpdate||c.default.needRebuildChart(this.config)?(u.default.merge(this.config,this.deleteInfos,this.elementInfos,!0),this.chart.destroy(),this.chart="destroy",this.createG2Instance()):f.default.needReExecute(this.deleteInfos,this.elementInfos)||c.default.needReExecute(this.config)?(this.reExecuteChart(),this.chart):(this.deleted&&(f.default.synchronizeG2Delete(this.chart,this.config,this.deleteInfos,this.elementInfos),u.default.mergeDelete(this.config,this.deleteInfos,this.elementInfos)),this.added&&d.default.synchronizeG2Add(this.chart,this.config),this.updated&&c.default.synchronizeG2Update(this.chart,this.config),(this.added||this.deleted||this.updated)&&this.chart.repaint(),u.default.mergeUpdate(this.config,!1),this.resetStates(),this.chart)}}]),t}();e.default=x},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(54),i=a(r);function a(t){return t&&t.__esModule?t:{default:t}}e.default={init:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments[1],n=arguments[2];i.default.each(t,function(t){var r=e[t];void 0!==r&&(i.default.isArray(r)||(r=[r]),n(r,t))})},update:function(t,e,n,r){var a=void 0,o=void 0;i.default.each(t,function(t){a=e[t],o=n[t],i.default.shallowEqual(o,a)||(i.default.isArray(o)||(o=[o]),r(o,t))})}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={}},function(t,e,n){"use strict";e["a"]=g;var r=n(84),i=n(83),a=n(192),o=-.14861,s=1.78277,u=-.29227,l=-.90649,c=1.97294,h=c*l,f=c*s,p=s*u-l*o;function d(t){if(t instanceof v)return new v(t.h,t.s,t.l,t.opacity);t instanceof i["a"]||(t=n.i(i["b"])(t));var e=t.r/255,r=t.g/255,o=t.b/255,s=(p*o+h*e-f*r)/(p+h-f),d=o-s,g=(c*(r-s)-u*d)/l,y=Math.sqrt(g*g+d*d)/(c*s*(1-s)),m=y?Math.atan2(g,d)*a["a"]-120:NaN;return new v(m<0?m+360:m,y,s,t.opacity)}function g(t,e,n,r){return 1===arguments.length?d(t):new v(t,e,n,null==r?1:r)}function v(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}n.i(r["a"])(v,g,n.i(r["b"])(i["c"],{brighter:function(t){return t=null==t?i["d"]:Math.pow(i["d"],t),new v(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?i["e"]:Math.pow(i["e"],t),new v(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=isNaN(this.h)?0:(this.h+120)*a["b"],e=+this.l,n=isNaN(this.s)?0:this.s*e*(1-e),r=Math.cos(t),h=Math.sin(t);return new i["a"](255*(e+n*(o*r+s*h)),255*(e+n*(u*r+l*h)),255*(e+n*(c*r)),this.opacity)}}))},function(t,e,n){"use strict";e["b"]=g,e["a"]=w;var r=n(84),i=n(83),a=n(192),o=18,s=.96422,u=1,l=.82521,c=4/29,h=6/29,f=3*h*h,p=h*h*h;function d(t){if(t instanceof v)return new v(t.l,t.a,t.b,t.opacity);if(t instanceof M){if(isNaN(t.h))return new v(t.l,0,0,t.opacity);var e=t.h*a["b"];return new v(t.l,Math.cos(e)*t.c,Math.sin(e)*t.c,t.opacity)}t instanceof i["a"]||(t=n.i(i["b"])(t));var r,o,c=b(t.r),h=b(t.g),f=b(t.b),p=y((.2225045*c+.7168786*h+.0606169*f)/u);return c===h&&h===f?r=o=p:(r=y((.4360747*c+.3850649*h+.1430804*f)/s),o=y((.0139322*c+.0971045*h+.7141733*f)/l)),new v(116*p-16,500*(r-p),200*(p-o),t.opacity)}function g(t,e,n,r){return 1===arguments.length?d(t):new v(t,e,n,null==r?1:r)}function v(t,e,n,r){this.l=+t,this.a=+e,this.b=+n,this.opacity=+r}function y(t){return t>p?Math.pow(t,1/3):t/f+c}function m(t){return t>h?t*t*t:f*(t-c)}function x(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function b(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function _(t){if(t instanceof M)return new M(t.h,t.c,t.l,t.opacity);if(t instanceof v||(t=d(t)),0===t.a&&0===t.b)return new M(NaN,0,t.l,t.opacity);var e=Math.atan2(t.b,t.a)*a["a"];return new M(e<0?e+360:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}function w(t,e,n,r){return 1===arguments.length?_(t):new M(t,e,n,null==r?1:r)}function M(t,e,n,r){this.h=+t,this.c=+e,this.l=+n,this.opacity=+r}n.i(r["a"])(v,g,n.i(r["b"])(i["c"],{brighter:function(t){return new v(this.l+o*(null==t?1:t),this.a,this.b,this.opacity)},darker:function(t){return new v(this.l-o*(null==t?1:t),this.a,this.b,this.opacity)},rgb:function(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,n=isNaN(this.b)?t:t-this.b/200;return e=s*m(e),t=u*m(t),n=l*m(n),new i["a"](x(3.1338561*e-1.6168667*t-.4906146*n),x(-.9787684*e+1.9161415*t+.033454*n),x(.0719453*e-.2289914*t+1.4052427*n),this.opacity)}})),n.i(r["a"])(M,w,n.i(r["b"])(i["c"],{brighter:function(t){return new M(this.h,this.c,this.l+o*(null==t?1:t),this.opacity)},darker:function(t){return new M(this.h,this.c,this.l-o*(null==t?1:t),this.opacity)},rgb:function(){return d(this).rgb()}}))},function(t,e,n){"use strict";var r={value:function(){}};function i(){for(var t,e=0,n=arguments.length,r={};e<n;++e){if(!(t=arguments[e]+"")||t in r)throw new Error("illegal type: "+t);r[t]=[]}return new a(r)}function a(t){this._=t}function o(t,e){return t.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");if(r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}})}function s(t,e){for(var n,r=0,i=t.length;r<i;++r)if((n=t[r]).name===e)return n.value}function u(t,e,n){for(var i=0,a=t.length;i<a;++i)if(t[i].name===e){t[i]=r,t=t.slice(0,i).concat(t.slice(i+1));break}return null!=n&&t.push({name:e,value:n}),t}a.prototype=i.prototype={constructor:a,on:function(t,e){var n,r=this._,i=o(t+"",r),a=-1,l=i.length;if(!(arguments.length<2)){if(null!=e&&"function"!==typeof e)throw new Error("invalid callback: "+e);while(++a<l)if(n=(t=i[a]).type)r[n]=u(r[n],t.name,e);else if(null==e)for(n in r)r[n]=u(r[n],t.name,null);return this}while(++a<l)if((n=(t=i[a]).type)&&(n=s(r[n],t.name)))return n},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new a(t)},call:function(t,e){if((n=arguments.length-2)>0)for(var n,r,i=new Array(n),a=0;a<n;++a)i[a]=arguments[a+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(r=this._[t],a=0,n=r.length;a<n;++a)r[a].value.apply(e,i)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,a=r.length;i<a;++i)r[i].value.apply(e,n)}},e["a"]=i},function(t,e,n){"use strict";var r=n(426);n.d(e,"a",function(){return r["a"]})},function(t,e,n){"use strict";n.d(e,"b",function(){return i}),n.d(e,"c",function(){return a}),n.d(e,"a",function(){return o});var r=1.70158,i=function t(e){function n(t){return t*t*((e+1)*t-e)}return e=+e,n.overshoot=t,n}(r),a=function t(e){function n(t){return--t*t*((e+1)*t+e)+1}return e=+e,n.overshoot=t,n}(r),o=function t(e){function n(t){return((t*=2)<1?t*t*((e+1)*t-e):(t-=2)*t*((e+1)*t+e)+2)/2}return e=+e,n.overshoot=t,n}(r)},function(t,e,n){"use strict";e["b"]=p,e["a"]=d,e["c"]=g;var r=4/11,i=6/11,a=8/11,o=.75,s=9/11,u=10/11,l=.9375,c=21/22,h=63/64,f=1/r/r;function p(t){return 1-d(1-t)}function d(t){return(t=+t)<r?f*t*t:t<a?f*(t-=i)*t+o:t<u?f*(t-=s)*t+l:f*(t-=c)*t+h}function g(t){return((t*=2)<=1?1-d(1-t):d(t-1)+1)/2}},function(t,e,n){"use strict";function r(t){return 1-Math.sqrt(1-t*t)}function i(t){return Math.sqrt(1- --t*t)}function a(t){return((t*=2)<=1?1-Math.sqrt(1-t*t):Math.sqrt(1-(t-=2)*t)+1)/2}e["b"]=r,e["c"]=i,e["a"]=a},function(t,e,n){"use strict";function r(t){return t*t*t}function i(t){return--t*t*t+1}function a(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}e["b"]=r,e["c"]=i,e["a"]=a},function(t,e,n){"use strict";n.d(e,"b",function(){return o}),n.d(e,"a",function(){return s}),n.d(e,"c",function(){return u});var r=2*Math.PI,i=1,a=.3,o=function t(e,n){var i=Math.asin(1/(e=Math.max(1,e)))*(n/=r);function a(t){return e*Math.pow(2,10*--t)*Math.sin((i-t)/n)}return a.amplitude=function(e){return t(e,n*r)},a.period=function(n){return t(e,n)},a}(i,a),s=function t(e,n){var i=Math.asin(1/(e=Math.max(1,e)))*(n/=r);function a(t){return 1-e*Math.pow(2,-10*(t=+t))*Math.sin((t+i)/n)}return a.amplitude=function(e){return t(e,n*r)},a.period=function(n){return t(e,n)},a}(i,a),u=function t(e,n){var i=Math.asin(1/(e=Math.max(1,e)))*(n/=r);function a(t){return((t=2*t-1)<0?e*Math.pow(2,10*t)*Math.sin((i-t)/n):2-e*Math.pow(2,-10*t)*Math.sin((i+t)/n))/2}return a.amplitude=function(e){return t(e,n*r)},a.period=function(n){return t(e,n)},a}(i,a)},function(t,e,n){"use strict";function r(t){return Math.pow(2,10*t-10)}function i(t){return 1-Math.pow(2,-10*t)}function a(t){return((t*=2)<=1?Math.pow(2,10*t-10):2-Math.pow(2,10-10*t))/2}e["b"]=r,e["c"]=i,e["a"]=a},function(t,e,n){"use strict";function r(t){return+t}e["a"]=r},function(t,e,n){"use strict";n.d(e,"b",function(){return i}),n.d(e,"c",function(){return a}),n.d(e,"a",function(){return o});var r=3,i=function t(e){function n(t){return Math.pow(t,e)}return e=+e,n.exponent=t,n}(r),a=function t(e){function n(t){return 1-Math.pow(1-t,e)}return e=+e,n.exponent=t,n}(r),o=function t(e){function n(t){return((t*=2)<=1?Math.pow(t,e):2-Math.pow(2-t,e))/2}return e=+e,n.exponent=t,n}(r)},function(t,e,n){"use strict";function r(t){return t*t}function i(t){return t*(2-t)}function a(t){return((t*=2)<=1?t*t:--t*(2-t)+1)/2}e["b"]=r,e["c"]=i,e["a"]=a},function(t,e,n){"use strict";e["b"]=a,e["c"]=o,e["a"]=s;var r=Math.PI,i=r/2;function a(t){return 1-Math.cos(t*i)}function o(t){return Math.sin(t*i)}function s(t){return(1-Math.cos(r*t))/2}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(86);n.d(e,"interpolate",function(){return r["a"]});var i=n(194);n.d(e,"interpolateArray",function(){return i["a"]});var a=n(85);n.d(e,"interpolateBasis",function(){return a["a"]});var o=n(195);n.d(e,"interpolateBasisClosed",function(){return o["a"]});var s=n(197);n.d(e,"interpolateDate",function(){return s["a"]});var u=n(55);n.d(e,"interpolateNumber",function(){return u["a"]});var l=n(198);n.d(e,"interpolateObject",function(){return l["a"]});var c=n(444);n.d(e,"interpolateRound",function(){return c["a"]});var h=n(200);n.d(e,"interpolateString",function(){return h["a"]});var f=n(446);n.d(e,"interpolateTransformCss",function(){return f["a"]}),n.d(e,"interpolateTransformSvg",function(){return f["b"]});var p=n(448);n.d(e,"interpolateZoom",function(){return p["a"]});var d=n(199);n.d(e,"interpolateRgb",function(){return d["a"]}),n.d(e,"interpolateRgbBasis",function(){return d["b"]}),n.d(e,"interpolateRgbBasisClosed",function(){return d["c"]});var g=n(441);n.d(e,"interpolateHsl",function(){return g["a"]}),n.d(e,"interpolateHslLong",function(){return g["b"]});var v=n(442);n.d(e,"interpolateLab",function(){return v["a"]});var y=n(440);n.d(e,"interpolateHcl",function(){return y["a"]}),n.d(e,"interpolateHclLong",function(){return y["b"]});var m=n(439);n.d(e,"interpolateCubehelix",function(){return m["a"]}),n.d(e,"interpolateCubehelixLong",function(){return m["b"]});var x=n(443);n.d(e,"quantize",function(){return x["a"]})},function(t,e,n){"use strict";n.d(e,"b",function(){return o});var r=n(12),i=n(40);function a(t){return function e(a){function o(e,o){var s=t((e=n.i(r["a"])(e)).h,(o=n.i(r["a"])(o)).h),u=n.i(i["a"])(e.s,o.s),l=n.i(i["a"])(e.l,o.l),c=n.i(i["a"])(e.opacity,o.opacity);return function(t){return e.h=s(t),e.s=u(t),e.l=l(Math.pow(t,a)),e.opacity=c(t),e+""}}return a=+a,o.gamma=e,o}(1)}e["a"]=a(i["b"]);var o=a(i["a"])},function(t,e,n){"use strict";n.d(e,"b",function(){return o});var r=n(12),i=n(40);function a(t){return function(e,a){var o=t((e=n.i(r["b"])(e)).h,(a=n.i(r["b"])(a)).h),s=n.i(i["a"])(e.c,a.c),u=n.i(i["a"])(e.l,a.l),l=n.i(i["a"])(e.opacity,a.opacity);return function(t){return e.h=o(t),e.c=s(t),e.l=u(t),e.opacity=l(t),e+""}}}e["a"]=a(i["b"]);var o=a(i["a"])},function(t,e,n){"use strict";n.d(e,"b",function(){return o});var r=n(12),i=n(40);function a(t){return function(e,a){var o=t((e=n.i(r["d"])(e)).h,(a=n.i(r["d"])(a)).h),s=n.i(i["a"])(e.s,a.s),u=n.i(i["a"])(e.l,a.l),l=n.i(i["a"])(e.opacity,a.opacity);return function(t){return e.h=o(t),e.s=s(t),e.l=u(t),e.opacity=l(t),e+""}}}e["a"]=a(i["b"]);var o=a(i["a"])},function(t,e,n){"use strict";e["a"]=a;var r=n(12),i=n(40);function a(t,e){var a=n.i(i["a"])((t=n.i(r["c"])(t)).l,(e=n.i(r["c"])(e)).l),o=n.i(i["a"])(t.a,e.a),s=n.i(i["a"])(t.b,e.b),u=n.i(i["a"])(t.opacity,e.opacity);return function(e){return t.l=a(e),t.a=o(e),t.b=s(e),t.opacity=u(e),t+""}}},function(t,e,n){"use strict";e["a"]=function(t,e){for(var n=new Array(e),r=0;r<e;++r)n[r]=t(r/(e-1));return n}},function(t,e,n){"use strict";e["a"]=function(t,e){return t=+t,e-=t,function(n){return Math.round(t+e*n)}}},function(t,e,n){"use strict";n.d(e,"a",function(){return i});var r=180/Math.PI,i={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};e["b"]=function(t,e,n,i,a,o){var s,u,l;return(s=Math.sqrt(t*t+e*e))&&(t/=s,e/=s),(l=t*n+e*i)&&(n-=t*l,i-=e*l),(u=Math.sqrt(n*n+i*i))&&(n/=u,i/=u,l/=u),t*i<e*n&&(t=-t,e=-e,l=-l,s=-s),{translateX:a,translateY:o,rotate:Math.atan2(e,t)*r,skewX:Math.atan(l)*r,scaleX:s,scaleY:u}}},function(t,e,n){"use strict";n.d(e,"a",function(){return o}),n.d(e,"b",function(){return s});var r=n(55),i=n(447);function a(t,e,i,a){function o(t){return t.length?t.pop()+" ":""}function s(t,a,o,s,u,l){if(t!==o||a!==s){var c=u.push("translate(",null,e,null,i);l.push({i:c-4,x:n.i(r["a"])(t,o)},{i:c-2,x:n.i(r["a"])(a,s)})}else(o||s)&&u.push("translate("+o+e+s+i)}function u(t,e,i,s){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),s.push({i:i.push(o(i)+"rotate(",null,a)-2,x:n.i(r["a"])(t,e)})):e&&i.push(o(i)+"rotate("+e+a)}function l(t,e,i,s){t!==e?s.push({i:i.push(o(i)+"skewX(",null,a)-2,x:n.i(r["a"])(t,e)}):e&&i.push(o(i)+"skewX("+e+a)}function c(t,e,i,a,s,u){if(t!==i||e!==a){var l=s.push(o(s)+"scale(",null,",",null,")");u.push({i:l-4,x:n.i(r["a"])(t,i)},{i:l-2,x:n.i(r["a"])(e,a)})}else 1===i&&1===a||s.push(o(s)+"scale("+i+","+a+")")}return function(e,n){var r=[],i=[];return e=t(e),n=t(n),s(e.translateX,e.translateY,n.translateX,n.translateY,r,i),u(e.rotate,n.rotate,r,i),l(e.skewX,n.skewX,r,i),c(e.scaleX,e.scaleY,n.scaleX,n.scaleY,r,i),e=n=null,function(t){var e,n=-1,a=i.length;while(++n<a)r[(e=i[n]).i]=e.x(t);return r.join("")}}}var o=a(i["a"],"px, ","px)","deg)"),s=a(i["b"],", ",")",")")},function(t,e,n){"use strict";e["a"]=u,e["b"]=l;var r,i,a,o,s=n(445);function u(t){return"none"===t?s["a"]:(r||(r=document.createElement("DIV"),i=document.documentElement,a=document.defaultView),r.style.transform=t,t=a.getComputedStyle(i.appendChild(r),null).getPropertyValue("transform"),i.removeChild(r),t=t.slice(7,-1).split(","),n.i(s["b"])(+t[0],+t[1],+t[2],+t[3],+t[4],+t[5]))}function l(t){return null==t?s["a"]:(o||(o=document.createElementNS("http://www.w3.org/2000/svg","g")),o.setAttribute("transform",t),(t=o.transform.baseVal.consolidate())?(t=t.matrix,n.i(s["b"])(t.a,t.b,t.c,t.d,t.e,t.f)):s["a"])}},function(t,e,n){"use strict";var r=Math.SQRT2,i=2,a=4,o=1e-12;function s(t){return((t=Math.exp(t))+1/t)/2}function u(t){return((t=Math.exp(t))-1/t)/2}function l(t){return((t=Math.exp(2*t))-1)/(t+1)}e["a"]=function(t,e){var n,c,h=t[0],f=t[1],p=t[2],d=e[0],g=e[1],v=e[2],y=d-h,m=g-f,x=y*y+m*m;if(x<o)c=Math.log(v/p)/r,n=function(t){return[h+t*y,f+t*m,p*Math.exp(r*t*c)]};else{var b=Math.sqrt(x),_=(v*v-p*p+a*x)/(2*p*i*b),w=(v*v-p*p-a*x)/(2*v*i*b),M=Math.log(Math.sqrt(_*_+1)-_),S=Math.log(Math.sqrt(w*w+1)-w);c=(S-M)/r,n=function(t){var e=t*c,n=s(M),a=p/(i*b)*(n*l(r*e+M)-u(M));return[h+a*y,f+a*m,p*n/s(r*e+M)]}}return n.duration=1e3*c,n}},function(t,e,n){"use strict";var r=n(12),i=n(30);function a(t){return function e(a){function o(e,o){var s=t((e=n.i(r["a"])(e)).h,(o=n.i(r["a"])(o)).h),u=n.i(i["a"])(e.s,o.s),l=n.i(i["a"])(e.l,o.l),c=n.i(i["a"])(e.opacity,o.opacity);return function(t){return e.h=s(t),e.s=u(t),e.l=l(Math.pow(t,a)),e.opacity=c(t),e+""}}return a=+a,o.gamma=e,o}(1)}a(i["b"]),a(i["a"])},function(t,e,n){"use strict"},function(t,e,n){"use strict";var r=n(12),i=n(30);function a(t){return function(e,a){var o=t((e=n.i(r["b"])(e)).h,(a=n.i(r["b"])(a)).h),s=n.i(i["a"])(e.c,a.c),u=n.i(i["a"])(e.l,a.l),l=n.i(i["a"])(e.opacity,a.opacity);return function(t){return e.h=o(t),e.c=s(t),e.l=u(t),e.opacity=l(t),e+""}}}a(i["b"]),a(i["a"])},function(t,e,n){"use strict";var r=n(12),i=n(30);function a(t){return function(e,a){var o=t((e=n.i(r["d"])(e)).h,(a=n.i(r["d"])(a)).h),s=n.i(i["a"])(e.s,a.s),u=n.i(i["a"])(e.l,a.l),l=n.i(i["a"])(e.opacity,a.opacity);return function(t){return e.h=o(t),e.s=s(t),e.l=u(t),e.opacity=l(t),e+""}}}a(i["b"]),a(i["a"])},function(t,e,n){"use strict";n(30)},function(t,e,n){"use strict";n(12),n(30)},function(t,e,n){"use strict"},function(t,e,n){"use strict"},function(t,e,n){"use strict"},function(t,e,n){"use strict";n.d(e,"a",function(){return i});var r=180/Math.PI,i={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};e["b"]=function(t,e,n,i,a,o){var s,u,l;return(s=Math.sqrt(t*t+e*e))&&(t/=s,e/=s),(l=t*n+e*i)&&(n-=t*l,i-=e*l),(u=Math.sqrt(n*n+i*i))&&(n/=u,i/=u,l/=u),t*i<e*n&&(t=-t,e=-e,l=-l,s=-s),{translateX:a,translateY:o,rotate:Math.atan2(e,t)*r,skewX:Math.atan(l)*r,scaleX:s,scaleY:u}}},function(t,e,n){"use strict";n.d(e,"a",function(){return o}),n.d(e,"b",function(){return s});var r=n(56),i=n(460);function a(t,e,i,a){function o(t){return t.length?t.pop()+" ":""}function s(t,a,o,s,u,l){if(t!==o||a!==s){var c=u.push("translate(",null,e,null,i);l.push({i:c-4,x:n.i(r["a"])(t,o)},{i:c-2,x:n.i(r["a"])(a,s)})}else(o||s)&&u.push("translate("+o+e+s+i)}function u(t,e,i,s){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),s.push({i:i.push(o(i)+"rotate(",null,a)-2,x:n.i(r["a"])(t,e)})):e&&i.push(o(i)+"rotate("+e+a)}function l(t,e,i,s){t!==e?s.push({i:i.push(o(i)+"skewX(",null,a)-2,x:n.i(r["a"])(t,e)}):e&&i.push(o(i)+"skewX("+e+a)}function c(t,e,i,a,s,u){if(t!==i||e!==a){var l=s.push(o(s)+"scale(",null,",",null,")");u.push({i:l-4,x:n.i(r["a"])(t,i)},{i:l-2,x:n.i(r["a"])(e,a)})}else 1===i&&1===a||s.push(o(s)+"scale("+i+","+a+")")}return function(e,n){var r=[],i=[];return e=t(e),n=t(n),s(e.translateX,e.translateY,n.translateX,n.translateY,r,i),u(e.rotate,n.rotate,r,i),l(e.skewX,n.skewX,r,i),c(e.scaleX,e.scaleY,n.scaleX,n.scaleY,r,i),e=n=null,function(t){var e,n=-1,a=i.length;while(++n<a)r[(e=i[n]).i]=e.x(t);return r.join("")}}}var o=a(i["a"],"px, ","px)","deg)"),s=a(i["b"],", ",")",")")},function(t,e,n){"use strict";e["a"]=u,e["b"]=l;var r,i,a,o,s=n(458);function u(t){return"none"===t?s["a"]:(r||(r=document.createElement("DIV"),i=document.documentElement,a=document.defaultView),r.style.transform=t,t=a.getComputedStyle(i.appendChild(r),null).getPropertyValue("transform"),i.removeChild(r),t=t.slice(7,-1).split(","),n.i(s["b"])(+t[0],+t[1],+t[2],+t[3],+t[4],+t[5]))}function l(t){return null==t?s["a"]:(o||(o=document.createElementNS("http://www.w3.org/2000/svg","g")),o.setAttribute("transform",t),(t=o.transform.baseVal.consolidate())?(t=t.matrix,n.i(s["b"])(t.a,t.b,t.c,t.d,t.e,t.f)):s["a"])}},function(t,e,n){"use strict";Math.SQRT2},function(t,e,n){"use strict";e["a"]=function(t){return function(){return t}}},function(t,e,n){"use strict";var r=n(57),i=n(209);e["a"]=function(t){return n.i(i["a"])(n.i(r["a"])(t).call(document.documentElement))}},function(t,e,n){"use strict";e["a"]=i;var r=0;function i(){return new a}function a(){this._="@"+(++r).toString(36)}a.prototype=i.prototype={constructor:a,get:function(t){var e=this._;while(!(e in t))if(!(t=t.parentNode))return;return t[e]},set:function(t,e){return t[this._]=e},remove:function(t){return this._ in t&&delete t[this._]},toString:function(){return this._}}},function(t,e,n){"use strict";var r=n(94),i=n(58);e["a"]=function(t){var e=n.i(r["a"])();return e.changedTouches&&(e=e.changedTouches[0]),n.i(i["a"])(t,e)}},function(t,e,n){"use strict";var r=n(17);e["a"]=function(t){return"string"===typeof t?new r["b"]([document.querySelectorAll(t)],[document.documentElement]):new r["b"]([null==t?[]:t],r["c"])}},function(t,e,n){"use strict";var r=n(57);e["a"]=function(t){var e="function"===typeof t?t:n.i(r["a"])(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}},function(t,e,n){"use strict";var r=n(90);function i(t){return function(){this.removeAttribute(t)}}function a(t){return function(){this.removeAttributeNS(t.space,t.local)}}function o(t,e){return function(){this.setAttribute(t,e)}}function s(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function u(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}}function l(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}e["a"]=function(t,e){var c=n.i(r["a"])(t);if(arguments.length<2){var h=this.node();return c.local?h.getAttributeNS(c.space,c.local):h.getAttribute(c)}return this.each((null==e?c.local?a:i:"function"===typeof e?c.local?l:u:c.local?s:o)(c,e))}},function(t,e,n){"use strict";e["a"]=function(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}},function(t,e,n){"use strict";function r(t){return t.trim().split(/^|\s+/)}function i(t){return t.classList||new a(t)}function a(t){this._node=t,this._names=r(t.getAttribute("class")||"")}function o(t,e){var n=i(t),r=-1,a=e.length;while(++r<a)n.add(e[r])}function s(t,e){var n=i(t),r=-1,a=e.length;while(++r<a)n.remove(e[r])}function u(t){return function(){o(this,t)}}function l(t){return function(){s(this,t)}}function c(t,e){return function(){(e.apply(this,arguments)?o:s)(this,t)}}a.prototype={add:function(t){var e=this._names.indexOf(t);e<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}},e["a"]=function(t,e){var n=r(t+"");if(arguments.length<2){var a=i(this.node()),o=-1,s=n.length;while(++o<s)if(!a.contains(n[o]))return!1;return!0}return this.each(("function"===typeof e?c:e?u:l)(n,e))}},function(t,e,n){"use strict";function r(){return this.parentNode.insertBefore(this.cloneNode(!1),this.nextSibling)}function i(){return this.parentNode.insertBefore(this.cloneNode(!0),this.nextSibling)}e["a"]=function(t){return this.select(t?i:r)}},function(t,e,n){"use strict";var r=n(17),i=n(210),a=n(462),o="$";function s(t,e,n,r,a,o){for(var s,u=0,l=e.length,c=o.length;u<c;++u)(s=e[u])?(s.__data__=o[u],r[u]=s):n[u]=new i["b"](t,o[u]);for(;u<l;++u)(s=e[u])&&(a[u]=s)}function u(t,e,n,r,a,s,u){var l,c,h,f={},p=e.length,d=s.length,g=new Array(p);for(l=0;l<p;++l)(c=e[l])&&(g[l]=h=o+u.call(c,c.__data__,l,e),h in f?a[l]=c:f[h]=c);for(l=0;l<d;++l)h=o+u.call(t,s[l],l,s),(c=f[h])?(r[l]=c,c.__data__=s[l],f[h]=null):n[l]=new i["b"](t,s[l]);for(l=0;l<p;++l)(c=e[l])&&f[g[l]]===c&&(a[l]=c)}e["a"]=function(t,e){if(!t)return m=new Array(this.size()),d=-1,this.each(function(t){m[++d]=t}),m;var i=e?u:s,o=this._parents,l=this._groups;"function"!==typeof t&&(t=n.i(a["a"])(t));for(var c=l.length,h=new Array(c),f=new Array(c),p=new Array(c),d=0;d<c;++d){var g=o[d],v=l[d],y=v.length,m=t.call(g,g&&g.__data__,d,o),x=m.length,b=f[d]=new Array(x),_=h[d]=new Array(x),w=p[d]=new Array(y);i(g,v,b,_,w,m,e);for(var M,S,C=0,k=0;C<x;++C)if(M=b[C]){C>=k&&(k=C+1);while(!(S=_[k])&&++k<x);M._next=S||null}}return h=new r["b"](h,o),h._enter=f,h._exit=p,h}},function(t,e,n){"use strict";e["a"]=function(t){return arguments.length?this.property("__data__",t):this.node().__data__}},function(t,e,n){"use strict";var r=n(95);function i(t,e,i){var a=n.i(r["a"])(t),o=a.CustomEvent;"function"===typeof o?o=new o(e,i):(o=a.document.createEvent("Event"),i?(o.initEvent(e,i.bubbles,i.cancelable),o.detail=i.detail):o.initEvent(e,!1,!1)),t.dispatchEvent(o)}function a(t,e){return function(){return i(this,t,e)}}function o(t,e){return function(){return i(this,t,e.apply(this,arguments))}}e["a"]=function(t,e){return this.each(("function"===typeof e?o:a)(t,e))}},function(t,e,n){"use strict";e["a"]=function(t){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var i,a=e[n],o=0,s=a.length;o<s;++o)(i=a[o])&&t.call(i,i.__data__,o,a);return this}},function(t,e,n){"use strict";e["a"]=function(){return!this.node()}},function(t,e,n){"use strict";var r=n(211),i=n(17);e["a"]=function(){return new i["b"](this._exit||this._groups.map(r["a"]),this._parents)}},function(t,e,n){"use strict";var r=n(17),i=n(208);e["a"]=function(t){"function"!==typeof t&&(t=n.i(i["a"])(t));for(var e=this._groups,a=e.length,o=new Array(a),s=0;s<a;++s)for(var u,l=e[s],c=l.length,h=o[s]=[],f=0;f<c;++f)(u=l[f])&&t.call(u,u.__data__,f,l)&&h.push(u);return new r["b"](o,this._parents)}},function(t,e,n){"use strict";function r(){this.innerHTML=""}function i(t){return function(){this.innerHTML=t}}function a(t){return function(){var e=t.apply(this,arguments);this.innerHTML=null==e?"":e}}e["a"]=function(t){return arguments.length?this.each(null==t?r:("function"===typeof t?a:i)(t)):this.node().innerHTML}},function(t,e,n){"use strict";var r=n(57),i=n(93);function a(){return null}e["a"]=function(t,e){var o="function"===typeof t?t:n.i(r["a"])(t),s=null==e?a:"function"===typeof e?e:n.i(i["a"])(e);return this.select(function(){return this.insertBefore(o.apply(this,arguments),s.apply(this,arguments)||null)})}},function(t,e,n){"use strict";e["a"]=function(t,e,n){var r=this.enter(),i=this,a=this.exit();return r="function"===typeof t?t(r):r.append(t+""),null!=e&&(i=e(i)),null==n?a.remove():n(a),r&&i?r.merge(i).order():i}},function(t,e,n){"use strict";function r(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}e["a"]=function(){return this.each(r)}},function(t,e,n){"use strict";var r=n(17);e["a"]=function(t){for(var e=this._groups,n=t._groups,i=e.length,a=n.length,o=Math.min(i,a),s=new Array(i),u=0;u<o;++u)for(var l,c=e[u],h=n[u],f=c.length,p=s[u]=new Array(f),d=0;d<f;++d)(l=c[d]||h[d])&&(p[d]=l);for(;u<i;++u)s[u]=e[u];return new r["b"](s,this._parents)}},function(t,e,n){"use strict";e["a"]=function(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,a=r.length;i<a;++i){var o=r[i];if(o)return o}return null}},function(t,e,n){"use strict";e["a"]=function(){var t=new Array(this.size()),e=-1;return this.each(function(){t[++e]=this}),t}},function(t,e,n){"use strict";e["a"]=function(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var r,i=t[e],a=i.length-1,o=i[a];--a>=0;)(r=i[a])&&(o&&4^r.compareDocumentPosition(o)&&o.parentNode.insertBefore(r,o),o=r);return this}},function(t,e,n){"use strict";function r(t){return function(){delete this[t]}}function i(t,e){return function(){this[t]=e}}function a(t,e){return function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}}e["a"]=function(t,e){return arguments.length>1?this.each((null==e?r:"function"===typeof e?a:i)(t,e)):this.node()[t]}},function(t,e,n){"use strict";function r(){this.nextSibling&&this.parentNode.appendChild(this)}e["a"]=function(){return this.each(r)}},function(t,e,n){"use strict";function r(){var t=this.parentNode;t&&t.removeChild(this)}e["a"]=function(){return this.each(r)}},function(t,e,n){"use strict";var r=n(17),i=n(93);e["a"]=function(t){"function"!==typeof t&&(t=n.i(i["a"])(t));for(var e=this._groups,a=e.length,o=new Array(a),s=0;s<a;++s)for(var u,l,c=e[s],h=c.length,f=o[s]=new Array(h),p=0;p<h;++p)(u=c[p])&&(l=t.call(u,u.__data__,p,c))&&("__data__"in u&&(l.__data__=u.__data__),f[p]=l);return new r["b"](o,this._parents)}},function(t,e,n){"use strict";var r=n(17),i=n(213);e["a"]=function(t){"function"!==typeof t&&(t=n.i(i["a"])(t));for(var e=this._groups,a=e.length,o=[],s=[],u=0;u<a;++u)for(var l,c=e[u],h=c.length,f=0;f<h;++f)(l=c[f])&&(o.push(t.call(l,l.__data__,f,c)),s.push(l));return new r["b"](o,s)}},function(t,e,n){"use strict";e["a"]=function(){var t=0;return this.each(function(){++t}),t}},function(t,e,n){"use strict";var r=n(17);function i(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}e["a"]=function(t){function e(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}t||(t=i);for(var n=this._groups,a=n.length,o=new Array(a),s=0;s<a;++s){for(var u,l=n[s],c=l.length,h=o[s]=new Array(c),f=0;f<c;++f)(u=l[f])&&(h[f]=u);h.sort(e)}return new r["b"](o,this._parents).order()}},function(t,e,n){"use strict";function r(){this.textContent=""}function i(t){return function(){this.textContent=t}}function a(t){return function(){var e=t.apply(this,arguments);this.textContent=null==e?"":e}}e["a"]=function(t){return arguments.length?this.each(null==t?r:("function"===typeof t?a:i)(t)):this.node().textContent}},function(t,e,n){"use strict";var r=n(94),i=n(58);e["a"]=function(t,e,a){arguments.length<3&&(a=e,e=n.i(r["a"])().changedTouches);for(var o,s=0,u=e?e.length:0;s<u;++s)if((o=e[s]).identifier===a)return n.i(i["a"])(t,o);return null}},function(t,e,n){"use strict";var r=n(94),i=n(58);e["a"]=function(t,e){null==e&&(e=n.i(r["a"])().touches);for(var a=0,o=e?e.length:0,s=new Array(o);a<o;++a)s[a]=n.i(i["a"])(t,e[a]);return s}},function(t,e,n){"use strict";var r=n(97);e["a"]=function(t,e,i){var a=new r["d"],o=e;return null==e?(a.restart(t,e,i),a):(e=+e,i=null==i?n.i(r["a"])():+i,a.restart(function n(r){r+=o,a.restart(n,o+=e,i),t(r)},e,i),a)}},function(t,e,n){"use strict";var r=n(97);e["a"]=function(t,e,n){var i=new r["d"];return e=null==e?0:+e,i.restart(function(n){i.stop(),t(n+e)},e,n),i}},function(t,e,n){"use strict";var r=n(27),i=n(13),a=[null];e["a"]=function(t,e){var n,o,s=t.__transition;if(s)for(o in e=null==e?null:e+"",s)if((n=s[o]).state>i["d"]&&n.name===e)return new r["b"]([[t]],a,e,+o);return null}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});n(501);var r=n(27);n.d(e,"transition",function(){return r["a"]});var i=n(499);n.d(e,"active",function(){return i["a"]});var a=n(214);n.d(e,"interrupt",function(){return a["a"]})},function(t,e,n){"use strict";var r=n(21),i=n(502),a=n(503);r["selection"].prototype.interrupt=i["a"],r["selection"].prototype.transition=a["a"]},function(t,e,n){"use strict";var r=n(214);e["a"]=function(t){return this.each(function(){n.i(r["a"])(this,t)})}},function(t,e,n){"use strict";var r=n(27),i=n(13),a=n(193),o=n(96),s={time:null,delay:0,duration:250,ease:a["easeCubicInOut"]};function u(t,e){var r;while(!(r=t.__transition)||!(r=r[e]))if(!(t=t.parentNode))return s.time=n.i(o["now"])(),s;return r}e["a"]=function(t){var e,a;t instanceof r["b"]?(e=t._id,t=t._name):(e=n.i(r["c"])(),(a=s).time=n.i(o["now"])(),t=null==t?null:t+"");for(var l=this._groups,c=l.length,h=0;h<c;++h)for(var f,p=l[h],d=p.length,g=0;g<d;++g)(f=p[g])&&n.i(i["h"])(f,t,e,g,p,a||u(f,e));return new r["b"](l,this._parents,t,e)}},function(t,e,n){"use strict";var r=n(88),i=n(21),a=n(59),o=n(215);function s(t){return function(){this.removeAttribute(t)}}function u(t){return function(){this.removeAttributeNS(t.space,t.local)}}function l(t,e,n){var r,i,a=n+"";return function(){var o=this.getAttribute(t);return o===a?null:o===r?i:i=e(r=o,n)}}function c(t,e,n){var r,i,a=n+"";return function(){var o=this.getAttributeNS(t.space,t.local);return o===a?null:o===r?i:i=e(r=o,n)}}function h(t,e,n){var r,i,a;return function(){var o,s,u=n(this);if(null!=u)return o=this.getAttribute(t),s=u+"",o===s?null:o===r&&s===i?a:(i=s,a=e(r=o,u));this.removeAttribute(t)}}function f(t,e,n){var r,i,a;return function(){var o,s,u=n(this);if(null!=u)return o=this.getAttributeNS(t.space,t.local),s=u+"",o===s?null:o===r&&s===i?a:(i=s,a=e(r=o,u));this.removeAttributeNS(t.space,t.local)}}e["a"]=function(t,e){var p=n.i(i["namespace"])(t),d="transform"===p?r["e"]:o["a"];return this.attrTween(t,"function"===typeof e?(p.local?f:h)(p,d,n.i(a["b"])(this,"attr."+t,e)):null==e?(p.local?u:s)(p):(p.local?c:l)(p,d,e))}},function(t,e,n){"use strict";var r=n(21);function i(t,e){return function(n){this.setAttribute(t,e(n))}}function a(t,e){return function(n){this.setAttributeNS(t.space,t.local,e(n))}}function o(t,e){var n,r;function i(){var i=e.apply(this,arguments);return i!==r&&(n=(r=i)&&a(t,i)),n}return i._value=e,i}function s(t,e){var n,r;function a(){var a=e.apply(this,arguments);return a!==r&&(n=(r=a)&&i(t,a)),n}return a._value=e,a}e["a"]=function(t,e){var i="attr."+t;if(arguments.length<2)return(i=this.tween(i))&&i._value;if(null==e)return this.tween(i,null);if("function"!==typeof e)throw new Error;var a=n.i(r["namespace"])(t);return this.tween(i,(a.local?o:s)(a,e))}},function(t,e,n){"use strict";var r=n(13);function i(t,e){return function(){n.i(r["g"])(this,t).delay=+e.apply(this,arguments)}}function a(t,e){return e=+e,function(){n.i(r["g"])(this,t).delay=e}}e["a"]=function(t){var e=this._id;return arguments.length?this.each(("function"===typeof t?i:a)(e,t)):n.i(r["f"])(this.node(),e).delay}},function(t,e,n){"use strict";var r=n(13);function i(t,e){return function(){n.i(r["e"])(this,t).duration=+e.apply(this,arguments)}}function a(t,e){return e=+e,function(){n.i(r["e"])(this,t).duration=e}}e["a"]=function(t){var e=this._id;return arguments.length?this.each(("function"===typeof t?i:a)(e,t)):n.i(r["f"])(this.node(),e).duration}},function(t,e,n){"use strict";var r=n(13);function i(t,e){if("function"!==typeof e)throw new Error;return function(){n.i(r["e"])(this,t).ease=e}}e["a"]=function(t){var e=this._id;return arguments.length?this.each(i(e,t)):n.i(r["f"])(this.node(),e).ease}},function(t,e,n){"use strict";var r=n(13);e["a"]=function(){var t,e,i=this,a=i._id,o=i.size();return new Promise(function(s,u){var l={value:u},c={value:function(){0===--o&&s()}};i.each(function(){var i=n.i(r["e"])(this,a),o=i.on;o!==t&&(e=(t=o).copy(),e._.cancel.push(l),e._.interrupt.push(l),e._.end.push(c)),i.on=e})})}},function(t,e,n){"use strict";var r=n(21),i=n(27);e["a"]=function(t){"function"!==typeof t&&(t=n.i(r["matcher"])(t));for(var e=this._groups,a=e.length,o=new Array(a),s=0;s<a;++s)for(var u,l=e[s],c=l.length,h=o[s]=[],f=0;f<c;++f)(u=l[f])&&t.call(u,u.__data__,f,l)&&h.push(u);return new i["b"](o,this._parents,this._name,this._id)}},function(t,e,n){"use strict";var r=n(27);e["a"]=function(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,i=e.length,a=n.length,o=Math.min(i,a),s=new Array(i),u=0;u<o;++u)for(var l,c=e[u],h=n[u],f=c.length,p=s[u]=new Array(f),d=0;d<f;++d)(l=c[d]||h[d])&&(p[d]=l);for(;u<i;++u)s[u]=e[u];return new r["b"](s,this._parents,this._name,this._id)}},function(t,e,n){"use strict";var r=n(13);function i(t){return(t+"").trim().split(/^|\s+/).every(function(t){var e=t.indexOf(".");return e>=0&&(t=t.slice(0,e)),!t||"start"===t})}function a(t,e,n){var a,o,s=i(e)?r["g"]:r["e"];return function(){var r=s(this,t),i=r.on;i!==a&&(o=(a=i).copy()).on(e,n),r.on=o}}e["a"]=function(t,e){var i=this._id;return arguments.length<2?n.i(r["f"])(this.node(),i).on.on(t):this.each(a(i,t,e))}},function(t,e,n){"use strict";function r(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}e["a"]=function(){return this.on("end.remove",r(this._id))}},function(t,e,n){"use strict";var r=n(21),i=n(27),a=n(13);e["a"]=function(t){var e=this._name,o=this._id;"function"!==typeof t&&(t=n.i(r["selector"])(t));for(var s=this._groups,u=s.length,l=new Array(u),c=0;c<u;++c)for(var h,f,p=s[c],d=p.length,g=l[c]=new Array(d),v=0;v<d;++v)(h=p[v])&&(f=t.call(h,h.__data__,v,p))&&("__data__"in h&&(f.__data__=h.__data__),g[v]=f,n.i(a["h"])(g[v],e,o,v,g,n.i(a["f"])(h,o)));return new i["b"](l,this._parents,e,o)}},function(t,e,n){"use strict";var r=n(21),i=n(27),a=n(13);e["a"]=function(t){var e=this._name,o=this._id;"function"!==typeof t&&(t=n.i(r["selectorAll"])(t));for(var s=this._groups,u=s.length,l=[],c=[],h=0;h<u;++h)for(var f,p=s[h],d=p.length,g=0;g<d;++g)if(f=p[g]){for(var v,y=t.call(f,f.__data__,g,p),m=n.i(a["f"])(f,o),x=0,b=y.length;x<b;++x)(v=y[x])&&n.i(a["h"])(v,e,o,x,y,m);l.push(y),c.push(f)}return new i["b"](l,c,e,o)}},function(t,e,n){"use strict";var r=n(21),i=r["selection"].prototype.constructor;e["a"]=function(){return new i(this._groups,this._parents)}},function(t,e,n){"use strict";var r=n(88),i=n(21),a=n(13),o=n(59),s=n(215);function u(t,e){var r,a,o;return function(){var s=n.i(i["style"])(this,t),u=(this.style.removeProperty(t),n.i(i["style"])(this,t));return s===u?null:s===r&&u===a?o:o=e(r=s,a=u)}}function l(t){return function(){this.style.removeProperty(t)}}function c(t,e,r){var a,o,s=r+"";return function(){var u=n.i(i["style"])(this,t);return u===s?null:u===a?o:o=e(a=u,r)}}function h(t,e,r){var a,o,s;return function(){var u=n.i(i["style"])(this,t),l=r(this),c=l+"";return null==l&&(this.style.removeProperty(t),c=l=n.i(i["style"])(this,t)),u===c?null:u===a&&c===o?s:(o=c,s=e(a=u,l))}}function f(t,e){var r,i,o,s,u="style."+e,c="end."+u;return function(){var h=n.i(a["e"])(this,t),f=h.on,p=null==h.value[u]?s||(s=l(e)):void 0;f===r&&o===p||(i=(r=f).copy()).on(c,o=p),h.on=i}}e["a"]=function(t,e,i){var a="transform"===(t+="")?r["a"]:s["a"];return null==e?this.styleTween(t,u(t,a)).on("end.style."+t,l(t)):"function"===typeof e?this.styleTween(t,h(t,a,n.i(o["b"])(this,"style."+t,e))).each(f(this._id,t)):this.styleTween(t,c(t,a,e),i).on("end.style."+t,null)}},function(t,e,n){"use strict";function r(t,e,n){return function(r){this.style.setProperty(t,e(r),n)}}function i(t,e,n){var i,a;function o(){var o=e.apply(this,arguments);return o!==a&&(i=(a=o)&&r(t,o,n)),i}return o._value=e,o}e["a"]=function(t,e,n){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==e)return this.tween(r,null);if("function"!==typeof e)throw new Error;return this.tween(r,i(t,e,null==n?"":n))}},function(t,e,n){"use strict";var r=n(59);function i(t){return function(){this.textContent=t}}function a(t){return function(){var e=t(this);this.textContent=null==e?"":e}}e["a"]=function(t){return this.tween("text","function"===typeof t?a(n.i(r["b"])(this,"text",t)):i(null==t?"":t+""))}},function(t,e,n){"use strict";var r=n(27),i=n(13);e["a"]=function(){for(var t=this._name,e=this._id,a=n.i(r["c"])(),o=this._groups,s=o.length,u=0;u<s;++u)for(var l,c=o[u],h=c.length,f=0;f<h;++f)if(l=c[f]){var p=n.i(i["f"])(l,e);n.i(i["h"])(l,t,a,f,c,{time:p.time+p.delay+p.duration,delay:0,duration:p.duration,ease:p.ease})}return new r["b"](o,this._parents,t,a)}},function(t,e,n){"use strict";var r=function(t,e,n,r,i,a,o,s){if(void 0===e)throw new Error("invariant requires an error message argument");if(!t){var u;if(void 0===e)u=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=[n,r,i,a,o,s],c=0;u=new Error(e.replace(/%s/g,function(){return l[c++]})),u.name="Invariant Violation"}throw u.framesToPop=1,u}};t.exports=r},function(t,e,n){"use strict";var r=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;function o(t){if(null===t||void 0===t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}function s(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},n=0;n<10;n++)e["_"+String.fromCharCode(n)]=n;var r=Object.getOwnPropertyNames(e).map(function(t){return e[t]});if("0123456789"!==r.join(""))return!1;var i={};return"abcdefghijklmnopqrst".split("").forEach(function(t){i[t]=t}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},i)).join("")}catch(t){return!1}}t.exports=s()?Object.assign:function(t,e){for(var n,s,u=o(t),l=1;l<arguments.length;l++){for(var c in n=Object(arguments[l]),n)i.call(n,c)&&(u[c]=n[c]);if(r){s=r(n);for(var h=0;h<s.length;h++)a.call(n,s[h])&&(u[s[h]]=n[s[h]])}}return u}},function(t,e,n){"use strict";var r=function(){},i=n(217),a={},o=Function.call.bind(Object.prototype.hasOwnProperty);function s(t,e,n,s,u){for(var l in t)if(o(t,l)){var c;try{if("function"!==typeof t[l]){var h=Error((s||"React class")+": "+n+" type `"+l+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof t[l]+"`.");throw h.name="Invariant Violation",h}c=t[l](e,l,s,n,null,i)}catch(t){c=t}if(!c||c instanceof Error||r((s||"React class")+": type specification of "+n+" `"+l+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof c+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),c instanceof Error&&!(c.message in a)){a[c.message]=!0;var f=u?u():"";r("Failed "+n+" type: "+c.message+(null!=f?f:""))}}}r=function(t){var e="Warning: "+t;"undefined"!==typeof console&&console.error(e);try{throw new Error(e)}catch(t){}},s.resetWarningCache=function(){a={}},t.exports=s},function(t,e,n){"use strict";var r=n(218),i=n(522),a=n(217),o=n(523),s=Function.call.bind(Object.prototype.hasOwnProperty),u=function(){};function l(){return null}u=function(t){var e="Warning: "+t;"undefined"!==typeof console&&console.error(e);try{throw new Error(e)}catch(t){}},t.exports=function(t,e){var n="function"===typeof Symbol&&Symbol.iterator,c="@@iterator";function h(t){var e=t&&(n&&t[n]||t[c]);if("function"===typeof e)return e}var f="<<anonymous>>",p={array:y("array"),bool:y("boolean"),func:y("function"),number:y("number"),object:y("object"),string:y("string"),symbol:y("symbol"),any:m(),arrayOf:x,element:b(),elementType:_(),instanceOf:w,node:k(),objectOf:S,oneOf:M,oneOfType:C,shape:A,exact:P};function d(t,e){return t===e?0!==t||1/t===1/e:t!==t&&e!==e}function g(t){this.message=t,this.stack=""}function v(t){var n={},r=0;function i(i,o,s,l,c,h,p){if(l=l||f,h=h||s,p!==a){if(e){var d=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw d.name="Invariant Violation",d}if("undefined"!==typeof console){var v=l+":"+s;!n[v]&&r<3&&(u("You are manually calling a React.PropTypes validation function for the `"+h+"` prop on `"+l+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),n[v]=!0,r++)}}return null==o[s]?i?null===o[s]?new g("The "+c+" `"+h+"` is marked as required in `"+l+"`, but its value is `null`."):new g("The "+c+" `"+h+"` is marked as required in `"+l+"`, but its value is `undefined`."):null:t(o,s,l,c,h)}var o=i.bind(null,!1);return o.isRequired=i.bind(null,!0),o}function y(t){function e(e,n,r,i,a,o){var s=e[n],u=O(s);if(u!==t){var l=E(s);return new g("Invalid "+i+" `"+a+"` of type `"+l+"` supplied to `"+r+"`, expected `"+t+"`.")}return null}return v(e)}function m(){return v(l)}function x(t){function e(e,n,r,i,o){if("function"!==typeof t)return new g("Property `"+o+"` of component `"+r+"` has invalid PropType notation inside arrayOf.");var s=e[n];if(!Array.isArray(s)){var u=O(s);return new g("Invalid "+i+" `"+o+"` of type `"+u+"` supplied to `"+r+"`, expected an array.")}for(var l=0;l<s.length;l++){var c=t(s,l,r,i,o+"["+l+"]",a);if(c instanceof Error)return c}return null}return v(e)}function b(){function e(e,n,r,i,a){var o=e[n];if(!t(o)){var s=O(o);return new g("Invalid "+i+" `"+a+"` of type `"+s+"` supplied to `"+r+"`, expected a single ReactElement.")}return null}return v(e)}function _(){function t(t,e,n,i,a){var o=t[e];if(!r.isValidElementType(o)){var s=O(o);return new g("Invalid "+i+" `"+a+"` of type `"+s+"` supplied to `"+n+"`, expected a single ReactElement type.")}return null}return v(t)}function w(t){function e(e,n,r,i,a){if(!(e[n]instanceof t)){var o=t.name||f,s=D(e[n]);return new g("Invalid "+i+" `"+a+"` of type `"+s+"` supplied to `"+r+"`, expected instance of `"+o+"`.")}return null}return v(e)}function M(t){if(!Array.isArray(t))return arguments.length>1?u("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):u("Invalid argument supplied to oneOf, expected an array."),l;function e(e,n,r,i,a){for(var o=e[n],s=0;s<t.length;s++)if(d(o,t[s]))return null;var u=JSON.stringify(t,function(t,e){var n=E(e);return"symbol"===n?String(e):e});return new g("Invalid "+i+" `"+a+"` of value `"+String(o)+"` supplied to `"+r+"`, expected one of "+u+".")}return v(e)}function S(t){function e(e,n,r,i,o){if("function"!==typeof t)return new g("Property `"+o+"` of component `"+r+"` has invalid PropType notation inside objectOf.");var u=e[n],l=O(u);if("object"!==l)return new g("Invalid "+i+" `"+o+"` of type `"+l+"` supplied to `"+r+"`, expected an object.");for(var c in u)if(s(u,c)){var h=t(u,c,r,i,o+"."+c,a);if(h instanceof Error)return h}return null}return v(e)}function C(t){if(!Array.isArray(t))return u("Invalid argument supplied to oneOfType, expected an instance of array."),l;for(var e=0;e<t.length;e++){var n=t[e];if("function"!==typeof n)return u("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+L(n)+" at index "+e+"."),l}function r(e,n,r,i,o){for(var s=0;s<t.length;s++){var u=t[s];if(null==u(e,n,r,i,o,a))return null}return new g("Invalid "+i+" `"+o+"` supplied to `"+r+"`.")}return v(r)}function k(){function t(t,e,n,r,i){return I(t[e])?null:new g("Invalid "+r+" `"+i+"` supplied to `"+n+"`, expected a ReactNode.")}return v(t)}function A(t){function e(e,n,r,i,o){var s=e[n],u=O(s);if("object"!==u)return new g("Invalid "+i+" `"+o+"` of type `"+u+"` supplied to `"+r+"`, expected `object`.");for(var l in t){var c=t[l];if(c){var h=c(s,l,r,i,o+"."+l,a);if(h)return h}}return null}return v(e)}function P(t){function e(e,n,r,o,s){var u=e[n],l=O(u);if("object"!==l)return new g("Invalid "+o+" `"+s+"` of type `"+l+"` supplied to `"+r+"`, expected `object`.");var c=i({},e[n],t);for(var h in c){var f=t[h];if(!f)return new g("Invalid "+o+" `"+s+"` key `"+h+"` supplied to `"+r+"`.\nBad object: "+JSON.stringify(e[n],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(t),null," "));var p=f(u,h,r,o,s+"."+h,a);if(p)return p}return null}return v(e)}function I(e){switch(typeof e){case"number":case"string":case"undefined":return!0;case"boolean":return!e;case"object":if(Array.isArray(e))return e.every(I);if(null===e||t(e))return!0;var n=h(e);if(!n)return!1;var r,i=n.call(e);if(n!==e.entries){while(!(r=i.next()).done)if(!I(r.value))return!1}else while(!(r=i.next()).done){var a=r.value;if(a&&!I(a[1]))return!1}return!0;default:return!1}}function T(t,e){return"symbol"===t||!!e&&("Symbol"===e["@@toStringTag"]||"function"===typeof Symbol&&e instanceof Symbol)}function O(t){var e=typeof t;return Array.isArray(t)?"array":t instanceof RegExp?"object":T(e,t)?"symbol":e}function E(t){if("undefined"===typeof t||null===t)return""+t;var e=O(t);if("object"===e){if(t instanceof Date)return"date";if(t instanceof RegExp)return"regexp"}return e}function L(t){var e=E(t);switch(e){case"array":case"object":return"an "+e;case"boolean":case"date":case"regexp":return"a "+e;default:return e}}function D(t){return t.constructor&&t.constructor.name?t.constructor.name:f}return g.prototype=Error.prototype,p.checkPropTypes=o,p.resetWarningCache=o.resetWarningCache,p.PropTypes=p,p}},function(t,e,n){"use strict";(function(){Object.defineProperty(e,"__esModule",{value:!0});var t="function"===typeof Symbol&&Symbol.for,n=t?Symbol.for("react.element"):60103,r=t?Symbol.for("react.portal"):60106,i=t?Symbol.for("react.fragment"):60107,a=t?Symbol.for("react.strict_mode"):60108,o=t?Symbol.for("react.profiler"):60114,s=t?Symbol.for("react.provider"):60109,u=t?Symbol.for("react.context"):60110,l=t?Symbol.for("react.async_mode"):60111,c=t?Symbol.for("react.concurrent_mode"):60111,h=t?Symbol.for("react.forward_ref"):60112,f=t?Symbol.for("react.suspense"):60113,p=t?Symbol.for("react.memo"):60115,d=t?Symbol.for("react.lazy"):60116;function g(t){return"string"===typeof t||"function"===typeof t||t===i||t===c||t===o||t===a||t===f||"object"===typeof t&&null!==t&&(t.$$typeof===d||t.$$typeof===p||t.$$typeof===s||t.$$typeof===u||t.$$typeof===h)}var v=function(){},y=function(t){for(var e=arguments.length,n=Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];var i=0,a="Warning: "+t.replace(/%s/g,function(){return n[i++]});"undefined"!==typeof console&&console.warn(a);try{throw new Error(a)}catch(t){}};v=function(t,e){if(void 0===e)throw new Error("`lowPriorityWarning(condition, format, ...args)` requires a warning message argument");if(!t){for(var n=arguments.length,r=Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];y.apply(void 0,[e].concat(r))}};var m=v;function x(t){if("object"===typeof t&&null!==t){var e=t.$$typeof;switch(e){case n:var g=t.type;switch(g){case l:case c:case i:case o:case a:case f:return g;default:var v=g&&g.$$typeof;switch(v){case u:case h:case s:return v;default:return e}}case d:case p:case r:return e}}}var b=l,_=c,w=u,M=s,S=n,C=h,k=i,A=d,P=p,I=r,T=o,O=a,E=f,L=!1;function D(t){return L||(L=!0,m(!1,"The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),F(t)||x(t)===l}function F(t){return x(t)===c}function R(t){return x(t)===u}function j(t){return x(t)===s}function B(t){return"object"===typeof t&&null!==t&&t.$$typeof===n}function N(t){return x(t)===h}function z(t){return x(t)===i}function G(t){return x(t)===d}function V(t){return x(t)===p}function Y(t){return x(t)===r}function H(t){return x(t)===o}function W(t){return x(t)===a}function X(t){return x(t)===f}e.typeOf=x,e.AsyncMode=b,e.ConcurrentMode=_,e.ContextConsumer=w,e.ContextProvider=M,e.Element=S,e.ForwardRef=C,e.Fragment=k,e.Lazy=A,e.Memo=P,e.Portal=I,e.Profiler=T,e.StrictMode=O,e.Suspense=E,e.isValidElementType=g,e.isAsyncMode=D,e.isConcurrentMode=F,e.isContextConsumer=R,e.isContextProvider=j,e.isElement=B,e.isForwardRef=N,e.isFragment=z,e.isLazy=G,e.isMemo=V,e.isPortal=Y,e.isProfiler=H,e.isStrictMode=W,e.isSuspense=X})()},function(t,e,n){(function(t,r){r(e,n(21),n(500))})(0,function(t,e,n){"use strict";var r=1e-10;function i(t,e){var n,i=o(t),l=i.filter(function(e){return a(e,t)}),c=0,f=0,p=[];if(l.length>1){var d=h(l);for(n=0;n<l.length;++n){var g=l[n];g.angle=Math.atan2(g.x-d.x,g.y-d.y)}l.sort(function(t,e){return e.angle-t.angle});var v=l[l.length-1];for(n=0;n<l.length;++n){var y=l[n];f+=(v.x+y.x)*(y.y-v.y);for(var m={x:(y.x+v.x)/2,y:(y.y+v.y)/2},x=null,b=0;b<y.parentIndex.length;++b)if(v.parentIndex.indexOf(y.parentIndex[b])>-1){var _=t[y.parentIndex[b]],w=Math.atan2(y.x-_.x,y.y-_.y),M=Math.atan2(v.x-_.x,v.y-_.y),S=M-w;S<0&&(S+=2*Math.PI);var C=M-S/2,k=u(m,{x:_.x+_.radius*Math.sin(C),y:_.y+_.radius*Math.cos(C)});k>2*_.radius&&(k=2*_.radius),(null===x||x.width>k)&&(x={circle:_,width:k,p1:y,p2:v})}null!==x&&(p.push(x),c+=s(x.circle.radius,x.width),v=y)}}else{var A=t[0];for(n=1;n<t.length;++n)t[n].radius<A.radius&&(A=t[n]);var P=!1;for(n=0;n<t.length;++n)if(u(t[n],A)>Math.abs(A.radius-t[n].radius)){P=!0;break}P?c=f=0:(c=A.radius*A.radius*Math.PI,p.push({circle:A,p1:{x:A.x,y:A.y+A.radius},p2:{x:A.x-r,y:A.y+A.radius},width:2*A.radius}))}return f/=2,e&&(e.area=c+f,e.arcArea=c,e.polygonArea=f,e.arcs=p,e.innerPoints=l,e.intersectionPoints=i),c+f}function a(t,e){for(var n=0;n<e.length;++n)if(u(t,e[n])>e[n].radius+r)return!1;return!0}function o(t){for(var e=[],n=0;n<t.length;++n)for(var r=n+1;r<t.length;++r)for(var i=c(t[n],t[r]),a=0;a<i.length;++a){var o=i[a];o.parentIndex=[n,r],e.push(o)}return e}function s(t,e){return t*t*Math.acos(1-e/t)-(t-e)*Math.sqrt(e*(2*t-e))}function u(t,e){return Math.sqrt((t.x-e.x)*(t.x-e.x)+(t.y-e.y)*(t.y-e.y))}function l(t,e,n){if(n>=t+e)return 0;if(n<=Math.abs(t-e))return Math.PI*Math.min(t,e)*Math.min(t,e);var r=t-(n*n-e*e+t*t)/(2*n),i=e-(n*n-t*t+e*e)/(2*n);return s(t,r)+s(e,i)}function c(t,e){var n=u(t,e),r=t.radius,i=e.radius;if(n>=r+i||n<=Math.abs(r-i))return[];var a=(r*r-i*i+n*n)/(2*n),o=Math.sqrt(r*r-a*a),s=t.x+a*(e.x-t.x)/n,l=t.y+a*(e.y-t.y)/n,c=-(e.y-t.y)*(o/n),h=-(e.x-t.x)*(o/n);return[{x:s+c,y:l-h},{x:s-c,y:l+h}]}function h(t){for(var e={x:0,y:0},n=0;n<t.length;++n)e.x+=t[n].x,e.y+=t[n].y;return e.x/=t.length,e.y/=t.length,e}function f(t,e,n,r){r=r||{};var i=r.maxIterations||100,a=r.tolerance||1e-10,o=t(e),s=t(n),u=n-e;if(o*s>0)throw"Initial bisect points must have opposite signs";if(0===o)return e;if(0===s)return n;for(var l=0;l<i;++l){u/=2;var c=e+u,h=t(c);if(h*o>=0&&(e=c),Math.abs(u)<a||0===h)return c}return e+u}function p(t){for(var e=new Array(t),n=0;n<t;++n)e[n]=0;return e}function d(t,e){return p(t).map(function(){return p(e)})}function g(t,e){for(var n=0,r=0;r<t.length;++r)n+=t[r]*e[r];return n}function v(t){return Math.sqrt(g(t,t))}function y(t,e,n){for(var r=0;r<e.length;++r)t[r]=e[r]*n}function m(t,e,n,r,i){for(var a=0;a<t.length;++a)t[a]=e*n[a]+r*i[a]}function x(t,e,n){n=n||{};var r,i=n.maxIterations||200*e.length,a=n.nonZeroDelta||1.05,o=n.zeroDelta||.001,s=n.minErrorDelta||1e-6,u=n.minErrorDelta||1e-5,l=void 0!==n.rho?n.rho:1,c=void 0!==n.chi?n.chi:2,h=void 0!==n.psi?n.psi:-.5,f=void 0!==n.sigma?n.sigma:.5,p=e.length,d=new Array(p+1);d[0]=e,d[0].fx=t(e),d[0].id=0;for(var g=0;g<p;++g){var v=e.slice();v[g]=v[g]?v[g]*a:o,d[g+1]=v,d[g+1].fx=t(v),d[g+1].id=g+1}function y(t){for(var e=0;e<t.length;e++)d[p][e]=t[e];d[p].fx=t.fx}for(var x=function(t,e){return t.fx-e.fx},b=e.slice(),_=e.slice(),w=e.slice(),M=e.slice(),S=0;S<i;++S){if(d.sort(x),n.history){var C=d.map(function(t){var e=t.slice();return e.fx=t.fx,e.id=t.id,e});C.sort(function(t,e){return t.id-e.id}),n.history.push({x:d[0].slice(),fx:d[0].fx,simplex:C})}for(r=0,g=0;g<p;++g)r=Math.max(r,Math.abs(d[0][g]-d[1][g]));if(Math.abs(d[0].fx-d[p].fx)<s&&r<u)break;for(g=0;g<p;++g){b[g]=0;for(var k=0;k<p;++k)b[g]+=d[k][g];b[g]/=p}var A=d[p];if(m(_,1+l,b,-l,A),_.fx=t(_),_.fx<d[0].fx)m(M,1+c,b,-c,A),M.fx=t(M),M.fx<_.fx?y(M):y(_);else if(_.fx>=d[p-1].fx){var P=!1;if(_.fx>A.fx?(m(w,1+h,b,-h,A),w.fx=t(w),w.fx<A.fx?y(w):P=!0):(m(w,1-h*l,b,h*l,A),w.fx=t(w),w.fx<_.fx?y(w):P=!0),P){if(f>=1)break;for(g=1;g<d.length;++g)m(d[g],1-f,d[0],f,d[g]),d[g].fx=t(d[g])}}else y(_)}return d.sort(x),{fx:d[0].fx,x:d[0]}}function b(t,e,n,r,i,a,o){var s=n.fx,u=g(n.fxprime,e),l=s,c=s,h=u,f=0;function p(c,f,p){for(var d=0;d<16;++d)if(i=(c+f)/2,m(r.x,1,n.x,i,e),l=r.fx=t(r.x,r.fxprime),h=g(r.fxprime,e),l>s+a*i*u||l>=p)f=i;else{if(Math.abs(h)<=-o*u)return i;h*(f-c)>=0&&(f=c),c=i,p=l}return 0}i=i||1,a=a||1e-6,o=o||.1;for(var d=0;d<10;++d){if(m(r.x,1,n.x,i,e),l=r.fx=t(r.x,r.fxprime),h=g(r.fxprime,e),l>s+a*i*u||d&&l>=c)return p(f,i,c);if(Math.abs(h)<=-o*u)return i;if(h>=0)return p(i,f,l);c=l,f=i,i*=2}return i}function _(t,e,n){var r,i,a,o={x:e.slice(),fx:0,fxprime:e.slice()},s={x:e.slice(),fx:0,fxprime:e.slice()},u=e.slice(),l=1;n=n||{},a=n.maxIterations||20*e.length,o.fx=t(o.x,o.fxprime),r=o.fxprime.slice(),y(r,o.fxprime,-1);for(var c=0;c<a;++c){if(l=b(t,r,o,s,l),n.history&&n.history.push({x:o.x.slice(),fx:o.fx,fxprime:o.fxprime.slice(),alpha:l}),l){m(u,1,s.fxprime,-1,o.fxprime);var h=g(o.fxprime,o.fxprime),f=Math.max(0,g(u,s.fxprime)/h);m(r,f,r,-1,s.fxprime),i=o,o=s,s=i}else y(r,o.fxprime,-1);if(v(o.fxprime)<=1e-5)break}return n.history&&n.history.push({x:o.x.slice(),fx:o.fx,fxprime:o.fxprime.slice(),alpha:l}),o}function w(t,e){e=e||{},e.maxIterations=e.maxIterations||500;var n=e.initialLayout||P,r=e.lossFunction||O;t=C(t);var i,a=n(t,e),o=[],s=[];for(i in a)a.hasOwnProperty(i)&&(o.push(a[i].x),o.push(a[i].y),s.push(i));for(var u=x(function(e){for(var n={},i=0;i<s.length;++i){var o=s[i];n[o]={x:e[2*i],y:e[2*i+1],radius:a[o].radius}}return r(n,t)},o,e),l=u.x,c=0;c<s.length;++c)i=s[c],a[i].x=l[2*c],a[i].y=l[2*c+1];return a}var M=1e-10;function S(t,e,n){return Math.min(t,e)*Math.min(t,e)*Math.PI<=n+M?Math.abs(t-e):f(function(r){return l(t,e,r)-n},0,t+e)}function C(t){t=t.slice();var e,n,r,i,a=[],o={};for(e=0;e<t.length;++e){var s=t[e];1==s.sets.length?a.push(s.sets[0]):2==s.sets.length&&(r=s.sets[0],i=s.sets[1],o[[r,i]]=!0,o[[i,r]]=!0)}for(a.sort(function(t,e){return t>e}),e=0;e<a.length;++e)for(r=a[e],n=e+1;n<a.length;++n)i=a[n],[r,i]in o||t.push({sets:[r,i],size:0});return t}function k(t,e,n){var r=d(e.length,e.length),i=d(e.length,e.length);return t.filter(function(t){return 2==t.sets.length}).map(function(t){var a=n[t.sets[0]],o=n[t.sets[1]],s=Math.sqrt(e[a].size/Math.PI),u=Math.sqrt(e[o].size/Math.PI),l=S(s,u,t.size);r[a][o]=r[o][a]=l;var c=0;t.size+1e-10>=Math.min(e[a].size,e[o].size)?c=1:t.size<=1e-10&&(c=-1),i[a][o]=i[o][a]=c}),{distances:r,constraints:i}}function A(t,e,n,r){var i,a=0;for(i=0;i<e.length;++i)e[i]=0;for(i=0;i<n.length;++i)for(var o=t[2*i],s=t[2*i+1],u=i+1;u<n.length;++u){var l=t[2*u],c=t[2*u+1],h=n[i][u],f=r[i][u],p=(l-o)*(l-o)+(c-s)*(c-s),d=Math.sqrt(p),g=p-h*h;f>0&&d<=h||f<0&&d>=h||(a+=2*g*g,e[2*i]+=4*g*(o-l),e[2*i+1]+=4*g*(s-c),e[2*u]+=4*g*(l-o),e[2*u+1]+=4*g*(c-s))}return a}function P(t,e){var n=T(t,e),r=e.lossFunction||O;if(t.length>=8){var i=I(t,e),a=r(i,t),o=r(n,t);a+1e-8<o&&(n=i)}return n}function I(t,e){e=e||{};var n,r=e.restarts||10,i=[],a={};for(n=0;n<t.length;++n){var o=t[n];1==o.sets.length&&(a[o.sets[0]]=i.length,i.push(o))}var s=k(t,i,a),u=s.distances,l=s.constraints,c=v(u.map(v))/u.length;u=u.map(function(t){return t.map(function(t){return t/c})});var h,f,d=function(t,e){return A(t,e,u,l)};for(n=0;n<r;++n){var g=p(2*u.length).map(Math.random);f=_(d,g,e),(!h||f.fx<h.fx)&&(h=f)}var m=h.x,x={};for(n=0;n<i.length;++n){var b=i[n];x[b.sets[0]]={x:m[2*n]*c,y:m[2*n+1]*c,radius:Math.sqrt(b.size/Math.PI)}}if(e.history)for(n=0;n<e.history.length;++n)y(e.history[n].x,c);return x}function T(t,e){for(var n,r=e&&e.lossFunction?e.lossFunction:O,i={},a={},o=0;o<t.length;++o){var s=t[o];1==s.sets.length&&(n=s.sets[0],i[n]={x:1e10,y:1e10,rowid:i.length,size:s.size,radius:Math.sqrt(s.size/Math.PI)},a[n]=[])}for(t=t.filter(function(t){return 2==t.sets.length}),o=0;o<t.length;++o){var u=t[o],l=u.hasOwnProperty("weight")?u.weight:1,h=u.sets[0],f=u.sets[1];u.size+M>=Math.min(i[h].size,i[f].size)&&(l=0),a[h].push({set:f,size:u.size,weight:l}),a[f].push({set:h,size:u.size,weight:l})}var p=[];for(n in a)if(a.hasOwnProperty(n)){var d=0;for(o=0;o<a[n].length;++o)d+=a[n][o].size*a[n][o].weight;p.push({set:n,size:d})}function g(t,e){return e.size-t.size}p.sort(g);var v={};function y(t){return t.set in v}function m(t,e){i[e].x=t.x,i[e].y=t.y,v[e]=!0}for(m({x:0,y:0},p[0].set),o=1;o<p.length;++o){var x=p[o].set,b=a[x].filter(y);if(n=i[x],b.sort(g),0===b.length)throw"ERROR: missing pairwise overlap information";for(var _=[],w=0;w<b.length;++w){var C=i[b[w].set],k=S(n.radius,C.radius,b[w].size);_.push({x:C.x+k,y:C.y}),_.push({x:C.x-k,y:C.y}),_.push({y:C.y+k,x:C.x}),_.push({y:C.y-k,x:C.x});for(var A=w+1;A<b.length;++A)for(var P=i[b[A].set],I=S(n.radius,P.radius,b[A].size),T=c({x:C.x,y:C.y,radius:k},{x:P.x,y:P.y,radius:I}),E=0;E<T.length;++E)_.push(T[E])}var L=1e50,D=_[0];for(w=0;w<_.length;++w){i[x].x=_[w].x,i[x].y=_[w].y;var F=r(i,t);F<L&&(L=F,D=_[w])}m(D,x)}return i}function O(t,e){var n=0;function r(e){return e.map(function(e){return t[e]})}for(var a=0;a<e.length;++a){var o,s=e[a];if(1!=s.sets.length){if(2==s.sets.length){var c=t[s.sets[0]],h=t[s.sets[1]];o=l(c.radius,h.radius,u(c,h))}else o=i(r(s.sets));var f=s.hasOwnProperty("weight")?s.weight:1;n+=f*(o-s.size)*(o-s.size)}}return n}function E(t,e,n){var r;if(null===n?t.sort(function(t,e){return e.radius-t.radius}):t.sort(n),t.length>0){var i=t[0].x,a=t[0].y;for(r=0;r<t.length;++r)t[r].x-=i,t[r].y-=a}if(2==t.length){var o=u(t[0],t[1]);o<Math.abs(t[1].radius-t[0].radius)&&(t[1].x=t[0].x+t[0].radius-t[1].radius-1e-10,t[1].y=t[0].y)}if(t.length>1){var s,l,c=Math.atan2(t[1].x,t[1].y)-e,h=Math.cos(c),f=Math.sin(c);for(r=0;r<t.length;++r)s=t[r].x,l=t[r].y,t[r].x=h*s-f*l,t[r].y=f*s+h*l}if(t.length>2){var p=Math.atan2(t[2].x,t[2].y)-e;while(p<0)p+=2*Math.PI;while(p>2*Math.PI)p-=2*Math.PI;if(p>Math.PI){var d=t[1].y/(1e-10+t[1].x);for(r=0;r<t.length;++r){var g=(t[r].x+d*t[r].y)/(1+d*d);t[r].x=2*g-t[r].x,t[r].y=2*g*d-t[r].y}}}}function L(t){function e(t){return t.parent!==t&&(t.parent=e(t.parent)),t.parent}function n(t,n){var r=e(t),i=e(n);r.parent=i}t.map(function(t){t.parent=t});for(var r=0;r<t.length;++r)for(var i=r+1;i<t.length;++i){var a=t[r].radius+t[i].radius;u(t[r],t[i])+1e-10<a&&n(t[i],t[r])}var o,s={};for(r=0;r<t.length;++r)o=e(t[r]).parent.setid,o in s||(s[o]=[]),s[o].push(t[r]);t.map(function(t){delete t.parent});var l=[];for(o in s)s.hasOwnProperty(o)&&l.push(s[o]);return l}function D(t){var e=function(e){var n=Math.max.apply(null,t.map(function(t){return t[e]+t.radius})),r=Math.min.apply(null,t.map(function(t){return t[e]-t.radius}));return{max:n,min:r}};return{xRange:e("x"),yRange:e("y")}}function F(t,e,n){null===e&&(e=Math.PI/2);var r,i,a=[];for(i in t)if(t.hasOwnProperty(i)){var o=t[i];a.push({x:o.x,y:o.y,radius:o.radius,setid:i})}var s=L(a);for(r=0;r<s.length;++r){E(s[r],e,n);var u=D(s[r]);s[r].size=(u.xRange.max-u.xRange.min)*(u.yRange.max-u.yRange.min),s[r].bounds=u}s.sort(function(t,e){return e.size-t.size}),a=s[0];var l=a.bounds,c=(l.xRange.max-l.xRange.min)/50;function h(t,e,n){if(t){var r,i,o,s=t.bounds;e?r=l.xRange.max-s.xRange.min+c:(r=l.xRange.max-s.xRange.max,o=(s.xRange.max-s.xRange.min)/2-(l.xRange.max-l.xRange.min)/2,o<0&&(r+=o)),n?i=l.yRange.max-s.yRange.min+c:(i=l.yRange.max-s.yRange.max,o=(s.yRange.max-s.yRange.min)/2-(l.yRange.max-l.yRange.min)/2,o<0&&(i+=o));for(var u=0;u<t.length;++u)t[u].x+=r,t[u].y+=i,a.push(t[u])}}var f=1;while(f<s.length)h(s[f],!0,!1),h(s[f+1],!1,!0),h(s[f+2],!0,!0),f+=3,l=D(a);var p={};for(r=0;r<a.length;++r)p[a[r].setid]=a[r];return p}function R(t,e,n,r){var i=[],a=[];for(var o in t)t.hasOwnProperty(o)&&(a.push(o),i.push(t[o]));e-=2*r,n-=2*r;var s=D(i),u=s.xRange,l=s.yRange;if(u.max==u.min||l.max==l.min)return console.log("not scaling solution: zero size detected"),t;for(var c=e/(u.max-u.min),h=n/(l.max-l.min),f=Math.min(h,c),p=(e-(u.max-u.min)*f)/2,d=(n-(l.max-l.min)*f)/2,g={},v=0;v<i.length;++v){var y=i[v];g[a[v]]={radius:f*y.radius,x:r+p+(y.x-u.min)*f,y:r+d+(y.y-l.min)*f}}return g}function j(){var t=600,n=350,r=15,i=1e3,a=Math.PI/2,o=!0,s=!0,u=!0,l=null,c=null,h={},f=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],p=0,d=function(t){if(t in h)return h[t];var e=h[t]=f[p];return p+=1,p>=f.length&&(p=0),e},g=w,v=O;function y(h){var f=h.datum(),p={};f.forEach(function(t){0==t.size&&1==t.sets.length&&(p[t.sets[0]]=1)}),f=f.filter(function(t){return!t.sets.some(function(t){return t in p})});var y={},m={};if(f.length>0){var x=g(f,{lossFunction:v});o&&(x=F(x,a,c)),y=R(x,t,n,r),m=V(y,f)}var b={};function _(t){return t.sets in b?b[t.sets]:1==t.sets.length?""+t.sets[0]:void 0}f.forEach(function(t){t.label&&(b[t.sets]=t.label)}),h.selectAll("svg").data([y]).enter().append("svg");var w=h.select("svg").attr("width",t).attr("height",n),M={},S=!1;w.selectAll(".venn-area path").each(function(t){var n=e.select(this).attr("d");1==t.sets.length&&n&&(S=!0,M[t.sets[0]]=W(n))});var C=function(e){return function(r){var i=e.sets.map(function(e){var i=M[e],a=y[e];return i||(i={x:t/2,y:n/2,radius:1}),a||(a={x:t/2,y:n/2,radius:1}),{x:i.x*(1-r)+a.x*r,y:i.y*(1-r)+a.y*r,radius:i.radius*(1-r)+a.radius*r}});return X(i)}},k=w.selectAll(".venn-area").data(f,function(t){return t.sets}),A=k.enter().append("g").attr("class",function(t){return"venn-area venn-"+(1==t.sets.length?"circle":"intersection")}).attr("data-venn-sets",function(t){return t.sets.join("_")}),P=A.append("path"),I=A.append("text").attr("class","label").text(function(t){return _(t)}).attr("text-anchor","middle").attr("dy",".35em").attr("x",t/2).attr("y",n/2);u&&(P.style("fill-opacity","0").filter(function(t){return 1==t.sets.length}).style("fill",function(t){return d(t.sets)}).style("fill-opacity",".25"),I.style("fill",function(t){return 1==t.sets.length?d(t.sets):"#444"}));var T=h;S?(T=h.transition("venn").duration(i),T.selectAll("path").attrTween("d",C)):T.selectAll("path").attr("d",function(t){return X(t.sets.map(function(t){return y[t]}))});var O=T.selectAll("text").filter(function(t){return t.sets in m}).text(function(t){return _(t)}).attr("x",function(t){return Math.floor(m[t.sets].x)}).attr("y",function(t){return Math.floor(m[t.sets].y)});s&&(S?"on"in O?O.on("end",B(y,_)):O.each("end",B(y,_)):O.each(B(y,_)));var E=k.exit().transition("venn").duration(i).remove();E.selectAll("path").attrTween("d",C);var L=E.selectAll("text").attr("x",t/2).attr("y",n/2);return null!==l&&(I.style("font-size","0px"),O.style("font-size",l),L.style("font-size","0px")),{circles:y,textCentres:m,nodes:k,enter:A,update:T,exit:E}}return y.wrap=function(t){return arguments.length?(s=t,y):s},y.width=function(e){return arguments.length?(t=e,y):t},y.height=function(t){return arguments.length?(n=t,y):n},y.padding=function(t){return arguments.length?(r=t,y):r},y.colours=function(t){return arguments.length?(d=t,y):d},y.fontSize=function(t){return arguments.length?(l=t,y):l},y.duration=function(t){return arguments.length?(i=t,y):i},y.layoutFunction=function(t){return arguments.length?(g=t,y):g},y.normalize=function(t){return arguments.length?(o=t,y):o},y.styled=function(t){return arguments.length?(u=t,y):u},y.orientation=function(t){return arguments.length?(a=t,y):a},y.orientationOrder=function(t){return arguments.length?(c=t,y):c},y.lossFunction=function(t){return arguments.length?(v=t,y):v},y}function B(t,n){return function(){var r,i=e.select(this),a=i.datum(),o=t[a.sets[0]].radius||50,s=n(a)||"",u=s.split(/\s+/).reverse(),l=3,c=(s.length+u.length)/l,h=u.pop(),f=[h],p=0,d=1.1,g=i.text(null).append("tspan").text(h);while(1){if(h=u.pop(),!h)break;f.push(h),r=f.join(" "),g.text(r),r.length>c&&g.node().getComputedTextLength()>o&&(f.pop(),g.text(f.join(" ")),f=[h],g=i.append("tspan").text(h),p++)}var v=.35-p*d/2,y=i.attr("x"),m=i.attr("y");i.selectAll("tspan").attr("x",y).attr("y",m).attr("dy",function(t,e){return v+e*d+"em"})}}function N(t,e,n){var r,i,a=e[0].radius-u(e[0],t);for(r=1;r<e.length;++r)i=e[r].radius-u(e[r],t),i<=a&&(a=i);for(r=0;r<n.length;++r)i=u(n[r],t)-n[r].radius,i<=a&&(a=i);return a}function z(t,e){var n,r=[];for(n=0;n<t.length;++n){var a=t[n];r.push({x:a.x,y:a.y}),r.push({x:a.x+a.radius/2,y:a.y}),r.push({x:a.x-a.radius/2,y:a.y}),r.push({x:a.x,y:a.y+a.radius/2}),r.push({x:a.x,y:a.y-a.radius/2})}var o=r[0],s=N(r[0],t,e);for(n=1;n<r.length;++n){var l=N(r[n],t,e);l>=s&&(o=r[n],s=l)}var c=x(function(n){return-1*N({x:n[0],y:n[1]},t,e)},[o.x,o.y],{maxIterations:500,minErrorDelta:1e-10}).x,f={x:c[0],y:c[1]},p=!0;for(n=0;n<t.length;++n)if(u(f,t[n])>t[n].radius){p=!1;break}for(n=0;n<e.length;++n)if(u(f,e[n])<e[n].radius){p=!1;break}if(!p)if(1==t.length)f={x:t[0].x,y:t[0].y};else{var d={};i(t,d),f=0===d.arcs.length?{x:0,y:-1e3,disjoint:!0}:1==d.arcs.length?{x:d.arcs[0].circle.x,y:d.arcs[0].circle.y}:e.length?z(t,[]):h(d.arcs.map(function(t){return t.p1}))}return f}function G(t){var e={},n=[];for(var r in t)n.push(r),e[r]=[];for(var i=0;i<n.length;i++)for(var a=t[n[i]],o=i+1;o<n.length;++o){var s=t[n[o]],l=u(a,s);l+s.radius<=a.radius+1e-10?e[n[o]].push(n[i]):l+a.radius<=s.radius+1e-10&&e[n[i]].push(n[o])}return e}function V(t,e){for(var n={},r=G(t),i=0;i<e.length;++i){for(var a=e[i].sets,o={},s={},u=0;u<a.length;++u){o[a[u]]=!0;for(var l=r[a[u]],c=0;c<l.length;++c)s[l[c]]=!0}var h=[],f=[];for(var p in t)p in o?h.push(t[p]):p in s||f.push(t[p]);var d=z(h,f);n[a]=d,d.disjoint&&e[i].size>0&&console.log("WARNING: area "+a+" not represented on screen")}return n}function Y(t,e){for(var n=G(t.selectAll("svg").datum()),r={},i=0;i<e.sets.length;++i){var a=e.sets[i];for(var o in n)for(var s=n[o],u=0;u<s.length;++u)if(s[u]==a){r[o]=!0;break}}function l(t){for(var e=0;e<t.length;++e)if(!(t[e]in r))return!1;return!0}t.selectAll("g").sort(function(t,n){return t.sets.length!=n.sets.length?t.sets.length-n.sets.length:t==e?l(n.sets)?-1:1:n==e?l(t.sets)?1:-1:n.size-t.size})}function H(t,e,n){var r=[];return r.push("\nM",t,e),r.push("\nm",-n,0),r.push("\na",n,n,0,1,0,2*n,0),r.push("\na",n,n,0,1,0,2*-n,0),r.join(" ")}function W(t){var e=t.split(" ");return{x:parseFloat(e[1]),y:parseFloat(e[2]),radius:-parseFloat(e[4])}}function X(t){var e={};i(t,e);var n=e.arcs;if(0===n.length)return"M 0 0";if(1==n.length){var r=n[0].circle;return H(r.x,r.y,r.radius)}for(var a=["\nM",n[0].p2.x,n[0].p2.y],o=0;o<n.length;++o){var s=n[o],u=s.circle.radius,l=s.width>u;a.push("\nA",u,u,0,l?1:0,1,s.p1.x,s.p1.y)}return a.join(" ")}t.intersectionArea=i,t.circleCircleIntersection=c,t.circleOverlap=l,t.circleArea=s,t.distance=u,t.venn=w,t.greedyLayout=T,t.scaleSolution=R,t.normalizeSolution=F,t.bestInitialLayout=P,t.lossFunction=O,t.disjointCluster=L,t.distanceFromIntersectArea=S,t.VennDiagram=j,t.wrapText=B,t.computeTextCentres=V,t.computeTextCentre=z,t.sortAreas=Y,t.circlePath=H,t.circleFromPath=W,t.intersectionAreaPath=X,Object.defineProperty(t,"__esModule",{value:!0})})},function(t,e,n){n(60),t.exports=n(60)}])})}}]);
'use strict' module.exports.endPoints = { GET_CARS: { apiUrl: 'cars/', method: 'GET', }, POST_CITIES: { apiUrl: 'cities/', method: 'POST', }, PUT_DELETE: { apiUrl: 'try_delete/', method: 'DELETE', }, PUT_TRY: { apiUrl: 'try_put/', method: 'PUT', }, GET_TEST1: { apiUrl: 'test_cache1/', method: 'GET', }, POST_TEST2: { apiUrl: 'test_cache2/', method: 'POST', }, }
const { default: WebDriver} = require("webdriver"); const browserInfo = { brave: { name: "Brave", bundleId: "com.brave.ios.browser", urlBarClick: "url", urlBarKeys: "url" }, chrome: { name: "Chrome", bundleId: "com.google.chrome.ios", urlBarClick: "Address and search bar", urlBarClick2: "NTPHomeFakeOmniboxAccessibilityID", urlBarKeys: "Address", }, duckduckgo: { name: "DuckDuckGo", bundleId: "com.duckduckgo.mobile.ios", urlBarClick: "searchEntry", urlBarKeys: "searchEntry", }, edge: { name: "Edge", bundleId: "com.microsoft.msedge", urlBarClick: "Search and address bar", urlBarClick2: "NTPHomeFakeOmniboxAccessibilityID", urlBarKeys: "Address" }, firefox: { name: "Firefox", bundleId: "org.mozilla.ios.Firefox", urlBarClick: "url", urlBarKeys: "address" }, focus: { name: "Firefox Focus", bundleId: "org.mozilla.ios.Focus", urlBarClick: "URLBar.urlText", urlBarKeys: "URLBar.urlText", }, onion: { name: "Onion Browser", bundleId: "com.miketigas.OnionBrowser", urlBarClickClass: "XCUIElementTypeTextField", // Hoping this is the only one present urlBarKeys: "Onion Browser", // application element postLaunchDelay: 10000 }, opera: { name: "Opera", bundleId: "com.opera.OperaTouch", urlBarClickClass: "XCUIElementTypeTextField", // Hoping this is the only one present urlBarKeys: "addressBar", // parent element }, safari: { name: "Safari", bundleId: "com.apple.mobilesafari", urlBarClick: "TabBarItemTitle", urlBarKeys: "URL" }, yandex: { name: "Yandex", bundleId: "ru.yandex.mobile.search", urlBarClick: "Address bar", urlBarClick2: "Enter a search query or URL", urlBarClear: "Clear the input field", urlBarKeys: "Yandex", // Just send keys to the application and hope our focus is correct } }; const sleepMs = (t) => new Promise((resolve, reject) => setTimeout(resolve, t)); const findElementWithName = async (client, name) => { const elementObject = await client.findElement("name", name); return elementObject.ELEMENT; }; const clickElementWithName = async (client, name) => { const element = await findElementWithName(client, name); return await client.elementClick(element); }; const findElementWithClass = async (client, className) => { const elementObject = await client.findElement("class name", className); return elementObject.ELEMENT; }; class iOSBrowser { constructor({browser, incognito, tor, nightly}) { Object.assign(this, { browser, incognito, tor, nightly }, browserInfo[browser]); } // Launch the browser. async launch() { const client = await WebDriver.newSession({ port: 4723, hostname: "0.0.0.0", path: "/wd/hub", capabilities: { "appium:bundleId": this.bundleId, "platformName": "iOS", "appium:udid": "auto", "appium:xcodeOrgId": "MGQ2CFRT2X", "appium:xcodeSigningId": "iPhone Developer", "appium:automationName": "XCUITest", "appium:deviceName": "iPhone 7", "appium:wdaLaunchTimeout": 30000, "appium:wdaConnectionTimeout": 30000, // "appium:platformVersion": "15.1" } }); this.client = client; if (this.postLaunchDelay) { await sleepMs(this.postLaunchDelay); } } // Get the browser version. async version() { await this.client.terminateApp("com.apple.Preferences"); //await sleepMs(1000); await this.client.activateApp("com.apple.Preferences"); //await sleepMs(500); await clickElementWithName(this.client, "General"); //await sleepMs(500); await clickElementWithName(this.client, "iPhone Storage"); await sleepMs(4000); if (this.browser === "safari") { const elements = await this.client.findElements("name", "Title"); console.log(elements); for (let element of elements.reverse()) { const label = await this.client.getElementAttribute(element.ELEMENT, "label"); console.log(label); if (label && label.startsWith("iOS")) { await this.client.elementClick(element.ELEMENT); break; } } } else { await clickElementWithName(this.client, `App:${this.name}`); } await sleepMs(1000); const infoElement = await findElementWithName(this.client, "Info"); console.log(infoElement); const infoText = await this.client.getElementText(infoElement); // Remove the word "Version" from the info text if it's present. const versionText = infoText.replace("Version ", "").trim(); await this.client.terminateApp("com.apple.Preferences"); return versionText; } // Open the url in a new tab. async openUrl(url) { let urlBarToClick; if (this.urlBarClickClass) { urlBarToClick = await findElementWithClass(this.client, this.urlBarClickClass); } else { urlBarToClick = await findElementWithName(this.client, this.urlBarClick); if (urlBarToClick === undefined) { if (this.urlBarClick2) { urlBarToClick = await findElementWithName(this.client, this.urlBarClick2); } if (urlBarToClick === undefined) { urlBarToClick = await findElementWithName(this.client, this.urlBarKeys); // await sleepMs(1000); // urlBarToClick = await findElementWithId(this.client, this.packageName, this.urlBarClick); } } } await this.client.elementClick(urlBarToClick); await sleepMs(1000); if (this.urlBarClear) { await clickElementWithName(this.client, this.urlBarClear); } const urlBarToSendKeys = await findElementWithName(this.client, this.urlBarKeys); await this.client.elementSendKeys(urlBarToSendKeys, url); const goButton = await findElementWithName(this.client, "Go"); await this.client.elementClick(goButton); } // Clean up and close the browser. async kill() { await this.client.deleteSession(); } async clickContent() { let theWebView = await findElementWithClass(this.client, "XCUIElementTypeWebView"); await this.client.elementClick(theWebView); } } module.exports = { iOSBrowser }; async function main() { const browser = new iOSBrowser({browser:"safari"}); await browser.launch(); console.log(await browser.version()); // await browser.openUrl("https://youtube.com"); } if (require.main === module) { main(); }
function n(n){return null==n}function t(n){throw new Error("Argument "+n+" is empty.")}function r(n){return"function"==typeof n&&"getType"in n}function e(n){throw new Error("Argument "+n+' is invalid, it should be an action-creator instance from "typesafe-actions"')}function i(n,t){if(null==n)throw new Error("Argument contains array with empty element at index "+t);if(null==n.getType)throw new Error("Argument contains array with invalid element at index "+t+', it should be an action-creator instance from "typesafe-actions"')}function o(n){return"string"==typeof n||"symbol"==typeof n}function u(n){return!o(n)}function a(n){throw new Error("Argument "+n+" is invalid, it should be an action type of type: string | symbol")}function c(n,t){if(null==n)throw new Error("Argument contains array with empty element at index "+t);if("string"!=typeof n&&"symbol"!=typeof n)throw new Error("Argument contains array with invalid element at index "+t+", it should be of type: string | symbol")}function f(r,i,o,a){return n(r)&&t(1),u(r)&&e(1),{type:r,payload:i,meta:o,error:a}}function s(r,e){n(r)&&t(1),u(r)&&a(1);return Object.assign((function(){var n=null!=e?e.apply(void 0,arguments):void 0;return Object.assign({type:r},n)}),{getType:function(){return r},toString:function(){return r}})}function y(r,e,i){return n(r)&&t(1),u(r)&&a(1),function(){return s(r,(function(){var n=arguments.length<=0?void 0:arguments[0],t=arguments.length<=1?void 0:arguments[1];return null==e&&null==i||(n=null!=e?e.apply(void 0,arguments):void 0,t=null!=i?i.apply(void 0,arguments):void 0),Object.assign({},void 0!==n&&{payload:n},{},void 0!==t&&{meta:t})}))}}function l(n,t,r,e){return function(){var i=[n,t,r,e].map((function(n,t){return Array.isArray(n)?y(n[0],n[1],n[2])():"string"==typeof n||"symbol"==typeof n?y(n)():void(t<3&&function(n){throw new Error("Argument "+n+' is invalid, it should be an action type of "string | symbol" or a tuple of "[string | symbol, Function, Function?]"')}(t))}));return{request:i[0],success:i[1],failure:i[2],cancel:i[3]}}}function p(i){return n(i)&&t(1),r(i)||e(1),i.getType()}function d(n,t){void 0===t&&(t={});var e=Object.assign({},t),i=function(t,i){var u=Array.isArray(t)?t:[t],a={};return u.map((function(n,t){return r(n)?p(n):o(n)?n:function(n){throw new Error("Argument "+n+' is invalid, it should be an action-creator instance from "typesafe-actions" or action type of type: string | symbol')}(t+1)})).forEach((function(n){return a[n]=i})),d(n,Object.assign({},e,{},a))};return Object.assign((function(t,r){if(void 0===t&&(t=n),e.hasOwnProperty(r.type)){var i=e[r.type];if("function"!=typeof i)throw Error('Reducer under "'+r.type+'" key is not a valid reducer');return i(t,r)}return t}),{handlers:Object.assign({},e),handleAction:i,handleType:i})}function g(r,e){n(r)&&t(1);var i=Array.isArray(r)?r:[r];i.forEach(c);var o=function(n){return i.includes(n.type)};return void 0===e?o:o(e)}function m(r,e){n(r)&&t(1);var o=Array.isArray(r)?r:[r];o.forEach(i);var u=function(n){return o.some((function(t){return n.type===t.getType()}))};return void 0===e?u:u(e)}function v(r,e){n(r)&&t(1),u(r)&&a(1);var i=null!=e?e(r):function(){return{type:r}};return Object.assign(i,{getType:function(){return r},toString:function(){return r}})}var h={createAction:function(n,t){var r=null==t?function(){return f(n)}:t(f.bind(null,n));return Object.assign(r,{getType:function(){return n},toString:function(){return n}})},createCustomAction:v,createStandardAction:function(r){return n(r)&&t(1),u(r)&&a(1),Object.assign((function(){return v(r,(function(n){return function(t,r){return{type:n,payload:t,meta:r}}}))}),{map:function(n){return v(r,(function(t){return function(r,e){return Object.assign(n(r,e),{type:t})}}))}})}};export{f as action,y as createAction,l as createAsyncAction,s as createCustomAction,d as createReducer,h as deprecated,p as getType,m as isActionOf,g as isOfType}; //# sourceMappingURL=typesafe-actions.es.production.js.map
const path = require("path"); const HtmlWebPackPlugin = require("html-webpack-plugin"); const TsconfigPathsPlugin = require("tsconfig-paths-webpack-plugin"); module.exports = { entry: "./src/index.tsx", output: { path: path.resolve(__dirname, "build"), filename: "bundle.js" }, resolve: { extensions: [".tsx", ".ts", ".js"], modules: [path.join(__dirname, "src"), "node_modules"], plugins: [new TsconfigPathsPlugin()] }, module: { rules: [ { test: /\.tsx?$/, exclude: /node_modules/, loader: "ts-loader" } ] }, plugins: [ new HtmlWebPackPlugin({ template: "./public/index.html" }) ], devtool: "source-map" };
/** * GitHub v3 REST API * GitHub's v3 REST API. * * The version of the OpenAPI document: 0.0.5 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. * */ (function(root, factory) { if (typeof define === 'function' && define.amd) { // AMD. define(['expect.js', process.cwd()+'/src/index'], factory); } else if (typeof module === 'object' && module.exports) { // CommonJS-like environments that support module.exports, like Node. factory(require('expect.js'), require(process.cwd()+'/src/index')); } else { // Browser globals (root is window) factory(root.expect, root.GitHubV3RestApi); } }(this, function(expect, GitHubV3RestApi) { 'use strict'; var instance; beforeEach(function() { instance = new GitHubV3RestApi.GistCommit(); }); var getProperty = function(object, getter, property) { // Use getter method if present; otherwise, get the property directly. if (typeof object[getter] === 'function') return object[getter](); else return object[property]; } var setProperty = function(object, setter, property, value) { // Use setter method if present; otherwise, set the property directly. if (typeof object[setter] === 'function') object[setter](value); else object[property] = value; } describe('GistCommit', function() { it('should create an instance of GistCommit', function() { // uncomment below and update the code to test GistCommit //var instane = new GitHubV3RestApi.GistCommit(); //expect(instance).to.be.a(GitHubV3RestApi.GistCommit); }); it('should have the property changeStatus (base name: "change_status")', function() { // uncomment below and update the code to test the property changeStatus //var instane = new GitHubV3RestApi.GistCommit(); //expect(instance).to.be(); }); it('should have the property committedAt (base name: "committed_at")', function() { // uncomment below and update the code to test the property committedAt //var instane = new GitHubV3RestApi.GistCommit(); //expect(instance).to.be(); }); it('should have the property url (base name: "url")', function() { // uncomment below and update the code to test the property url //var instane = new GitHubV3RestApi.GistCommit(); //expect(instance).to.be(); }); it('should have the property user (base name: "user")', function() { // uncomment below and update the code to test the property user //var instane = new GitHubV3RestApi.GistCommit(); //expect(instance).to.be(); }); it('should have the property version (base name: "version")', function() { // uncomment below and update the code to test the property version //var instane = new GitHubV3RestApi.GistCommit(); //expect(instance).to.be(); }); }); }));
exports.argPrefix = '$arg:'; exports.getTypeInfo = (ctor, key) => { if (typeof(ctor) !== 'function') { const message = ctor && ctor.constructor ? 'instance of ' + ctor.constructor.name : (!ctor ? 'null' : typeof(ctor)); throw new Error('Constructor must be a function, got ' + message); } const docCommentRegex = [ //normal function /^function\s+(?:(\w+))?\s*\(([^)]*)\)\s*{/, //es6 class method /^(\w+)s*\(([^)]*)\)\s*{/, //class with constructor /^class(?:[\s+](\w+))?[\s\S]+?constructor\s*\(([^)]*)\)\s*{/, //class without constructor /^class(?:[\s+](\w+))?/, //fat arrow functions (always anonymous, so first group capture must be empty) /^()\(?([^)]*)\)?\s*=>\s*{/ ]; let data; for (let i = 0; i < docCommentRegex.length; i++) { data = docCommentRegex[i].exec(ctor.toString()); if (data) { break; } } if (!data) { throw new Error( `Unable to parse function definition: ${ctor.toString()}. If ` + 'this is a valid constructor, please open an issue with the developers.' ); } const typeName = key || data[1]; const signature = (data[2] || '').trim(); if (!typeName || typeName === 'function') { throw new Error('A resolution key must be given if a named function is not'); } const typeInfo = { args: [], ctor: ctor, name: typeName }; if (signature) { signature.split(',').forEach((param, i) => { const paramTrimmed = param.trim(); if (!paramTrimmed) { //dangling comma return; } //ferret out the type of each argument based on inline jsdoc: //https://code.google.com/p/jsdoc-toolkit/wiki/InlineDocs const data = /^\/\*\*\s*([^*\s]+?)\s*\*+\/\s*(\w+)\s*$/.exec(paramTrimmed); if (!data) { // assume it will be resolved via implicit arg:* syntax typeInfo.args.push({ position: i, type: `${exports.argPrefix}${paramTrimmed}`, name: paramTrimmed, parsedAs: 'arg' }); } else { typeInfo.args.push({ position: i, type: data[1], name: data[2], parsedAs: 'doc-comment' }); } }); } return typeInfo; };
var __awaiter=this&&this.__awaiter||function(t,e,n,i){function a(t){return t instanceof n?t:new n((function(e){e(t)}))}return new(n||(n=Promise))((function(n,r){function o(t){try{l(i.next(t))}catch(e){r(e)}}function s(t){try{l(i["throw"](t))}catch(e){r(e)}}function l(t){t.done?n(t.value):a(t.value).then(o,s)}l((i=i.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var n={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},i,a,r,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(t){return function(e){return l([t,e])}}function l(o){if(i)throw new TypeError("Generator is already executing.");while(n)try{if(i=1,a&&(r=o[0]&2?a["return"]:o[0]?a["throw"]||((r=a["return"])&&r.call(a),0):a.next)&&!(r=r.call(a,o[1])).done)return r;if(a=0,r)o=[o[0]&2,r.value];switch(o[0]){case 0:case 1:r=o;break;case 4:n.label++;return{value:o[1],done:false};case 5:n.label++;a=o[1];o=[0];continue;case 7:o=n.ops.pop();n.trys.pop();continue;default:if(!(r=n.trys,r=r.length>0&&r[r.length-1])&&(o[0]===6||o[0]===2)){n=0;continue}if(o[0]===3&&(!r||o[1]>r[0]&&o[1]<r[3])){n.label=o[1];break}if(o[0]===6&&n.label<r[1]){n.label=r[1];r=o;break}if(r&&n.label<r[2]){n.label=r[2];n.ops.push(o);break}if(r[2])n.ops.pop();n.trys.pop();continue}o=e.call(t,n)}catch(s){o=[6,s];a=0}finally{i=r=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:true}}};System.register(["./p-4a14b061.system.js","./p-43078e70.system.js","./p-ff3c9f7a.system.js","./p-5d689c29.system.js","./p-af7d7be2.system.js"],(function(t,e){"use strict";var n,i,a,r,o,s,l,d,c,g,h;return{setters:[function(t){n=t.r;i=t.e;a=t.h;r=t.H;o=t.i},function(t){s=t.b},function(t){l=t.d;d=t.e},function(t){c=t.c},function(t){g=t.c;h=t.h}],execute:function(){var p=":host{-webkit-box-sizing:content-box !important;box-sizing:content-box !important;display:inline-block;position:relative;outline:none;contain:content;cursor:pointer;-ms-touch-action:none;touch-action:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:2}:host(.ion-focused) input{border:2px solid #5e9ed6}:host(.toggle-disabled){pointer-events:none}label{left:0;top:0;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;position:absolute;width:100%;height:100%;border:0;background:transparent;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;outline:none;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;opacity:0;pointer-events:none}[dir=rtl] label,:host-context([dir=rtl]) label{left:unset;right:unset;right:0}label::-moz-focus-inner{border:0}input{position:absolute;top:0;left:0;right:0;bottom:0;width:100%;height:100%;margin:0;padding:0;border:0;outline:0;clip:rect(0 0 0 0);opacity:0;overflow:hidden;-webkit-appearance:none;-moz-appearance:none}.toggle-icon-wrapper{display:-ms-flexbox;display:flex;position:relative;-ms-flex-align:center;align-items:center;width:100%;height:100%;-webkit-transition:var(--handle-transition);transition:var(--handle-transition);will-change:transform}.toggle-icon{border-radius:var(--border-radius);display:block;position:relative;width:100%;height:100%;background:var(--background);pointer-events:none;overflow:inherit}:host(.toggle-checked) .toggle-icon{background:var(--background-checked)}.toggle-inner{left:var(--handle-spacing);border-radius:var(--handle-border-radius);position:absolute;width:var(--handle-width);height:var(--handle-height);max-height:var(--handle-max-height);-webkit-transition:var(--handle-transition);transition:var(--handle-transition);background:var(--handle-background);-webkit-box-shadow:var(--handle-box-shadow);box-shadow:var(--handle-box-shadow);contain:strict}[dir=rtl] .toggle-inner,:host-context([dir=rtl]) .toggle-inner{left:unset;right:unset;right:var(--handle-spacing)}:host(.toggle-checked) .toggle-icon-wrapper{-webkit-transform:translate3d(calc(100% - var(--handle-width)), 0, 0);transform:translate3d(calc(100% - var(--handle-width)), 0, 0)}:host-context([dir=rtl]):host(.toggle-checked) .toggle-icon-wrapper,:host-context([dir=rtl]).toggle-checked .toggle-icon-wrapper{-webkit-transform:translate3d(calc(-100% + var(--handle-width)), 0, 0);transform:translate3d(calc(-100% + var(--handle-width)), 0, 0)}:host(.toggle-checked) .toggle-inner{-webkit-transform:translate3d(calc(var(--handle-spacing) * -2), 0, 0);transform:translate3d(calc(var(--handle-spacing) * -2), 0, 0);background:var(--handle-background-checked)}:host-context([dir=rtl]):host(.toggle-checked) .toggle-inner,:host-context([dir=rtl]).toggle-checked .toggle-inner{-webkit-transform:translate3d(calc(var(--handle-spacing) * 2), 0, 0);transform:translate3d(calc(var(--handle-spacing) * 2), 0, 0)}:host{--background:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.088);--background-checked:var(--ion-color-primary, #3880ff);--border-radius:16px;--handle-background:#ffffff;--handle-background-checked:#ffffff;--handle-border-radius:25.5px;--handle-box-shadow:0 3px 12px rgba(0, 0, 0, 0.16), 0 3px 1px rgba(0, 0, 0, 0.1);--handle-height:calc(32px - (2px * 2));--handle-max-height:calc(100% - (var(--handle-spacing) * 2));--handle-width:calc(32px - (2px * 2));--handle-spacing:2px;--handle-transition:transform 300ms, width 120ms ease-in-out 80ms, left 110ms ease-in-out 80ms, right 110ms ease-in-out 80ms;width:51px;height:32px;contain:strict;overflow:hidden}:host(.ion-color.toggle-checked) .toggle-icon{background:var(--ion-color-base)}.toggle-icon{-webkit-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0);-webkit-transition:background-color 300ms;transition:background-color 300ms}.toggle-inner{will-change:transform}:host(.toggle-activated) .toggle-icon::before,:host(.toggle-checked) .toggle-icon::before{-webkit-transform:scale3d(0, 0, 0);transform:scale3d(0, 0, 0)}:host(.toggle-activated.toggle-checked) .toggle-inner::before{-webkit-transform:scale3d(0, 0, 0);transform:scale3d(0, 0, 0)}:host(.toggle-activated) .toggle-inner{width:calc(var(--handle-width) + 6px)}:host(.toggle-activated.toggle-checked) .toggle-icon-wrapper{-webkit-transform:translate3d(calc(100% - var(--handle-width) - 6px), 0, 0);transform:translate3d(calc(100% - var(--handle-width) - 6px), 0, 0)}:host-context([dir=rtl]):host(.toggle-activated.toggle-checked) .toggle-icon-wrapper,:host-context([dir=rtl]).toggle-activated.toggle-checked .toggle-icon-wrapper{-webkit-transform:translate3d(calc(-100% + var(--handle-width) + 6px), 0, 0);transform:translate3d(calc(-100% + var(--handle-width) + 6px), 0, 0)}:host(.toggle-disabled){opacity:0.3}:host(.in-item[slot]){margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:20px;padding-right:10px;padding-top:6px;padding-bottom:5px}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){:host(.in-item[slot]){padding-left:unset;padding-right:unset;-webkit-padding-start:20px;padding-inline-start:20px;-webkit-padding-end:10px;padding-inline-end:10px}}:host(.in-item[slot=start]){padding-left:0;padding-right:16px;padding-top:6px;padding-bottom:5px}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){:host(.in-item[slot=start]){padding-left:unset;padding-right:unset;-webkit-padding-start:0;padding-inline-start:0;-webkit-padding-end:16px;padding-inline-end:16px}}";var u=":host{-webkit-box-sizing:content-box !important;box-sizing:content-box !important;display:inline-block;position:relative;outline:none;contain:content;cursor:pointer;-ms-touch-action:none;touch-action:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:2}:host(.ion-focused) input{border:2px solid #5e9ed6}:host(.toggle-disabled){pointer-events:none}label{left:0;top:0;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;position:absolute;width:100%;height:100%;border:0;background:transparent;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;outline:none;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;opacity:0;pointer-events:none}[dir=rtl] label,:host-context([dir=rtl]) label{left:unset;right:unset;right:0}label::-moz-focus-inner{border:0}input{position:absolute;top:0;left:0;right:0;bottom:0;width:100%;height:100%;margin:0;padding:0;border:0;outline:0;clip:rect(0 0 0 0);opacity:0;overflow:hidden;-webkit-appearance:none;-moz-appearance:none}.toggle-icon-wrapper{display:-ms-flexbox;display:flex;position:relative;-ms-flex-align:center;align-items:center;width:100%;height:100%;-webkit-transition:var(--handle-transition);transition:var(--handle-transition);will-change:transform}.toggle-icon{border-radius:var(--border-radius);display:block;position:relative;width:100%;height:100%;background:var(--background);pointer-events:none;overflow:inherit}:host(.toggle-checked) .toggle-icon{background:var(--background-checked)}.toggle-inner{left:var(--handle-spacing);border-radius:var(--handle-border-radius);position:absolute;width:var(--handle-width);height:var(--handle-height);max-height:var(--handle-max-height);-webkit-transition:var(--handle-transition);transition:var(--handle-transition);background:var(--handle-background);-webkit-box-shadow:var(--handle-box-shadow);box-shadow:var(--handle-box-shadow);contain:strict}[dir=rtl] .toggle-inner,:host-context([dir=rtl]) .toggle-inner{left:unset;right:unset;right:var(--handle-spacing)}:host(.toggle-checked) .toggle-icon-wrapper{-webkit-transform:translate3d(calc(100% - var(--handle-width)), 0, 0);transform:translate3d(calc(100% - var(--handle-width)), 0, 0)}:host-context([dir=rtl]):host(.toggle-checked) .toggle-icon-wrapper,:host-context([dir=rtl]).toggle-checked .toggle-icon-wrapper{-webkit-transform:translate3d(calc(-100% + var(--handle-width)), 0, 0);transform:translate3d(calc(-100% + var(--handle-width)), 0, 0)}:host(.toggle-checked) .toggle-inner{-webkit-transform:translate3d(calc(var(--handle-spacing) * -2), 0, 0);transform:translate3d(calc(var(--handle-spacing) * -2), 0, 0);background:var(--handle-background-checked)}:host-context([dir=rtl]):host(.toggle-checked) .toggle-inner,:host-context([dir=rtl]).toggle-checked .toggle-inner{-webkit-transform:translate3d(calc(var(--handle-spacing) * 2), 0, 0);transform:translate3d(calc(var(--handle-spacing) * 2), 0, 0)}:host{--background:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.39);--background-checked:rgba(var(--ion-color-primary-rgb, 56, 128, 255), 0.5);--border-radius:14px;--handle-background:#ffffff;--handle-background-checked:var(--ion-color-primary, #3880ff);--handle-border-radius:50%;--handle-box-shadow:0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12);--handle-width:20px;--handle-height:20px;--handle-max-height:calc(100% + 6px);--handle-spacing:0;--handle-transition:transform 160ms cubic-bezier(0.4, 0, 0.2, 1), background-color 160ms cubic-bezier(0.4, 0, 0.2, 1);padding-left:12px;padding-right:12px;padding-top:12px;padding-bottom:12px;width:36px;height:14px;contain:strict}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){:host{padding-left:unset;padding-right:unset;-webkit-padding-start:12px;padding-inline-start:12px;-webkit-padding-end:12px;padding-inline-end:12px}}:host(.ion-color.toggle-checked) .toggle-icon{background:rgba(var(--ion-color-base-rgb), 0.5)}:host(.ion-color.toggle-checked) .toggle-inner{background:var(--ion-color-base)}.toggle-icon{-webkit-transition:background-color 160ms;transition:background-color 160ms}.toggle-inner{will-change:background-color, transform}:host(.toggle-disabled){opacity:0.3}:host(.in-item[slot]){margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:16px;padding-right:0;padding-top:12px;padding-bottom:12px;cursor:pointer}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){:host(.in-item[slot]){padding-left:unset;padding-right:unset;-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:0;padding-inline-end:0}}:host(.in-item[slot=start]){padding-left:2px;padding-right:18px;padding-top:12px;padding-bottom:12px}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){:host(.in-item[slot=start]){padding-left:unset;padding-right:unset;-webkit-padding-start:2px;padding-inline-start:2px;-webkit-padding-end:18px;padding-inline-end:18px}}";var b=t("ion_toggle",function(){function t(t){var e=this;n(this,t);this.ionChange=i(this,"ionChange",7);this.ionFocus=i(this,"ionFocus",7);this.ionBlur=i(this,"ionBlur",7);this.ionStyle=i(this,"ionStyle",7);this.inputId="ion-tg-"+m++;this.lastDrag=0;this.activated=false;this.name=this.inputId;this.checked=false;this.disabled=false;this.value="on";this.onClick=function(t){t.preventDefault();if(e.lastDrag+300<Date.now()){e.checked=!e.checked}};this.onFocus=function(){e.ionFocus.emit()};this.onBlur=function(){e.ionBlur.emit()}}t.prototype.checkedChanged=function(t){this.ionChange.emit({checked:t,value:this.value})};t.prototype.disabledChanged=function(){this.emitStyle();if(this.gesture){this.gesture.enable(!this.disabled)}};t.prototype.connectedCallback=function(){return __awaiter(this,void 0,void 0,(function(){var t;var n=this;return __generator(this,(function(i){switch(i.label){case 0:t=this;return[4,e.import("./p-403a82b9.system.js")];case 1:t.gesture=i.sent().createGesture({el:this.el,gestureName:"toggle",gesturePriority:100,threshold:5,passive:false,onStart:function(){return n.onStart()},onMove:function(t){return n.onMove(t)},onEnd:function(t){return n.onEnd(t)}});this.disabledChanged();return[2]}}))}))};t.prototype.disconnectedCallback=function(){if(this.gesture){this.gesture.destroy();this.gesture=undefined}};t.prototype.componentWillLoad=function(){this.emitStyle()};t.prototype.emitStyle=function(){this.ionStyle.emit({"interactive-disabled":this.disabled})};t.prototype.onStart=function(){this.activated=true;this.setFocus()};t.prototype.onMove=function(t){if(f(document,this.checked,t.deltaX,-10)){this.checked=!this.checked;c()}};t.prototype.onEnd=function(t){this.activated=false;this.lastDrag=Date.now();t.event.preventDefault();t.event.stopImmediatePropagation()};t.prototype.getValue=function(){return this.value||""};t.prototype.setFocus=function(){if(this.focusEl){this.focusEl.focus()}};t.prototype.render=function(){var t;var e=this;var n=this,i=n.activated,o=n.color,c=n.checked,p=n.disabled,u=n.el,b=n.inputId,f=n.name;var m=s(this);var k=l(u,b),v=k.label,x=k.labelId,w=k.labelText;var y=this.getValue();d(true,u,f,c?y:"",p);return a(r,{onClick:this.onClick,"aria-labelledby":v?x:null,"aria-checked":""+c,"aria-hidden":p?"true":null,role:"switch",class:g(o,(t={},t[m]=true,t["in-item"]=h("ion-item",u),t["toggle-activated"]=i,t["toggle-checked"]=c,t["toggle-disabled"]=p,t["interactive"]=true,t))},a("div",{class:"toggle-icon",part:"track"},a("div",{class:"toggle-icon-wrapper"},a("div",{class:"toggle-inner",part:"handle"}))),a("label",{htmlFor:b},w),a("input",{type:"checkbox",role:"switch","aria-checked":""+c,disabled:p,id:b,onFocus:function(){return e.onFocus()},onBlur:function(){return e.onBlur()},ref:function(t){return e.focusEl=t}}))};Object.defineProperty(t.prototype,"el",{get:function(){return o(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{checked:["checkedChanged"],disabled:["disabledChanged"]}},enumerable:false,configurable:true});return t}());var f=function(t,e,n,i){var a=t.dir==="rtl";if(e){return!a&&i>n||a&&-i<n}else{return!a&&-i<n||a&&i>n}};var m=0;b.style={ios:p,md:u}}}}));
/** * Test dependencies. */ var start = require('./common'), mongoose = start.mongoose, Schema = mongoose.Schema, assert = require('power-assert'), random = require('../lib/utils').random, util = require('util'), async = require('async'); /** * Setup */ function BaseSchema() { Schema.apply(this, arguments); this.add({ name: String, createdAt: {type: Date, default: Date.now} }); } util.inherits(BaseSchema, Schema); var EventSchema = new BaseSchema(); var ImpressionEventSchema = new BaseSchema(); var ConversionEventSchema = new BaseSchema({revenue: Number}); var SecretEventSchema = new BaseSchema({ secret: { type: String, select: false } }); describe('model', function() { describe('discriminator()', function() { var db; var BaseEvent; var ImpressionEvent; var ConversionEvent; var SecretEvent; before(function() { db = start(); BaseEvent = db.model('model-discriminator-querying-event', EventSchema, 'model-discriminator-querying-' + random()); ImpressionEvent = BaseEvent.discriminator('model-discriminator-querying-impression', ImpressionEventSchema); ConversionEvent = BaseEvent.discriminator('model-discriminator-querying-conversion', ConversionEventSchema); SecretEvent = BaseEvent.discriminator('model-discriminator-querying-secret', SecretEventSchema); }); afterEach(function(done) { async.series( [ function removeBaseEvent(next) { BaseEvent.remove(next); }, function removeImpressionEvent(next) { ImpressionEvent.remove(next); }, function removeConversionEvent(next) { ConversionEvent.remove(next); } ], done ); }); after(function(done) { db.close(done); }); describe('pushing discriminated objects', function() { var ContainerModel, BaseCustomEvent, DiscCustomEvent; before(function() { var BaseCustomEventSchema = new BaseSchema(); var DiscCustomEventSchema = new BaseSchema({ personName: Number }); BaseCustomEvent = db.model('base-custom-event', BaseCustomEventSchema); DiscCustomEvent = BaseCustomEvent.discriminator('disc-custom-event', DiscCustomEventSchema); var ContainerSchema = new Schema({ title: String, events: [{type: Schema.Types.ObjectId, ref: 'base-custom-event'}] }); ContainerModel = db.model('container-event-model', ContainerSchema); }); it('into non-discriminated arrays works', function(done) { var c = new ContainerModel({ title: 'events-group-1' }); var d1 = new BaseCustomEvent(); var d2 = new BaseCustomEvent(); var d3 = new DiscCustomEvent(); c.events.push(d1); c.events.push(d2); async.series( [ function(next) { d1.save(next); }, function(next) { d2.save(next); }, function(next) { d3.save(next); }, function(next) { c.save(next); }, function(next) { ContainerModel.findOne({}).populate('events').exec(function(err, doc) { assert.ifError(err); assert.ok(doc.events && doc.events.length); assert.equal(doc.events.length, 2); doc.events.push(d3); var hasDisc = false; var discKey = DiscCustomEvent.schema.discriminatorMapping.key; doc.events.forEach(function(subDoc) { if (discKey in subDoc) { hasDisc = true; } }); assert.ok(hasDisc); next(); }); } ], done ); }); }); describe('find', function() { it('hydrates correct models', function(done) { var baseEvent = new BaseEvent({name: 'Base event'}); var impressionEvent = new ImpressionEvent({name: 'Impression event'}); var conversionEvent = new ConversionEvent({name: 'Conversion event', revenue: 1.337}); baseEvent.save(function(err) { assert.ifError(err); impressionEvent.save(function(err) { assert.ifError(err); conversionEvent.save(function(err) { assert.ifError(err); BaseEvent.find({}).sort('name').exec(function(err, docs) { assert.ifError(err); assert.ok(docs[0] instanceof BaseEvent); assert.equal(docs[0].name, 'Base event'); assert.ok(docs[1] instanceof ConversionEvent); assert.equal(docs[1].schema, ConversionEventSchema); assert.equal(docs[1].name, 'Conversion event'); assert.equal(docs[1].revenue, 1.337); assert.ok(docs[2] instanceof ImpressionEvent); assert.equal(docs[2].schema, ImpressionEventSchema); assert.equal(docs[2].name, 'Impression event'); done(); }); }); }); }); }); var checkHydratesCorrectModels = function(fields, done) { var baseEvent = new BaseEvent({name: 'Base event'}); var impressionEvent = new ImpressionEvent({name: 'Impression event'}); var conversionEvent = new ConversionEvent({name: 'Conversion event', revenue: 1.337}); baseEvent.save(function(err) { assert.ifError(err); impressionEvent.save(function(err) { assert.ifError(err); conversionEvent.save(function(err) { assert.ifError(err); BaseEvent.find({}, fields).sort('name').exec(function(err, docs) { assert.ifError(err); assert.ok(docs[0] instanceof BaseEvent); assert.equal(docs[0].name, 'Base event'); assert.ok(docs[1] instanceof ConversionEvent); assert.equal(docs[1].schema, ConversionEventSchema); assert.equal(docs[1].name, 'Conversion event'); assert.equal(docs[1].revenue, undefined); assert.ok(docs[2] instanceof ImpressionEvent); assert.equal(docs[2].schema, ImpressionEventSchema); assert.equal(docs[2].name, 'Impression event'); done(); }); }); }); }); }; it('hydrates correct models when fields selection set as string', function(done) { checkHydratesCorrectModels('name', done); }); it('hydrates correct models when fields selection set as object', function(done) { checkHydratesCorrectModels({name: 1}, done); }); describe('discriminator model only finds documents of its type', function() { var impressionEvent, conversionEvent1, conversionEvent2; before(function() { impressionEvent = new ImpressionEvent({name: 'Impression event'}); conversionEvent1 = new ConversionEvent({name: 'Conversion event 1', revenue: 1}); conversionEvent2 = new ConversionEvent({name: 'Conversion event 2', revenue: 2}); }); describe('using "ModelDiscriminator#findById"', function() { it('to find a document of the appropriate discriminator', function(done) { impressionEvent.save(function(err) { assert.ifError(err); // via BaseEvent model BaseEvent.findById(impressionEvent._id, function(err, doc) { assert.ifError(err); assert.ok(doc); assert.equal(impressionEvent.__t, doc.__t); // via ImpressionEvent model discriminator -- should be present ImpressionEvent.findById(impressionEvent._id, function(err, doc) { assert.ifError(err); assert.ok(doc); assert.equal(impressionEvent.__t, doc.__t); // via ConversionEvent model discriminator -- should not be present ConversionEvent.findById(impressionEvent._id, function(err, doc) { assert.ifError(err); assert.ok(!doc); done(); }); }); }); }); }); }); describe('using "ModelDiscriminator#find"', function() { it('to find documents of the appropriate discriminator', function(done) { impressionEvent.save(function(err) { assert.ifError(err); conversionEvent1.save(function(err) { assert.ifError(err); conversionEvent2.save(function(err) { assert.ifError(err); // doesn't find anything since we're querying for an impression id var query = ConversionEvent.find({_id: impressionEvent._id}); assert.equal(query.op, 'find'); assert.deepEqual(query._conditions, {_id: impressionEvent._id, __t: 'model-discriminator-querying-conversion'}); query.exec(function(err, documents) { assert.ifError(err); assert.equal(documents.length, 0); // now find one with no criteria given and ensure it gets added to _conditions var query = ConversionEvent.find(); assert.deepEqual(query._conditions, {__t: 'model-discriminator-querying-conversion'}); assert.equal(query.op, 'find'); query.exec(function(err, documents) { assert.ifError(err); assert.equal(documents.length, 2); assert.ok(documents[0] instanceof ConversionEvent); assert.equal(documents[0].__t, 'model-discriminator-querying-conversion'); assert.ok(documents[1] instanceof ConversionEvent); assert.equal(documents[1].__t, 'model-discriminator-querying-conversion'); done(); }); }); }); }); }); }); }); }); var checkDiscriminatorModelsFindDocumentsOfItsType = function(fields, done) { var impressionEvent = new ImpressionEvent({name: 'Impression event'}); var conversionEvent1 = new ConversionEvent({name: 'Conversion event 1', revenue: 1}); var conversionEvent2 = new ConversionEvent({name: 'Conversion event 2', revenue: 2}); impressionEvent.save(function(err) { assert.ifError(err); conversionEvent1.save(function(err) { assert.ifError(err); conversionEvent2.save(function(err) { assert.ifError(err); // doesn't find anything since we're querying for an impression id var query = ConversionEvent.find({_id: impressionEvent._id}, fields); assert.equal(query.op, 'find'); assert.deepEqual(query._conditions, {_id: impressionEvent._id, __t: 'model-discriminator-querying-conversion'}); query.exec(function(err, documents) { assert.ifError(err); assert.equal(documents.length, 0); // now find one with no criteria given and ensure it gets added to _conditions var query = ConversionEvent.find({}, fields); assert.deepEqual(query._conditions, {__t: 'model-discriminator-querying-conversion'}); assert.equal(query.op, 'find'); query.exec(function(err, documents) { assert.ifError(err); assert.equal(documents.length, 2); assert.ok(documents[0] instanceof ConversionEvent); assert.equal(documents[0].__t, 'model-discriminator-querying-conversion'); assert.ok(documents[1] instanceof ConversionEvent); assert.equal(documents[1].__t, 'model-discriminator-querying-conversion'); done(); }); }); }); }); }); }; it('discriminator model only finds documents of its type when fields selection set as string inclusive', function(done) { checkDiscriminatorModelsFindDocumentsOfItsType('name', done); }); it('discriminator model only finds documents of its type when fields selection set as string exclusive', function(done) { checkDiscriminatorModelsFindDocumentsOfItsType('-revenue', done); }); it('discriminator model only finds documents of its type when fields selection set as empty string', function(done) { checkDiscriminatorModelsFindDocumentsOfItsType('', done); }); it('discriminator model only finds documents of its type when fields selection set as object inclusive', function(done) { checkDiscriminatorModelsFindDocumentsOfItsType({name: 1}, done); }); it('discriminator model only finds documents of its type when fields selection set as object exclusive', function(done) { checkDiscriminatorModelsFindDocumentsOfItsType({revenue: 0}, done); }); it('discriminator model only finds documents of its type when fields selection set as empty object', function(done) { checkDiscriminatorModelsFindDocumentsOfItsType({}, done); }); it('hydrates streams', function(done) { var baseEvent = new BaseEvent({name: 'Base event'}); var impressionEvent = new ImpressionEvent({name: 'Impression event'}); var conversionEvent = new ConversionEvent({name: 'Conversion event', revenue: 1.337}); baseEvent.save(function(err) { assert.ifError(err); impressionEvent.save(function(err) { assert.ifError(err); conversionEvent.save(function(err) { assert.ifError(err); var stream = BaseEvent.find({}).sort('name').stream(); stream.on('data', function(doc) { switch (doc.name) { case 'Base event': assert.ok(doc instanceof BaseEvent); break; case 'Impression event': assert.ok(doc instanceof BaseEvent); assert.ok(doc instanceof ImpressionEvent); break; case 'Conversion event': assert.ok(doc instanceof BaseEvent); assert.ok(doc instanceof ConversionEvent); break; default: } }); stream.on('error', function(err) { assert.ifError(err); }); stream.on('close', function() { done(); }); }); }); }); }); }); describe('findOne', function() { it('when selecting `select: false` field (gh-4629)', function(done) { var s = new SecretEvent({ name: 'test', secret: 'test2' }); s.save(function(error) { assert.ifError(error); SecretEvent.findById(s._id, '+secret', function(error, doc) { assert.ifError(error); assert.equal(doc.name, 'test'); assert.equal(doc.secret, 'test2'); done(); }); }); }); it('hydrates correct model', function(done) { var baseEvent = new BaseEvent({name: 'Base event'}); var impressionEvent = new ImpressionEvent({name: 'Impression event'}); var conversionEvent = new ConversionEvent({name: 'Conversion event', revenue: 1.337}); baseEvent.save(function(err) { assert.ifError(err); impressionEvent.save(function(err) { assert.ifError(err); conversionEvent.save(function(err) { assert.ifError(err); // finds & hydrates BaseEvent BaseEvent.findOne({_id: baseEvent._id}, function(err, event) { assert.ifError(err); assert.ok(event instanceof BaseEvent); assert.equal(event.name, 'Base event'); // finds & hydrates ImpressionEvent BaseEvent.findOne({_id: impressionEvent._id}, function(err, event) { assert.ifError(err); assert.ok(event instanceof ImpressionEvent); assert.equal(event.schema, ImpressionEventSchema); assert.equal(event.name, 'Impression event'); // finds & hydrates ConversionEvent BaseEvent.findOne({_id: conversionEvent._id}, function(err, event) { assert.ifError(err); assert.ok(event instanceof ConversionEvent); assert.equal(event.schema, ConversionEventSchema); assert.equal(event.name, 'Conversion event'); done(); }); }); }); }); }); }); }); var checkHydratesCorrectModels = function(fields, done, checkUndefinedRevenue) { var baseEvent = new BaseEvent({name: 'Base event'}); var impressionEvent = new ImpressionEvent({name: 'Impression event'}); var conversionEvent = new ConversionEvent({name: 'Conversion event', revenue: 1.337}); baseEvent.save(function(err) { assert.ifError(err); impressionEvent.save(function(err) { assert.ifError(err); conversionEvent.save(function(err) { assert.ifError(err); // finds & hydrates BaseEvent BaseEvent.findOne({_id: baseEvent._id}, fields, function(err, event) { assert.ifError(err); assert.ok(event instanceof BaseEvent); assert.equal(event.name, 'Base event'); // finds & hydrates ImpressionEvent BaseEvent.findOne({_id: impressionEvent._id}, fields, function(err, event) { assert.ifError(err); assert.ok(event instanceof ImpressionEvent); assert.equal(event.schema, ImpressionEventSchema); assert.equal(event.name, 'Impression event'); // finds & hydrates ConversionEvent BaseEvent.findOne({_id: conversionEvent._id}, fields, function(err, event) { assert.ifError(err); assert.ok(event instanceof ConversionEvent); assert.equal(event.schema, ConversionEventSchema); assert.equal(event.name, 'Conversion event'); if (checkUndefinedRevenue === true) { assert.equal(event.revenue, undefined); } done(); }); }); }); }); }); }); }; it('hydrates correct model when fields selection set as string inclusive', function(done) { checkHydratesCorrectModels('name', done, true); }); it('hydrates correct model when fields selection set as string exclusive', function(done) { checkHydratesCorrectModels('-revenue', done, true); }); it('hydrates correct model when fields selection set as empty string', function(done) { checkHydratesCorrectModels('', done); }); it('hydrates correct model when fields selection set as object inclusive', function(done) { checkHydratesCorrectModels({name: 1}, done, true); }); it('hydrates correct model when fields selection set as object exclusive', function(done) { checkHydratesCorrectModels({revenue: 0}, done, true); }); it('hydrates correct model when fields selection set as empty object', function(done) { checkHydratesCorrectModels({}, done); }); it('discriminator model only finds a document of its type', function(done) { var impressionEvent = new ImpressionEvent({name: 'Impression event'}); var conversionEvent = new ConversionEvent({name: 'Conversion event', revenue: 2}); impressionEvent.save(function(err) { assert.ifError(err); conversionEvent.save(function(err) { assert.ifError(err); // doesn't find anything since we're querying for an impression id var query = ConversionEvent.findOne({_id: impressionEvent._id}); assert.equal(query.op, 'findOne'); assert.deepEqual(query._conditions, {_id: impressionEvent._id, __t: 'model-discriminator-querying-conversion'}); query.exec(function(err, document) { assert.ifError(err); assert.equal(document, null); // now find one with no criteria given and ensure it gets added to _conditions var query = ConversionEvent.findOne(); assert.equal(query.op, 'findOne'); assert.deepEqual(query._conditions, {__t: 'model-discriminator-querying-conversion'}); query.exec(function(err, document) { assert.ifError(err); assert.ok(document instanceof ConversionEvent); assert.equal(document.__t, 'model-discriminator-querying-conversion'); done(); }); }); }); }); }); var checkDiscriminatorModelsFindOneDocumentOfItsType = function(fields, done) { var impressionEvent = new ImpressionEvent({name: 'Impression event'}); var conversionEvent = new ConversionEvent({name: 'Conversion event', revenue: 2}); impressionEvent.save(function(err) { assert.ifError(err); conversionEvent.save(function(err) { assert.ifError(err); // doesn't find anything since we're querying for an impression id var query = ConversionEvent.findOne({_id: impressionEvent._id}, fields); assert.equal(query.op, 'findOne'); assert.deepEqual(query._conditions, {_id: impressionEvent._id, __t: 'model-discriminator-querying-conversion'}); query.exec(function(err, document) { assert.ifError(err); assert.equal(document, null); // now find one with no criteria given and ensure it gets added to _conditions var query = ConversionEvent.findOne({}, fields); assert.equal(query.op, 'findOne'); assert.deepEqual(query._conditions, {__t: 'model-discriminator-querying-conversion'}); query.exec(function(err, document) { assert.ifError(err); assert.ok(document instanceof ConversionEvent); assert.equal(document.__t, 'model-discriminator-querying-conversion'); done(); }); }); }); }); }; it('discriminator model only finds a document of its type when fields selection set as string inclusive', function(done) { checkDiscriminatorModelsFindOneDocumentOfItsType('name', done); }); it('discriminator model only finds a document of its type when fields selection set as string exclusive', function(done) { checkDiscriminatorModelsFindOneDocumentOfItsType('-revenue', done); }); it('discriminator model only finds a document of its type when fields selection set as empty string', function(done) { checkDiscriminatorModelsFindOneDocumentOfItsType('', done); }); it('discriminator model only finds a document of its type when fields selection set as object inclusive', function(done) { checkDiscriminatorModelsFindOneDocumentOfItsType({name: 1}, done); }); it('discriminator model only finds a document of its type when fields selection set as object exclusive', function(done) { checkDiscriminatorModelsFindOneDocumentOfItsType({revenue: 0}, done); }); it('discriminator model only finds a document of its type when fields selection set as empty object', function(done) { checkDiscriminatorModelsFindOneDocumentOfItsType({}, done); }); }); describe('findOneAndUpdate', function() { it('does not update models of other types', function(done) { var baseEvent = new BaseEvent({name: 'Base event'}); var impressionEvent = new ImpressionEvent({name: 'Impression event'}); var conversionEvent = new ConversionEvent({name: 'Conversion event', revenue: 1.337}); baseEvent.save(function(err) { assert.ifError(err); impressionEvent.save(function(err) { assert.ifError(err); conversionEvent.save(function(err) { assert.ifError(err); var query = ConversionEvent.findOneAndUpdate({name: 'Impression event'}, {$set: {name: 'Impression event - updated'}}); assert.deepEqual(query._conditions, {name: 'Impression event', __t: 'model-discriminator-querying-conversion'}); query.exec(function(err, document) { assert.ifError(err); assert.equal(document, null); done(); }); }); }); }); }); it('updates models of its own type', function(done) { var baseEvent = new BaseEvent({name: 'Base event'}); var impressionEvent = new ImpressionEvent({name: 'Impression event'}); var conversionEvent = new ConversionEvent({name: 'Conversion event', revenue: 1.337}); baseEvent.save(function(err) { assert.ifError(err); impressionEvent.save(function(err) { assert.ifError(err); conversionEvent.save(function(err) { assert.ifError(err); var query = ConversionEvent.findOneAndUpdate({name: 'Conversion event'}, {$set: {name: 'Conversion event - updated'}}, {new: true}); assert.deepEqual(query._conditions, {name: 'Conversion event', __t: 'model-discriminator-querying-conversion'}); query.exec(function(err, document) { assert.ifError(err); var expected = conversionEvent.toJSON(); expected.name = 'Conversion event - updated'; assert.deepEqual(document.toJSON(), expected); done(); }); }); }); }); }); it('base model modifies any event type', function(done) { var baseEvent = new BaseEvent({name: 'Base event'}); var impressionEvent = new ImpressionEvent({name: 'Impression event'}); var conversionEvent = new ConversionEvent({name: 'Conversion event', revenue: 1.337}); baseEvent.save(function(err) { assert.ifError(err); impressionEvent.save(function(err) { assert.ifError(err); conversionEvent.save(function(err) { assert.ifError(err); var query = BaseEvent.findOneAndUpdate({name: 'Conversion event'}, {$set: {name: 'Conversion event - updated'}}, {new: true}); assert.deepEqual(query._conditions, {name: 'Conversion event'}); query.exec(function(err, document) { assert.ifError(err); var expected = conversionEvent.toJSON(); expected.name = 'Conversion event - updated'; assert.deepEqual(document.toJSON(), expected); done(); }); }); }); }); }); }); describe('population/reference mapping', function() { it('populates and hydrates correct models', function(done) { var vehicleSchema = new Schema(); var carSchema = new Schema({speed: Number}); var busSchema = new Schema({speed: Number}); var userSchema = new Schema({ vehicles: [{type: Schema.Types.ObjectId, ref: 'ModelDiscriminatorPopulationVehicle'}], favoriteVehicle: {type: Schema.Types.ObjectId, ref: 'ModelDiscriminatorPopulationVehicle'}, favoriteBus: {type: Schema.Types.ObjectId, ref: 'ModelDiscriminatorPopulationBus'} }); var Vehicle = db.model('ModelDiscriminatorPopulationVehicle', vehicleSchema), Car = Vehicle.discriminator('ModelDiscriminatorPopulationCar', carSchema), Bus = Vehicle.discriminator('ModelDiscriminatorPopulationBus', busSchema), User = db.model('ModelDiscriminatorPopulationUser', userSchema); Vehicle.create({}, function(err, vehicle) { assert.ifError(err); Car.create({speed: 160}, function(err, car) { Bus.create({speed: 80}, function(err, bus) { assert.ifError(err); User.create({vehicles: [vehicle._id, car._id, bus._id], favoriteVehicle: car._id, favoriteBus: bus._id}, function(err) { assert.ifError(err); User.findOne({}).populate('vehicles favoriteVehicle favoriteBus').exec(function(err, user) { assert.ifError(err); var expected = { __v: 0, _id: user._id, vehicles: [ {_id: vehicle._id, __v: 0}, {_id: car._id, speed: 160, __v: 0, __t: 'ModelDiscriminatorPopulationCar'}, {_id: bus._id, speed: 80, __v: 0, __t: 'ModelDiscriminatorPopulationBus'} ], favoriteVehicle: {_id: car._id, speed: 160, __v: 0, __t: 'ModelDiscriminatorPopulationCar'}, favoriteBus: {_id: bus._id, speed: 80, __v: 0, __t: 'ModelDiscriminatorPopulationBus'} }; assert.deepEqual(user.toJSON(), expected); assert.ok(user.vehicles[0] instanceof Vehicle); assert.ok(!(user.vehicles[0] instanceof Car)); assert.ok(!(user.vehicles[0] instanceof Bus)); assert.ok(user.vehicles[1] instanceof Car); assert.ok(!(user.vehicles[1] instanceof Bus)); assert.ok(user.vehicles[2] instanceof Bus); assert.ok(!(user.vehicles[2] instanceof Car)); assert.ok(user.favoriteVehicle instanceof Car); assert.ok(user.favoriteBus instanceof Bus); done(); }); }); }); }); }); }); it('reference in child schemas (gh-2719)', function(done) { var vehicleSchema = new Schema({}); var carSchema = new Schema({ speed: Number, garage: {type: Schema.Types.ObjectId, ref: 'gh2719PopulationGarage'} }); var busSchema = new Schema({ speed: Number, garage: {type: Schema.Types.ObjectId, ref: 'gh2719PopulationGarage'} }); var garageSchema = new Schema({ name: String, num_of_places: Number }); var Vehicle = db.model('gh2719PopulationVehicle', vehicleSchema), Car = Vehicle.discriminator('gh2719PopulationCar', carSchema), Bus = Vehicle.discriminator('gh2719PopulationBus', busSchema), Garage = db.model('gh2719PopulationGarage', garageSchema); Garage.create({name: 'My', num_of_places: 3}, function(err, garage) { assert.ifError(err); Car.create({speed: 160, garage: garage}, function(err) { assert.ifError(err); Bus.create({speed: 80, garage: garage}, function(err) { assert.ifError(err); Vehicle.find({}).populate('garage').exec(function(err, vehicles) { assert.ifError(err); vehicles.forEach(function(v) { assert.ok(v.garage instanceof Garage); }); done(); }); }); }); }); }); it('populates parent array reference (gh-4643)', function(done) { var vehicleSchema = new Schema({ wheels: [{ type: Schema.Types.ObjectId, ref: 'gh4643' }] }); var wheelSchema = new Schema({ brand: String }); var busSchema = new Schema({ speed: Number }); var Vehicle = db.model('gh4643_0', vehicleSchema); var Bus = Vehicle.discriminator('gh4643_00', busSchema); var Wheel = db.model('gh4643', wheelSchema); Wheel.create({ brand: 'Rotiform' }, function(err, wheel) { assert.ifError(err); Bus.create({ speed: 80, wheels: [wheel] }, function(err) { assert.ifError(err); Bus.findOne({}).populate('wheels').exec(function(err, bus) { assert.ifError(err); assert.ok(bus instanceof Vehicle); assert.ok(bus instanceof Bus); assert.equal(bus.wheels.length, 1); assert.ok(bus.wheels[0] instanceof Wheel); assert.equal(bus.wheels[0].brand, 'Rotiform'); done(); }); }); }); }); it('reference in child schemas (gh-2719-2)', function(done) { var EventSchema, Event, TalkSchema, Talk, Survey; function BaseSchema() { Schema.apply(this, arguments); this.add({ name: {type: String, required: true}, date: {type: Date, required: true}, period: {start: {type: String, required: true}, end: {type: String, required: true} } }); } util.inherits(BaseSchema, Schema); EventSchema = new BaseSchema({}); Event = db.model('Event', EventSchema); TalkSchema = new BaseSchema({ pin: {type: String, required: true, index: {unique: true}}, totalAttendees: {type: Number}, speakers: [{type: Schema.Types.ObjectId, ref: 'Speaker'}], surveys: [{type: Schema.Types.ObjectId, ref: 'Survey'}], questions: [{type: Schema.Types.ObjectId, ref: 'Question'}] }); Talk = Event.discriminator('Talk', TalkSchema); Survey = db.model('Survey', Schema({ name: String, date: Date })); Survey.create({ name: 'That you see?', date: Date.now() }, function(err, survey) { assert.ifError(err); Talk.create({ name: 'Meetup rails', date: new Date('2015-04-01T00:00:00Z'), pin: '0004', period: {start: '11:00', end: '12:00'}, surveys: [survey] }, function(err) { assert.ifError(err); Event.find({}).populate('surveys').exec(function(err, events) { assert.ifError(err); assert.ok(events[0].surveys[0] instanceof Survey); done(); }); }); }); }); }); describe('aggregate', function() { var impressionEvent, conversionEvent, ignoredImpressionEvent; beforeEach(function(done) { impressionEvent = new ImpressionEvent({name: 'Test Event'}); conversionEvent = new ConversionEvent({name: 'Test Event', revenue: 10}); ignoredImpressionEvent = new ImpressionEvent({name: 'Ignored Event'}); async.forEach( [impressionEvent, conversionEvent, ignoredImpressionEvent], function(doc, cb) { doc.save(cb); }, done ); }); describe('using "RootModel#aggregate"', function() { it('to aggregate documents of all discriminators', function(done) { var aggregate = BaseEvent.aggregate([ {$match: {name: 'Test Event'}} ]); aggregate.exec(function(err, docs) { assert.ifError(err); assert.deepEqual(aggregate._pipeline, [ {$match: {name: 'Test Event'}} ]); assert.equal(docs.length, 2); done(); }); }); }); describe('using "ModelDiscriminator#aggregate"', function() { it('only aggregates documents of the appropriate discriminator', function(done) { var aggregate = ImpressionEvent.aggregate([ {$group: {_id: '$__t', count: {$sum: 1}}} ]); aggregate.exec(function(err, result) { assert.ifError(err); // Discriminator `$match` pipeline step was added on the // `exec` step. The reasoning for this is to not let // aggregations with empty pipelines, but that are over // discriminators be executed assert.deepEqual(aggregate._pipeline, [ {$match: {__t: 'model-discriminator-querying-impression'}}, {$group: {_id: '$__t', count: {$sum: 1}}} ]); assert.equal(result.length, 1); assert.deepEqual(result, [ {_id: 'model-discriminator-querying-impression', count: 2} ]); done(); }); }); it('hides fields when discriminated model has select (gh-4991)', function(done) { var baseSchema = new mongoose.Schema({ internal: { test: [{ type: String }] } }); var Base = db.model('gh4991', baseSchema); var discriminatorSchema = new mongoose.Schema({ internal: { password: { type: String, select: false } } }); var Discriminator = Base.discriminator('gh4991_0', discriminatorSchema); var obj = { internal: { test: ['abc'], password: 'password' } }; Discriminator.create(obj). then(function(doc) { return Base.findById(doc._id); }). then(function(doc) { assert.ok(!doc.internal.password); done(); }). catch(done); }); it('merges the first pipeline stages if applicable', function(done) { var aggregate = ImpressionEvent.aggregate([ {$match: {name: 'Test Event'}} ]); aggregate.exec(function(err, result) { assert.ifError(err); // Discriminator `$match` pipeline step was added on the // `exec` step. The reasoning for this is to not let // aggregations with empty pipelines, but that are over // discriminators be executed assert.deepEqual(aggregate._pipeline, [ {$match: {__t: 'model-discriminator-querying-impression', name: 'Test Event'}} ]); assert.equal(result.length, 1); assert.equal(result[0]._id, impressionEvent.id); done(); }); }); }); }); }); });
//! moment.js locale configuration //! locale : Tamil [ta] //! author : Arjunkumar Krishnamoorthy : https://github.com/tk120404 import moment from '../moment'; var symbolMap = { '1': '௧', '2': '௨', '3': '௩', '4': '௪', '5': '௫', '6': '௬', '7': '௭', '8': '௮', '9': '௯', '0': '௦' }, numberMap = { '௧': '1', '௨': '2', '௩': '3', '௪': '4', '௫': '5', '௬': '6', '௭': '7', '௮': '8', '௯': '9', '௦': '0' }; export default moment.defineLocale('ta', { months : 'ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்'.split('_'), monthsShort : 'ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்'.split('_'), weekdays : 'ஞாயிற்றுக்கிழமை_திங்கட்கிழமை_செவ்வாய்கிழமை_புதன்கிழமை_வியாழக்கிழமை_வெள்ளிக்கிழமை_சனிக்கிழமை'.split('_'), weekdaysShort : 'ஞாயிறு_திங்கள்_செவ்வாய்_புதன்_வியாழன்_வெள்ளி_சனி'.split('_'), weekdaysMin : 'ஞா_தி_செ_பு_வி_வெ_ச'.split('_'), longDateFormat : { LT : 'HH:mm', LTS : 'HH:mm:ss', L : 'DD/MM/YYYY', LL : 'D MMMM YYYY', LLL : 'D MMMM YYYY, HH:mm', LLLL : 'dddd, D MMMM YYYY, HH:mm' }, calendar : { sameDay : '[இன்று] LT', nextDay : '[நாளை] LT', nextWeek : 'dddd, LT', lastDay : '[நேற்று] LT', lastWeek : '[கடந்த வாரம்] dddd, LT', sameElse : 'L' }, relativeTime : { future : '%s இல்', past : '%s முன்', s : 'ஒரு சில விநாடிகள்', ss : '%d விநாடிகள்', m : 'ஒரு நிமிடம்', mm : '%d நிமிடங்கள்', h : 'ஒரு மணி நேரம்', hh : '%d மணி நேரம்', d : 'ஒரு நாள்', dd : '%d நாட்கள்', M : 'ஒரு மாதம்', MM : '%d மாதங்கள்', y : 'ஒரு வருடம்', yy : '%d ஆண்டுகள்' }, dayOfMonthOrdinalParse: /\d{1,2}வது/, ordinal : function (number) { return number + 'வது'; }, preparse: function (string) { return string.replace(/[௧௨௩௪௫௬௭௮௯௦]/g, function (match) { return numberMap[match]; }); }, postformat: function (string) { return string.replace(/\d/g, function (match) { return symbolMap[match]; }); }, // refer http://ta.wikipedia.org/s/1er1 meridiemParse: /யாமம்|வைகறை|காலை|நண்பகல்|எற்பாடு|மாலை/, meridiem : function (hour, minute, isLower) { if (hour < 2) { return ' யாமம்'; } else if (hour < 6) { return ' வைகறை'; // வைகறை } else if (hour < 10) { return ' காலை'; // காலை } else if (hour < 14) { return ' நண்பகல்'; // நண்பகல் } else if (hour < 18) { return ' எற்பாடு'; // எற்பாடு } else if (hour < 22) { return ' மாலை'; // மாலை } else { return ' யாமம்'; } }, meridiemHour : function (hour, meridiem) { if (hour === 12) { hour = 0; } if (meridiem === 'யாமம்') { return hour < 2 ? hour : hour + 12; } else if (meridiem === 'வைகறை' || meridiem === 'காலை') { return hour; } else if (meridiem === 'நண்பகல்') { return hour >= 10 ? hour : hour + 12; } else { return hour + 12; } }, week : { dow : 0, // Sunday is the first day of the week. doy : 6 // The week that contains Jan 1st is the first week of the year. } });
module.exports={C:{"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0.02708,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0.00451,"44":0.00451,"45":0,"46":0,"47":0.00903,"48":0.00451,"49":0.00451,"50":0.00451,"51":0,"52":0.03611,"53":0,"54":0,"55":0.00451,"56":0.00903,"57":0.00451,"58":0.00451,"59":0.00451,"60":0.00451,"61":0.00451,"62":0.00451,"63":0.00451,"64":0.01354,"65":0.00451,"66":0.00903,"67":0.00451,"68":0.03611,"69":0.00903,"70":0.00903,"71":0.00451,"72":0.0316,"73":0.00451,"74":0.00903,"75":0.00903,"76":0.01354,"77":0.01806,"78":0.05868,"79":0.07222,"80":1.82817,"81":0.49203,"82":0.02257,"83":0,"3.5":0,"3.6":0},D:{"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0.00451,"37":0,"38":0.00451,"39":0,"40":0,"41":0.00451,"42":0,"43":0.00451,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0.0632,"50":0,"51":0.00451,"52":0,"53":0.00451,"54":0.00451,"55":0.00451,"56":0.00451,"57":0,"58":0.01806,"59":0.00451,"60":0.00451,"61":0.04965,"62":0.00451,"63":0.03611,"64":0.00451,"65":0.00903,"66":0.00451,"67":0.01354,"68":0.00903,"69":0.0316,"70":0.04063,"71":0.05868,"72":0.02708,"73":0.04514,"74":0.12639,"75":0.05417,"76":0.05417,"77":0.05417,"78":0.07222,"79":0.10834,"80":0.23021,"81":0.08577,"83":0.16702,"84":1.32712,"85":11.78154,"86":0.01806,"87":0.00903,"88":0},F:{"9":0,"11":0,"12":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0.00451,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0.06771,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0.00451,"46":0.01354,"47":0.00903,"48":0,"49":0,"50":0.07674,"51":0.20764,"52":0,"53":0,"54":0,"55":0.00451,"56":0,"57":0.00903,"58":0,"60":0.01354,"62":0,"63":0,"64":0,"65":0,"66":0,"67":0,"68":0.0316,"69":0.00451,"70":0.36112,"71":0.02708,"9.5-9.6":0,"10.0-10.1":0,"10.5":0,"10.6":0,"11.1":0,"11.5":0,"11.6":0,"12.1":0},G:{"8":0,"14":1.75683,"3.2":0.00912,"4.0-4.1":0.0152,"4.2-4.3":0,"5.0-5.1":0.00304,"6.0-6.1":0.00152,"7.0-7.1":0.00608,"8.1-8.4":0.01064,"9.0-9.2":0.0076,"9.3":0.08815,"10.0-10.2":0.02432,"10.3":0.1155,"11.0-11.2":0.07143,"11.3-11.4":0.10638,"12.0-12.1":0.16717,"12.2-12.4":1.04407,"13.0-13.1":0.15957,"13.2":0.08359,"13.3":0.60942,"13.4-13.7":1.62613},E:{"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0.00451,"12":0.02257,"13":0.05868,"14":0.06771,_:"0","3.1":0,"3.2":0,"5.1":0.68613,"6.1":0,"7.1":0,"9.1":0,"10.1":0.00451,"11.1":0.02257,"12.1":0.05417,"13.1":0.32952},B:{"12":0.00451,"13":0,"14":0,"15":0,"16":0,"17":0.00903,"18":0.0316,"79":0,"80":0,"81":0.00451,"83":0,"84":0.01354,"85":0.57779},I:{"3":0,"4":0.05986,_:"81","2.1":0,"2.2":0,"2.3":0.00139,"4.1":0.07796,"4.2-4.3":0.02923,"4.4":0,"4.4.3-4.4.4":0.18933},P:{"4":0.57149,"5.0-5.4":0.02005,"6.2-6.4":0.0401,"7.2-7.4":0.08021,"8.2":0.0401,"9.2":0.16042,"10.1":0.13034,"11.1-11.2":0.26068,"12.0":1.31342},A:{"6":0,"7":0,"8":0.01477,"9":0,"10":0,"11":0.03939,"5.5":0},K:{_:"0 10 11 12 11.1 11.5 12.1"},J:{"7":0,"10":0.00549},N:{"10":0,"11":0.01646},M:{"0":0.10972},Q:{"10.4":0.00549},O:{"0":1.83781},H:{"0":1.44387},L:{"0":64.51668},S:{"2.5":0},R:{_:"0"}};
export default class Dep { constructor () { /* 用来存放Watcher对象的数组 */ this.subs = []; } /* 在subs中添加一个Watcher对象 */ addSub (sub) { this.subs.push(sub); } /* 通知所有Watcher对象更新视图 */ notify () { this.subs.forEach((sub) => { sub.update(); }) } }
(function () { var refRootPath = "https://g.alicdn.com/hub/"; AliHub.Runtime.ModulexLoader.addAliasPrefix("~/inc/", "local/"); AliHub.Runtime.ModulexLoader.addModule("local", "../../inc/", true); AliHub.Runtime.ModulexLoader.addModule("quark-panels", refRootPath + "quark-panels/0.5.46/"); AliHub.Runtime.ModulexLoader.addModule("codemirror", refRootPath + "codemirror/5.10/"); if (!window.listener) window.listener = { push: function (str) { console.info(str); } }; })();
g_db.quests[6433]={id:6433,name:"^ffffffThe Eaten Pig",type:0,trigger_policy:3,on_give_up_parent_fail:1,on_success_parent_success:0,can_give_up:1,can_retake:0,can_retake_after_failure:1,on_fail_parent_fail:0,fail_on_death:0,simultaneous_player_limit:0,ai_trigger:0,ai_trigger_enable:0,auto_trigger:0,trigger_on_death:0,remove_obtained_items:1,recommended_level:0,show_quest_title:1,show_as_gold_quest:0,start_npc:6625,finish_npc:0,is_craft_skill_quest:0,can_be_found:1,show_direction:1,level_min:15,level_max:40,dontshow_under_level_min:1,premise_coins:0,dontshow_without_premise_coins:1,req_reputation_min:0,req_reputation_max:0,dontshow_without_req_reputation:1,premise_quests:[],req_cultivation:0,dontshow_without_req_cultivation:1,req_faction_role:0,dontshow_without_req_faction_role:1,req_gender:0,dontshow_wrong_gender:1,req_class:24,dontshow_wrong_class:1,req_be_married:0,dontshow_without_marriage:0,req_be_gm:0,req_global_quest:0,req_global_quest_cond:0,quests_mutex:[],req_blacksmith_level:0,req_tailor_level:0,req_craftsman_level:0,req_apothecary_level:0,special_award_type:0,is_team_task:0,recv_in_team_only:0,req_success_type:0,req_npc_type:0,briefing:"The Blacksmith's pig in the Gate of Antiquity has been eaten by monsters. Please help him.",parent_quest:0,previous_quest:0,next_quest:0,sub_quest_first:6445,dialogue:{},on_success:{normal:{xp:6750,sp:1500,coins:4050,rep:2,culti:0,chi:0,level_multiplier:0,new_waypoint:0,storage_slots:0,inventory_slots:0,petbag_slots:0,ai_trigger:0,ai_trigger_enable:0,divorce:0,item_groups:[{chosen_randomly:1,items:[{id:3369,is_common:1,amount:1,probability:0.10000000,},{id:3370,is_common:1,amount:1,probability:0.10000000,},{id:3368,is_common:1,amount:1,probability:0.10000000,},{id:3366,is_common:1,amount:1,probability:0.69999999,},]},],},by_time:[],by_item_cnt:[],},on_failure:{normal:{xp:0,sp:0,coins:0,rep:0,culti:0,chi:0,level_multiplier:0,new_waypoint:0,storage_slots:0,inventory_slots:0,petbag_slots:0,ai_trigger:0,ai_trigger_enable:0,divorce:0,item_groups:[],},by_time:[],by_item_cnt:[],},children:[ {id:6445,name:"^ffffffBoondock Chisler",type:0,trigger_policy:0,on_give_up_parent_fail:1,on_success_parent_success:0,can_give_up:1,can_retake:1,can_retake_after_failure:1,on_fail_parent_fail:0,fail_on_death:0,simultaneous_player_limit:0,ai_trigger:0,ai_trigger_enable:0,auto_trigger:0,trigger_on_death:0,remove_obtained_items:1,recommended_level:0,show_quest_title:1,show_as_gold_quest:0,start_npc:0,finish_npc:6625,is_craft_skill_quest:0,can_be_found:1,show_direction:1,level_min:0,level_max:0,dontshow_under_level_min:1,premise_coins:0,dontshow_without_premise_coins:1,req_reputation_min:0,req_reputation_max:0,dontshow_without_req_reputation:1,premise_quests:[],req_cultivation:0,dontshow_without_req_cultivation:1,req_faction_role:0,dontshow_without_req_faction_role:1,req_gender:0,dontshow_wrong_gender:1,req_class:0,dontshow_wrong_class:1,req_be_married:0,dontshow_without_marriage:0,req_be_gm:0,req_global_quest:0,req_global_quest_cond:0,quests_mutex:[],req_blacksmith_level:0,req_tailor_level:0,req_craftsman_level:0,req_apothecary_level:0,special_award_type:0,is_team_task:1,recv_in_team_only:0,req_success_type:1,req_npc_type:1,briefing:"Kill fifteen Boondock Chislers in the hills west of Courage Path for the blacksmith of Gate of Antiquity.",parent_quest:6433,previous_quest:0,next_quest:6446,sub_quest_first:0,dialogue:{},on_success:{normal:{xp:0,sp:0,coins:0,rep:0,culti:0,chi:0,level_multiplier:0,new_waypoint:0,storage_slots:0,inventory_slots:0,petbag_slots:0,ai_trigger:0,ai_trigger_enable:0,divorce:0,item_groups:[],},by_time:[],by_item_cnt:[],},on_failure:{normal:{xp:0,sp:0,coins:0,rep:0,culti:0,chi:0,level_multiplier:0,new_waypoint:0,storage_slots:0,inventory_slots:0,petbag_slots:0,ai_trigger:0,ai_trigger_enable:0,divorce:0,item_groups:[],},by_time:[],by_item_cnt:[],},children:[]}, {id:6446,name:"^ffffffBloodthirsty Adalwolf ",type:0,trigger_policy:0,on_give_up_parent_fail:1,on_success_parent_success:1,can_give_up:1,can_retake:1,can_retake_after_failure:1,on_fail_parent_fail:0,fail_on_death:0,simultaneous_player_limit:0,ai_trigger:0,ai_trigger_enable:0,auto_trigger:0,trigger_on_death:0,remove_obtained_items:1,recommended_level:0,show_quest_title:1,show_as_gold_quest:0,start_npc:0,finish_npc:6625,is_craft_skill_quest:0,can_be_found:1,show_direction:1,level_min:0,level_max:0,dontshow_under_level_min:1,premise_coins:0,dontshow_without_premise_coins:1,req_reputation_min:0,req_reputation_max:0,dontshow_without_req_reputation:1,premise_quests:[],req_cultivation:0,dontshow_without_req_cultivation:1,req_faction_role:0,dontshow_without_req_faction_role:1,req_gender:0,dontshow_wrong_gender:1,req_class:0,dontshow_wrong_class:1,req_be_married:0,dontshow_without_marriage:0,req_be_gm:0,req_global_quest:0,req_global_quest_cond:0,quests_mutex:[],req_blacksmith_level:0,req_tailor_level:0,req_craftsman_level:0,req_apothecary_level:0,special_award_type:0,is_team_task:1,recv_in_team_only:0,req_success_type:1,req_npc_type:1,briefing:"Kill twenty Bloodthirsty Adalwolves in the hills west of Courage Path for the blacksmith of Gate of Antiquity.",parent_quest:6433,previous_quest:6445,next_quest:0,sub_quest_first:0,dialogue:{},on_success:{normal:{xp:0,sp:0,coins:0,rep:0,culti:0,chi:0,level_multiplier:0,new_waypoint:0,storage_slots:0,inventory_slots:0,petbag_slots:0,ai_trigger:0,ai_trigger_enable:0,divorce:0,item_groups:[],},by_time:[],by_item_cnt:[],},on_failure:{normal:{xp:0,sp:0,coins:0,rep:0,culti:0,chi:0,level_multiplier:0,new_waypoint:0,storage_slots:0,inventory_slots:0,petbag_slots:0,ai_trigger:0,ai_trigger_enable:0,divorce:0,item_groups:[],},by_time:[],by_item_cnt:[],},children:[]},]};
"use strict"; const debug = require("debug")("bot-express:skill"); module.exports = class SkillTestBuiltinParserOndemand { constructor() { this.required_parameter = { pizza: { message_to_confirm: { type: "text", text: "ご注文のピザはお決まりでしょうか? マルゲリータ、マリナーラからお選びください。", }, parser: async (value, bot, event, context) => { return await bot.builtin_parser.dialogflow.parse(value, { parameter_name: "pizza", }) } }, size: { message_to_confirm: { type: "template", text: "サイズはいかがいたしましょうか? S、M、Lからお選びください。", }, parser: async (value, bot, event, context) => { return await bot.builtin_parser.list.parse(value, { list: ["S", "M", "L"] }) } } } this.clear_context_on_finish = true; } async finish(bot, event, context){ } };
(function(factory){if(typeof module==="object"&&typeof module.exports!=="undefined"){module.exports=factory}else{factory(FusionCharts)}})(function(FusionCharts){(function(modules){var installedModules={};function __webpack_require__(moduleId){if(installedModules[moduleId]){return installedModules[moduleId].exports}var module=installedModules[moduleId]={i:moduleId,l:false,exports:{}};modules[moduleId].call(module.exports,module,module.exports,__webpack_require__);module.l=true;return module.exports}__webpack_require__.m=modules;__webpack_require__.c=installedModules;__webpack_require__.d=function(exports,name,getter){if(!__webpack_require__.o(exports,name)){Object.defineProperty(exports,name,{enumerable:true,get:getter})}};__webpack_require__.r=function(exports){if(typeof Symbol!=="undefined"&&Symbol.toStringTag){Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"})}Object.defineProperty(exports,"__esModule",{value:true})};__webpack_require__.t=function(value,mode){if(mode&1)value=__webpack_require__(value);if(mode&8)return value;if(mode&4&&typeof value==="object"&&value&&value.__esModule)return value;var ns=Object.create(null);__webpack_require__.r(ns);Object.defineProperty(ns,"default",{enumerable:true,value:value});if(mode&2&&typeof value!="string")for(var key in value)__webpack_require__.d(ns,key,function(key){return value[key]}.bind(null,key));return ns};__webpack_require__.n=function(module){var getter=module&&module.__esModule?function getDefault(){return module["default"]}:function getModuleExports(){return module};__webpack_require__.d(getter,"a",getter);return getter};__webpack_require__.o=function(object,property){return Object.prototype.hasOwnProperty.call(object,property)};__webpack_require__.p="";return __webpack_require__(__webpack_require__.s=10)})({10:function(module,exports,__webpack_require__){"use strict";var _fusioncharts=__webpack_require__(11);var _fusioncharts2=_interopRequireDefault(_fusioncharts);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}FusionCharts.addDep(_fusioncharts2["default"])},11:function(module,exports,__webpack_require__){"use strict";exports.__esModule=true; /**! * @license FusionCharts JavaScript Library * Copyright FusionCharts Technologies LLP * License Information at <http://www.fusioncharts.com/license> * * @author FusionCharts Technologies LLP * @meta package_map_pack * @id fusionmaps.Gabu.1.08-30-2018 01:07:47 */var M="M",L="L",Z="Z",Q="Q",LFT="left",RGT="right",CEN="center",MID="middle",TOP="top",BTM="bottom",geodefinitions=[{name:"Gabu",revision:1,creditLabel:false,standaloneInit:false,baseWidth:511,baseHeight:631,baseScaleFactor:10,firstEntity:"GW.GA.SN",entities:{"GW.GA.SN":{outlines:[[M,1743,497,Q,1740,494,1736,493,1735,493,1734,492,1733,490,1732,489,1729,486,1729,482,1729,480,1728,479,1727,479,1726,479,1725,479,1724,478,1723,476,1722,476,1721,476,1721,475,1720,474,1718,472,1715,470,1714,466,1713,454,1713,442,1713,440,1713,437,1712,435,1714,435,1716,435,1717,434,1718,433,1720,432,1721,432,1722,430,1725,427,1724,420,1724,419,1723,419,1719,416,1716,413,1710,409,1705,413,1704,414,1703,414,1698,414,1693,415,1692,415,1692,415,1690,417,1689,418,1687,421,1684,425,1684,426,1683,426,1677,427,1669,427,1664,427,1663,431,1662,433,1662,434,L,1662,435,Q,1649,436,1635,436,1634,436,1634,435,1632,434,1628,432,1626,427,1621,426,1617,425,1612,425,1608,425,1605,424,1600,424,1598,421,1596,418,1594,416,1593,415,1593,414,1593,412,1591,411,1591,410,1590,409,1585,408,1579,408,1579,408,1578,408,1573,406,1571,402,1570,402,1570,401,1566,394,1562,386,1561,381,1556,378,1553,377,1553,373,1553,371,1552,369,1552,368,1552,368,1552,366,1550,365,1547,362,1545,358,1544,356,1544,354,1543,350,1542,346,1541,343,1538,342,1534,339,1533,334,1533,331,1532,329,1532,328,1532,327,1531,323,1525,324,1522,324,1519,324,1519,324,1518,324,1515,325,1513,327,1513,328,1512,328,1511,328,1511,330,1511,349,1511,369,1511,372,1509,375,1508,378,1507,381,1506,382,1506,383,1506,387,1504,387,1499,388,1494,389,1492,390,1489,390,1488,390,1487,390,1483,391,1481,396,1481,397,1480,398,1478,399,1476,400,1475,401,1474,401,1464,401,1455,401,1454,401,1453,402,1452,403,1450,403,1443,401,1440,406,1439,408,1439,409,1439,412,1437,412,1432,413,1428,411,1427,410,1425,407,1421,402,1413,402,1407,402,1405,398,1402,394,1401,390,1401,389,1401,389,1396,387,1394,382,1392,377,1391,373,1391,372,1390,371,1389,370,1388,368,1387,367,1386,366,1383,363,1382,359,1380,347,1381,335,1381,334,1380,333,1379,331,1376,330,1375,329,1374,328,1373,327,1371,327,1369,326,1370,322,1370,317,1369,313,1369,312,1368,311,1364,308,1363,303,1362,299,1360,296,1360,296,1359,296,1355,295,1351,296,1350,296,1350,296,1347,299,1348,302,1348,304,1346,304,1330,304,1314,304,1309,304,1303,304,1300,304,1299,305,1298,306,1298,307,1297,309,1296,311,1294,312,1293,312,1275,313,1256,313,1254,313,1251,313,1245,314,1243,309,1243,309,1243,308,1242,307,1242,306,1242,302,1242,299,1242,294,1241,290,1240,289,1240,286,1240,284,1237,283,1234,283,1231,284,1227,285,1225,290,1224,292,1223,293,1223,294,1222,294,1213,296,1204,295,1204,299,1204,304,1204,304,1203,305,1199,308,1196,312,1196,313,1195,313,1195,316,1194,318,1194,321,1194,324,1194,326,1193,329,1193,329,1193,330,1193,334,1191,337,1191,338,1190,339,1188,340,1185,341,1184,342,1183,343,1180,347,1180,353,1180,354,1180,355,1180,357,1179,358,1175,361,1170,363,1169,364,1168,365,1168,366,1167,366,1165,369,1164,372,1163,373,1163,374,1162,380,1160,384,1157,389,1151,392,1150,392,1150,392,1147,396,1147,401,1146,405,1145,409,1144,412,1143,412,1140,414,1135,414,1125,414,1116,414,1115,414,1115,414,1107,414,1104,421,1102,425,1097,425,1092,424,1088,425,1087,426,1087,426,1085,427,1084,428,1083,428,1082,428,1081,429,1080,430,1080,431,1079,431,1078,434,1073,434,1064,434,1055,434,1050,434,1045,434,1041,435,1039,431,1038,431,1038,430,1037,429,1036,429,1033,426,1030,421,1028,415,1024,413,1020,410,1017,407,1016,407,1016,406,1015,405,1014,404,1012,402,1012,399,1012,394,1009,391,1009,388,1007,387,1005,386,1003,383,1001,379,1e3,375,999,374,999,373,999,371,998,370,997,370,996,369,991,362,984,355,978,349,975,342,975,342,974,341,974,340,973,337,973,335,972,333,969,330,965,328,965,328,964,328,962,327,960,325,959,324,959,323,958,322,957,321,953,318,952,316,952,315,951,315,948,313,945,309,943,308,942,306,941,303,939,301,937,300,936,299,931,292,925,286,924,285,923,283,922,282,922,281,921,281,921,280,920,275,919,271,919,270,917,270,915,269,915,268,914,266,912,265,911,263,911,262,912,260,910,258,909,257,908,257,908,256,908,256,905,254,902,254,899,255,896,254,890,253,886,258,885,259,885,260,884,262,881,263,876,265,871,265,861,265,852,266,851,266,850,266,845,266,842,269,841,271,839,272,836,274,835,275,832,278,828,282,827,283,827,283,827,285,826,286,825,288,824,289,824,290,824,291,823,293,823,296,823,298,822,300,822,301,821,301,821,302,820,303,820,304,819,306,813,314,814,324,814,325,814,325,815,328,815,330,815,331,815,331,816,333,816,335,818,340,820,343,821,346,821,348,822,352,823,349,823,357,823,366,823,385,823,405,823,425,823,445,823,447,824,450,824,455,825,458,826,459,826,460,827,462,828,464,830,469,833,472,833,473,834,474,835,476,837,478,838,479,838,480,844,486,852,492,858,497,861,507,861,508,862,508,864,510,865,512,866,514,868,516,869,517,870,519,871,524,868,528,865,532,866,534,866,539,864,541,862,544,861,548,859,556,855,563,855,564,855,564,854,571,854,579,854,584,855,587,858,592,860,596,863,601,863,606,863,609,865,610,866,610,866,611,869,613,870,617,871,618,871,618,872,627,864,630,854,633,845,637,844,637,844,637,843,640,841,641,840,642,839,643,838,644,838,645,837,646,837,646,836,647,836,648,835,650,834,652,832,653,831,655,830,656,829,657,823,660,823,665,823,666,823,666,827,674,833,678,833,679,834,679,840,685,846,691,846,692,846,693,847,704,847,714,846,734,847,753,847,755,848,757,849,762,851,767,851,768,852,769,853,770,854,773,854,778,856,783,857,784,857,785,858,786,858,787,859,790,859,792,860,794,860,798,860,799,861,799,861,800,862,801,866,805,870,806,872,807,873,809,873,811,874,812,878,815,882,815,886,816,890,816,892,816,895,816,899,817,902,819,903,820,903,821,903,826,904,831,905,832,905,832,906,832,906,833,910,835,915,837,918,838,920,840,921,842,922,844,922,845,923,846,924,847,924,849,923,855,928,858,935,862,944,864,944,864,945,864,953,865,962,865,963,865,965,865,970,867,972,869,975,872,980,873,990,875,1001,874,1005,874,1009,877,1012,879,1017,882,1026,886,1036,888,1040,888,1043,891,1044,891,1044,892,1052,895,1057,900,1059,903,1058,909,1058,910,1058,912,1057,916,1054,921,1053,922,1053,922,1053,925,1052,927,1052,928,1052,928,1051,939,1051,950,1051,960,1051,970,1050,980,1048,991,1048,992,1048,993,1047,998,1045,1001,1045,1002,1045,1002,1043,1007,1040,1009,1039,1009,1038,1010,1037,1011,1036,1012,1035,1014,1033,1014,1029,1015,1026,1020,1024,1022,1022,1024,1022,1024,1021,1024,1016,1025,1013,1029,1013,1029,1012,1029,1012,1030,1011,1031,1008,1034,1004,1035,999,1037,997,1040,996,1043,994,1046,993,1047,993,1047,990,1047,988,1048,975,1049,968,1040,964,1036,961,1035,960,1034,959,1033,956,1030,952,1028,951,1027,950,1027,949,1026,948,1026,945,1025,942,1025,939,1022,936,1019,936,1019,935,1018,930,1014,927,1010,923,1006,920,1004,918,1003,917,1002,916,1001,915,1e3,913,998,909,997,905,997,902,996,900,995,898,994,895,992,892,988,892,988,891,988,886,982,883,974,882,971,880,970,879,968,877,967,873,966,868,965,864,965,860,963,859,962,859,962,855,959,854,955,854,954,853,954,850,950,844,949,844,949,843,949,838,949,835,947,834,947,834,947,830,944,828,939,827,939,827,938,827,934,824,933,822,932,819,932,816,932,814,933,812,935,808,935,798,938,792,946,791,947,790,948,787,950,783,952,779,954,775,958,775,959,774,960,770,964,767,966,766,966,766,967,765,969,765,970,763,972,762,976,760,980,759,984,759,986,758,988,758,989,758,990,757,992,756,993,755,994,752,996,748,998,744,1001,742,1002,741,1004,738,1008,735,1011,735,1012,735,1013,732,1015,728,1018,727,1019,727,1020,726,1021,725,1022,725,1023,724,1024,723,1026,723,1029,722,1031,722,1033,721,1035,721,1037,720,1042,718,1046,716,1048,714,1049,712,1050,709,1050,708,1050,707,1051,706,1051,705,1051,702,1051,699,1053,698,1054,696,1054,692,1054,688,1055,687,1055,686,1056,683,1058,680,1062,680,1064,678,1064,677,1065,676,1065,674,1067,671,1067,668,1066,667,1068,663,1073,658,1075,657,1075,655,1075,652,1075,648,1075,639,1075,631,1076,630,1077,629,1078,627,1081,625,1084,625,1084,624,1084,618,1085,611,1085,608,1085,605,1084,598,1083,590,1084,587,1084,585,1084,574,1086,574,1075,574,1074,573,1073,572,1071,573,1067,573,1066,572,1065,572,1064,572,1063,572,1061,571,1058,571,1058,571,1057,571,1038,571,1018,571,1012,571,1006,572,996,563,994,561,993,558,992,556,992,556,990,556,990,556,989,552,986,549,983,548,983,548,983,538,982,527,982,522,982,519,986,519,986,519,987,518,987,517,988,515,992,511,992,506,993,501,993,499,993,498,994,495,994,494,995,493,996,491,998,490,1e3,488,1002,487,1004,485,1006,484,1007,483,1007,468,1007,452,1007,451,1007,450,1007,448,1006,446,1006,445,1006,445,1006,443,1005,442,1004,441,1004,441,1003,440,1002,439,1002,438,1001,437,999,436,998,434,998,430,999,428,996,425,992,422,989,412,989,406,983,403,980,401,976,401,974,400,971,400,971,399,970,397,966,395,962,393,959,392,958,391,955,388,955,383,953,381,949,378,945,373,945,367,945,361,945,356,945,351,947,351,947,350,947,345,949,343,953,343,954,342,954,341,956,339,958,339,958,338,960,335,962,335,967,336,973,331,974,331,974,330,974,330,975,329,975,326,976,321,976,320,976,320,975,318,973,315,970,315,969,314,968,313,967,313,966,312,965,311,965,311,964,310,963,310,962,310,961,309,949,318,947,321,946,326,944,330,942,334,942,335,942,336,942,338,942,339,940,341,938,343,937,346,935,351,933,352,929,352,925,352,922,351,920,350,918,348,915,347,914,344,911,343,911,342,911,336,910,329,910,319,910,308,911,307,911,306,911,299,911,292,912,291,912,289,912,279,913,269,913,259,913,250,914,249,914,248,914,245,916,239,915,237,915,236,916,234,916,232,916,227,917,225,921,222,925,220,928,213,935,204,940,202,941,201,943,200,945,199,946,198,946,197,948,196,952,195,954,195,955,194,955,192,958,190,960,190,961,189,961,187,964,185,967,185,968,185,969,183,987,184,1006,184,1016,185,1025,185,1026,185,1027,185,1029,186,1030,187,1035,191,1039,192,1040,192,1040,195,1044,197,1048,197,1049,198,1049,200,1052,200,1056,200,1057,200,1058,201,1060,202,1062,202,1063,203,1064,205,1065,205,1067,205,1069,206,1070,207,1071,208,1071,211,1074,214,1076,218,1079,220,1081,221,1082,222,1083,224,1085,226,1087,229,1091,229,1094,230,1096,230,1097,232,1100,233,1104,233,1105,234,1106,235,1106,236,1108,236,1108,237,1109,239,1111,240,1112,245,1116,249,1122,251,1126,251,1131,251,1133,252,1134,253,1138,256,1140,257,1140,257,1141,258,1141,259,1142,260,1142,261,1143,264,1146,267,1149,270,1153,273,1157,274,1159,276,1161,277,1162,278,1162,279,1165,281,1165,282,1165,283,1166,290,1171,294,1178,295,1179,295,1180,297,1186,304,1187,323,1187,343,1187,353,1187,362,1186,364,1186,366,1186,368,1185,371,1185,372,1184,372,1184,373,1183,374,1182,376,1179,379,1177,380,1176,383,1176,384,1176,385,1176,389,1176,391,1175,391,1174,391,1174,393,1172,395,1171,395,1170,396,1170,396,1169,397,1168,398,1168,399,1167,400,1166,401,1166,404,1165,408,1164,412,1163,415,1161,420,1159,421,1154,421,1154,421,1153,421,1149,423,1146,424,1143,426,1140,426,1139,426,1139,427,1137,427,1135,427,1133,428,1132,430,1129,431,1127,432,1122,434,1119,435,1119,435,1118,435,1116,438,1116,440,1116,443,1115,449,1115,452,1120,452,1121,453,1121,453,1122,454,1123,455,1123,456,1124,458,1124,460,1125,462,1126,463,1126,466,1127,467,1128,469,1130,471,1131,479,1136,483,1143,485,1147,485,1152,485,1152,485,1153,485,1159,489,1162,490,1162,490,1163,491,1164,492,1164,498,1170,505,1176,505,1176,506,1177,509,1179,510,1183,510,1184,510,1185,511,1186,511,1189,511,1190,511,1190,512,1191,512,1194,512,1197,513,1198,513,1199,514,1199,518,1202,523,1205,527,1209,531,1212,535,1215,537,1218,542,1221,545,1225,546,1226,547,1227,550,1231,552,1234,553,1237,553,1240,554,1245,557,1250,558,1251,559,1254,561,1256,562,1260,562,1261,563,1261,564,1262,566,1264,567,1266,569,1268,570,1269,570,1270,570,1286,570,1301,571,1304,572,1307,574,1311,580,1312,581,1312,581,1313,582,1313,583,1314,587,1315,587,1318,587,1328,587,1339,587,1340,586,1342,585,1346,585,1351,585,1352,584,1352,583,1354,583,1356,584,1358,582,1360,581,1361,580,1362,580,1362,578,1363,574,1364,570,1366,567,1368,564,1372,564,1372,563,1374,562,1374,561,1375,560,1375,559,1377,557,1381,551,1382,551,1382,550,1382,548,1384,545,1384,542,1385,541,1387,540,1388,539,1390,538,1391,538,1392,539,1395,536,1395,535,1395,535,1395,527,1396,519,1396,518,1396,517,1395,513,1392,510,1387,509,1385,507,1385,502,1386,499,1383,498,1382,495,1380,495,1379,494,1378,493,1375,491,1374,491,1374,491,1373,489,1369,484,1367,483,1367,482,1367,472,1365,462,1364,461,1364,460,1363,457,1360,453,1358,450,1355,446,1354,435,1353,433,1360,433,1361,433,1361,433,1363,432,1365,431,1366,430,1367,429,1367,428,1368,423,1370,421,1374,421,1375,421,1375,420,1380,422,1385,422,1386,423,1387,429,1391,434,1396,434,1396,434,1397,434,1408,434,1420,434,1425,432,1429,432,1432,432,1435,433,1446,422,1448,419,1448,418,1446,418,1446,417,1445,415,1441,410,1438,410,1438,409,1437,402,1434,394,1435,390,1435,386,1433,385,1432,384,1431,383,1430,383,1429,382,1428,381,1427,380,1426,380,1425,376,1417,371,1410,368,1407,366,1403,364,1399,360,1395,359,1393,357,1391,357,1390,356,1390,354,1389,352,1388,349,1387,347,1385,344,1382,341,1381,340,1381,340,1381,338,1380,334,1380,329,1380,324,1381,323,1381,322,1381,319,1381,318,1383,317,1384,316,1384,313,1387,312,1391,311,1396,309,1402,309,1403,309,1403,308,1404,308,1405,306,1407,304,1408,304,1409,304,1410,303,1411,302,1412,301,1412,301,1413,300,1415,300,1418,299,1423,302,1426,303,1426,303,1427,309,1433,314,1440,315,1443,316,1444,319,1448,321,1452,322,1453,322,1454,323,1455,324,1458,325,1467,325,1476,324,1485,325,1494,325,1498,326,1501,327,1502,328,1503,335,1507,342,1515,345,1519,347,1523,347,1524,347,1525,347,1529,350,1531,354,1533,357,1535,359,1536,361,1537,370,1540,374,1548,374,1551,375,1553,375,1554,376,1554,378,1557,380,1558,382,1560,382,1563,382,1566,380,1568,377,1570,373,1573,369,1576,368,1581,367,1583,365,1585,361,1587,360,1592,360,1593,360,1594,360,1599,356,1600,355,1601,353,1602,348,1603,346,1607,346,1609,345,1610,341,1613,337,1614,332,1615,329,1617,327,1618,326,1620,321,1626,319,1631,317,1635,312,1636,307,1637,301,1638,299,1638,298,1639,297,1643,293,1644,293,1645,292,1645,285,1645,280,1648,277,1649,275,1652,275,1653,274,1653,263,1654,252,1654,247,1654,241,1651,239,1647,234,1644,233,1644,232,1644,229,1644,226,1642,221,1637,213,1637,211,1637,209,1636,206,1634,205,1632,201,1629,196,1628,193,1628,190,1627,186,1627,183,1623,182,1621,180,1619,178,1616,173,1614,172,1614,171,1613,169,1611,166,1608,164,1605,160,1604,157,1602,152,1603,151,1603,150,1603,147,1603,146,1605,142,1609,141,1612,141,1613,140,1614,136,1618,130,1621,129,1621,128,1623,127,1628,124,1632,118,1637,113,1643,112,1645,112,1646,112,1648,110,1648,109,1649,109,1652,109,1653,108,1653,108,1654,107,1655,103,1657,98,1659,94,1660,91,1661,82,1664,75,1669,72,1671,69,1675,67,1678,66,1679,65,1680,65,1680,65,1682,64,1684,62,1685,61,1686,58,1689,56,1691,55,1692,55,1692,54,1696,53,1701,53,1702,53,1703,52,1708,48,1711,42,1715,42,1721,42,1727,48,1727,50,1728,51,1728,56,1729,61,1731,62,1732,63,1732,64,1733,65,1733,66,1733,68,1733,69,1733,70,1733,74,1734,79,1735,80,1735,80,1735,86,1734,91,1739,93,1740,95,1742,98,1744,102,1745,103,1745,103,1745,105,1746,106,1747,110,1751,114,1754,115,1754,116,1755,119,1756,122,1761,122,1762,122,1763,123,1769,123,1775,123,1777,122,1778,122,1779,121,1779,117,1780,114,1781,113,1781,111,1781,107,1782,103,1785,101,1785,100,1787,99,1789,97,1789,95,1789,93,1790,91,1790,90,1791,88,1792,88,1793,88,1794,87,1794,86,1795,86,1796,83,1798,81,1798,80,1799,79,1799,79,1800,78,1800,76,1800,75,1801,74,1802,73,1804,73,1805,72,1806,72,1813,73,1821,73,1837,73,1852,73,1857,75,1862,84,1864,93,1864,113,1863,133,1863,152,1863,172,1863,177,1863,181,1864,182,1864,182,1864,186,1867,188,1870,188,1870,188,1871,189,1874,192,1875,192,1876,193,1876,198,1876,201,1878,204,1879,206,1880,207,1882,209,1883,210,1883,210,1883,212,1885,213,1885,215,1885,217,1885,222,1885,225,1890,226,1891,227,1891,229,1895,233,1897,237,1899,241,1902,241,1903,242,1905,243,1905,244,1906,244,1907,245,1907,250,1915,256,1920,256,1920,257,1922,264,1928,269,1933,275,1939,281,1944,282,1944,283,1945,284,1946,286,1948,289,1949,290,1951,293,1953,296,1956,296,1956,297,1957,304,1962,310,1971,312,1974,314,1976,316,1978,318,1981,321,1983,322,1985,328,1990,334,1996,334,1997,335,1997,338,2004,347,2007,348,2008,348,2008,349,2010,352,2011,360,2015,364,2023,365,2025,366,2027,367,2029,368,2031,369,2035,371,2038,371,2039,372,2039,372,2040,373,2041,375,2044,377,2046,378,2047,379,2050,380,2056,384,2062,389,2069,396,2075,397,2076,397,2076,398,2080,401,2082,401,2083,402,2083,403,2086,405,2088,407,2090,408,2092,409,2094,410,2095,410,2096,410,2097,411,2102,414,2105,420,2111,425,2118,430,2125,434,2134,435,2134,435,2135,436,2138,437,2141,438,2146,440,2150,441,2152,442,2152,444,2154,444,2155,445,2156,445,2157,448,2158,449,2163,449,2164,449,2164,451,2166,451,2169,451,2171,452,2171,456,2174,457,2178,458,2179,458,2180,458,2182,459,2183,459,2184,459,2184,460,2185,460,2186,462,2189,463,2191,463,2192,464,2193,L,464,2194,Q,466,2198,467,2202,467,2203,467,2204,467,2210,470,2214,470,2226,471,2237,471,2239,472,2241,472,2242,472,2243,472,2245,473,2248,474,2255,473,2263,473,2264,473,2265,471,2268,471,2271,471,2273,471,2274,470,2276,469,2280,469,2280,469,2281,469,2282,468,2283,467,2287,464,2292,462,2294,462,2295,461,2296,461,2297,459,2302,459,2307,460,2311,458,2313,454,2318,452,2324,451,2328,449,2330,449,2331,448,2332,446,2335,445,2340,445,2344,445,2348,445,2349,444,2350,443,2352,443,2353,441,2355,441,2357,440,2359,440,2361,438,2362,437,2364,434,2368,432,2373,431,2374,431,2375,430,2383,426,2390,425,2390,425,2391,423,2393,422,2396,421,2401,420,2405,419,2406,419,2407,419,2411,417,2414,415,2417,413,2421,413,2422,412,2423,412,2424,412,2425,411,2440,411,2454,411,2474,411,2494,412,2503,413,2512,413,2513,413,2513,414,2516,415,2519,416,2520,416,2520,419,2528,419,2538,419,2540,419,2541,421,2544,423,2547,424,2548,425,2548,428,2550,429,2555,429,2556,429,2556,430,2561,433,2564,435,2567,436,2570,437,2571,437,2572,438,2574,439,2576,439,2577,439,2578,440,2583,444,2586,445,2587,445,2588,446,2588,447,2589,448,2590,448,2592,449,2595,449,2597,450,2597,450,2598,451,2599,450,2602,450,2603,450,2604,451,2612,451,2621,451,2622,452,2623,453,2625,454,2626,455,2629,457,2631,458,2635,460,2639,461,2640,461,2641,463,2643,465,2645,468,2648,470,2653,470,2654,471,2654,471,2655,472,2656,472,2658,473,2659,473,2660,474,2662,475,2664,476,2666,477,2666,478,2667,479,2668,479,2669,483,2673,485,2678,486,2679,486,2680,490,2682,493,2685,494,2686,495,2686,498,2688,498,2691,498,2692,498,2692,500,2694,500,2697,499,2701,501,2705,504,2709,508,2711,515,2715,519,2719,520,2720,521,2720,521,2721,522,2721,524,2726,524,2734,523,2740,526,2743,532,2747,540,2752,541,2753,541,2754,544,2757,547,2760,548,2761,548,2762,549,2762,549,2763,549,2770,551,2776,552,2777,553,2778,556,2779,560,2782,567,2788,568,2798,568,2800,569,2802,570,2807,572,2809,575,2813,579,2814,580,2815,580,2815,584,2815,586,2819,587,2820,587,2820,591,2823,594,2826,601,2834,602,2843,605,2847,608,2851,609,2851,609,2852,613,2856,617,2860,620,2862,622,2866,622,2868,622,2869,621,2876,625,2880,627,2882,629,2883,632,2884,633,2887,637,2891,641,2894,645,2896,649,2898,651,2898,651,2901,652,2904,651,2908,651,2913,654,2915,660,2919,663,2923,663,2924,664,2924,666,2924,666,2926,667,2932,664,2937,663,2938,662,2938,659,2939,659,2942,658,2943,657,2943,656,2943,655,2945,653,2947,652,2949,651,2950,651,2951,651,2956,650,2961,649,2962,649,2964,649,2974,642,2981,641,2982,641,2984,641,2989,640,2993,640,2995,639,2996,646,2996,652,3001,654,3002,655,3003,656,3004,657,3005,659,3008,660,3009,662,3013,665,3016,667,3018,667,3020,667,3022,668,3023,669,3023,669,3024,671,3028,675,3031,676,3032,677,3034,678,3035,679,3037,681,3041,685,3043,686,3043,686,3044,687,3045,688,3046,689,3046,689,3047,692,3050,695,3053,697,3055,700,3056,704,3057,706,3054,707,3054,707,3053,710,3048,714,3044,715,3044,715,3043,719,3042,721,3039,723,3038,723,3036,724,3031,727,3028,729,3027,730,3025,731,3024,731,3023,732,3020,732,3018,734,3014,737,3011,739,3009,742,3008,743,3007,744,3006,745,3003,746,3e3,747,2995,747,2990,747,2990,748,2989,750,2986,751,2982,751,2980,751,2979,751,2975,753,2974,754,2974,754,2972,755,2968,755,2963,755,2962,756,2961,758,2958,760,2955,761,2955,761,2954,762,2953,762,2952,763,2947,764,2942,764,2942,764,2941,766,2939,768,2936,768,2936,769,2935,769,2933,770,2931,770,2930,770,2930,771,2925,774,2923,782,2919,786,2910,787,2908,790,2906,791,2906,792,2905,797,2903,799,2897,800,2892,804,2890,805,2890,806,2889,806,2888,807,2888,808,2887,808,2885,808,2884,809,2882,810,2882,810,2881,811,2876,815,2874,820,2870,822,2865,824,2863,825,2860,825,2860,826,2859,827,2858,829,2856,833,2855,833,2850,832,2848,834,2846,835,2846,835,2844,835,2844,835,2843,839,2838,843,2833,843,2826,845,2823,846,2822,846,2821,848,2818,850,2814,851,2813,851,2813,853,2809,853,2804,852,2793,858,2786,859,2786,859,2785,861,2782,862,2779,862,2778,862,2777,862,2768,862,2759,862,2754,863,2750,864,2744,867,2741,870,2738,872,2733,872,2732,872,2732,874,2728,875,2724,877,2721,880,2718,883,2715,885,2712,888,2708,888,2704,889,2699,893,2696,894,2694,896,2693,898,2691,899,2690,900,2688,900,2685,900,2684,901,2683,902,2677,907,2673,909,2670,910,2667,910,2666,910,2666,912,2663,912,2659,911,2658,912,2657,913,2656,913,2656,914,2655,914,2654,915,2654,916,2653,918,2651,919,2649,920,2645,921,2640,922,2633,927,2629,927,2628,927,2628,928,2625,929,2624,930,2623,930,2622,930,2615,932,2611,933,2610,933,2609,933,2597,932,2585,932,2578,932,2571,934,2565,938,2561,941,2558,942,2554,942,2554,942,2553,943,2552,943,2551,943,2550,944,2549,945,2546,945,2541,945,2541,945,2540,946,2535,946,2529,946,2527,946,2525,947,2523,948,2521,948,2521,948,2520,949,2517,950,2515,951,2515,951,2514,952,2507,953,2501,953,2500,953,2499,955,2495,957,2490,958,2488,958,2487,958,2485,958,2482,958,2479,959,2477,959,2476,959,2475,959,2472,960,2470,961,2469,961,2467,962,2465,963,2463,966,2460,967,2457,967,2455,968,2452,968,2449,969,2446,970,2445,970,2443,971,2439,970,2435,970,2434,971,2433,971,2432,971,2431,971,2411,971,2392,971,2376,971,2361,971,2360,970,2359,962,2354,961,2345,960,2343,960,2342,959,2339,958,2337,958,2336,957,2336,954,2331,952,2327,952,2326,951,2325,951,2325,951,2324,951,2321,950,2319,950,2319,950,2318,950,2302,949,2286,949,2285,949,2284,949,2279,947,2275,947,2275,946,2274,945,2273,945,2272,942,2267,942,2259,943,2254,939,2252,938,2252,938,2252,937,2249,933,2248,929,2245,928,2241,927,2239,927,2238,927,2231,924,2227,923,2227,922,2226,920,2219,921,2211,921,2210,921,2209,920,2204,920,2200,920,2199,919,2198,917,2194,914,2191,913,2189,912,2186,911,2184,911,2182,910,2173,910,2162,910,2155,911,2148,911,2147,911,2146,912,2142,916,2139,918,2138,918,2135,918,2132,919,2130,920,2130,920,2129,921,2127,921,2125,920,2123,921,2123,922,2123,922,2122,923,2117,923,2113,923,2107,925,2104,927,2100,930,2096,930,2095,930,2094,931,2091,931,2087,930,2078,935,2074,936,2073,936,2073,940,2070,940,2064,940,2062,940,2060,940,2057,943,2055,944,2055,944,2054,946,2052,949,2051,951,2050,952,2049,954,2047,954,2041,953,2036,954,2032,954,2031,954,2030,956,2025,962,2024,965,2023,966,2020,966,2019,966,2017,966,2014,967,2012,967,2006,967,2001,967,1999,968,1998,969,1998,969,1997,973,1993,974,1989,974,1988,975,1988,976,1985,976,1982,976,1981,976,1980,977,1976,980,1973,981,1972,983,1971,983,1969,985,1968,987,1968,987,1965,987,1962,988,1959,989,1959,989,1958,990,1955,992,1954,993,1952,995,1952,999,1949,1002,1946,1003,1946,1003,1944,1005,1940,1006,1937,1007,1937,1007,1936,1011,1934,1017,1934,1021,1933,1026,1931,1029,1930,1031,1926,1031,1926,1032,1925,1034,1920,1040,1919,1041,1919,1042,1918,1048,1912,1058,1911,1061,1910,1062,1908,1063,1908,1063,1907,1063,1906,1065,1906,1067,1905,1068,1904,1072,1902,1074,1900,1078,1897,1083,1896,1089,1895,1095,1895,1101,1895,1105,1892,1106,1892,1107,1891,1108,1891,1109,1890,1109,1889,1110,1889,1112,1888,1113,1887,1113,1886,1114,1886,1119,1885,1124,1884,1125,1884,1126,1884,1130,1884,1135,1883,1147,1883,1152,1892,1153,1893,1153,1893,1157,1895,1163,1895,1172,1895,1182,1895,1201,1895,1219,1893,L,1219,1892,Q,1219,1886,1225,1885,1229,1884,1233,1882,1235,1881,1236,1880,1236,1879,1237,1879,1241,1873,1250,1874,1253,1874,1256,1875,1263,1875,1266,1871,1267,1868,1270,1866,1271,1865,1272,1865,1284,1865,1297,1864,1297,1864,1298,1863,1301,1860,1304,1857,1305,1856,1308,1856,1309,1856,1311,1856,1315,1855,1320,1855,1326,1855,1328,1850,1328,1849,1329,1848,1331,1845,1335,1845,1345,1846,1348,1837,1348,1836,1349,1836,1355,1832,1363,1833,1373,1835,1380,1828,1381,1827,1382,1827,1387,1826,1392,1826,1395,1825,1398,1825,1405,1825,1407,1820,1408,1819,1408,1818,1409,1815,1408,1812,1408,1810,1409,1809,1410,1807,1411,1805,1412,1803,1414,1801,1415,1801,1416,1801,1416,1800,1417,1799,1420,1798,1421,1795,1423,1790,1429,1790,1433,1789,1434,1786,1434,1785,1434,1785,1435,1780,1436,1775,1436,1773,1437,1771,1438,1769,1440,1768,1441,1767,1441,1766,1444,1763,1445,1759,1445,1758,1446,1757,1446,1756,1447,1756,1450,1753,1454,1751,1458,1748,1459,1744,1459,1743,1460,1742,1460,1741,1460,1740,1460,1736,1463,1733,1467,1730,1469,1726,1470,1726,1470,1725,1470,1721,1471,1718,1475,1713,1477,1708,1479,1704,1481,1700,1482,1700,1482,1699,1485,1697,1488,1694,1490,1691,1491,1688,1491,1686,1491,1684,1492,1682,1492,1681,1493,1679,1494,1676,1496,1670,1498,1667,1500,1664,1501,1660,1502,1659,1502,1658,1502,1656,1504,1655,L,1505,1654,Q,1506,1652,1508,1649,1510,1644,1511,1639,1511,1638,1511,1637,1514,1633,1517,1631,1522,1628,1524,1625,1525,1624,1525,1623,1526,1623,1526,1622,1527,1616,1530,1613,1531,1611,1531,1609,1531,1608,1532,1607,1535,1603,1538,1598,1539,1596,1540,1592,1540,1592,1540,1591,1540,1571,1540,1552,1540,1551,1541,1549,1541,1549,1541,1548,1541,1543,1540,1539,L,1540,1538,Q,1538,1537,1537,1536,1537,1535,1536,1534,1533,1531,1531,1528,1531,1527,1531,1526,1528,1519,1528,1511,1528,1511,1528,1510,1528,1509,1528,1509,1526,1503,1524,1499,1523,1497,1523,1496,1521,1487,1521,1478,1521,1459,1521,1439,1521,1419,1522,1400,1522,1396,1520,1394,1520,1393,1519,1392,1518,1390,1515,1389,1510,1388,1510,1383,1510,1382,1510,1381,1509,1380,1509,1378,1508,1371,1509,1363,1507,1362,1506,1360,1504,1356,1502,1353,1501,1350,1499,1350,1495,1347,1490,1342,1489,1341,1488,1340,1487,1339,1486,1338,1486,1337,1484,1337,1482,1336,1481,1335,1479,1331,1475,1328,1475,1327,1475,1327,1473,1324,1470,1324,1467,1325,1465,1323,1464,1323,1462,1323,1460,1323,1458,1322,1456,1321,1454,1318,1454,1318,1454,1317,1453,1313,1453,1308,1453,1307,1453,1306,1450,1301,1446,1297,1446,1296,1445,1295,1443,1290,1441,1285,1438,1280,1436,1276,1433,1272,1433,1268,1432,1266,1432,1265,1430,1262,1427,1260,1426,1259,1426,1258,1423,1253,1422,1248,1422,1247,1422,1245,1421,1243,1419,1241,1413,1235,1407,1231,1407,1230,1406,1230,1403,1229,1402,1227,1400,1224,1398,1221,1397,1220,1397,1219,1395,1214,1391,1211,1391,1210,1390,1210,1389,1208,1387,1206,1385,1201,1379,1198,1379,1198,1378,1198,1377,1197,1376,1197,1368,1190,1361,1185,1359,1184,1359,1183,1358,1182,1357,1181,1353,1177,1351,1172,1350,1172,1350,1171,1343,1164,1340,1157,1339,1153,1338,1149,1337,1148,1337,1148,1333,1140,1329,1131,1328,1130,1328,1129,1325,1122,1320,1113,1320,1112,1319,1111,1319,1108,1317,1105,1316,1100,1316,1095,1316,1094,1315,1094,1310,1088,1306,1077,1305,1075,1304,1072,1304,1071,1303,1070,1303,1069,1302,1068,1301,1067,1301,1065,1301,1064,1300,1064,1299,1063,1299,1062,1298,1060,1295,1059,1295,1058,1294,1058,1293,1057,1291,1057,1291,1057,1290,1057,1284,1056,1281,1051,1281,1051,1280,1051,1279,1050,1279,1050,1278,1047,1276,1046,1275,1045,1273,1044,1272,1043,1271,1042,1268,1039,1265,1035,1264,1034,1263,1032,1259,1028,1256,1026,1255,1025,1254,1024,1251,1022,1248,1018,1245,1014,1243,1013,1240,1011,1237,1010,1232,1009,1230,1004,1230,1004,1229,1003,1227,999,1225,995,1225,994,1225,993,1226,981,1218,975,1215,973,1212,971,1210,970,1209,968,1208,967,1208,967,1207,966,1206,965,1204,962,1201,960,1197,958,1195,954,1194,953,1193,952,1192,951,1192,948,1192,942,1192,936,1192,935,1192,935,1193,934,1193,933,1193,932,1193,930,1193,930,1193,929,1193,926,1194,922,1194,922,1195,921,1196,919,1197,916,1197,915,1197,914,1199,912,1200,910,1200,909,1201,908,1201,907,1202,906,1202,905,1203,904,1204,902,1205,901,1206,901,1206,900,1206,899,1207,899,1207,898,1208,897,1209,896,1210,895,1211,895,1211,894,1214,892,1218,891,1219,891,1219,891,1221,890,1223,890,1229,890,1232,887,1233,887,1234,886,1235,886,1235,885,1237,883,1240,882,1242,882,1243,882,1246,882,1248,880,1250,877,1254,875,1258,872,1262,871,1263,871,1264,871,1268,867,1273,866,1274,866,1275,866,1287,866,1293,861,1294,860,1294,860,1297,856,1302,854,1317,854,1333,854,1339,854,1344,853,1355,853,1363,856,1364,856,1364,857,1365,858,1367,859,1368,860,1369,860,1369,861,1370,861,1372,862,1373,862,1378,864,1381,867,1383,868,1384,869,1384,870,1385,871,1387,872,1389,873,1390,874,1391,874,1395,875,1399,874,1405,874,1408,876,1409,876,1409,877,1413,881,1421,883,1422,884,1422,884,1425,886,1430,886,1435,885,1437,888,1439,892,1444,894,1445,894,1446,895,1448,895,1449,896,1450,897,1451,897,1453,899,1454,902,1454,903,1456,904,1460,905,1465,905,1469,904,1471,906,1475,907,1478,911,1482,915,1487,916,1488,916,1489,916,1499,917,1509,917,1511,916,1512,918,1515,923,1518,925,1520,927,1521,927,1522,928,1523,928,1542,928,1562,927,1563,927,1564,927,1569,927,1573,926,1577,925,1581,925,1587,925,1591,922,1592,921,1593,920,1594,918,1597,918,1602,916,1608,917,1610,917,1611,916,1613,916,1616,915,1619,915,1622,915,1623,915,1624,914,1625,912,1628,911,1629,911,1629,910,1631,908,1634,908,1635,908,1636,908,1637,907,1638,906,1639,905,1640,905,1641,904,1642,904,1645,900,1651,899,1656,898,1658,893,1659,892,1659,891,1662,887,1666,885,1671,882,1674,879,1675,877,1677,876,1678,876,1678,876,1681,876,1682,874,1683,874,1684,874,1688,874,1690,872,1690,871,1691,870,1693,867,1698,865,1699,865,1699,864,1701,861,1705,859,1709,856,1713,852,1713,852,1713,851,1715,850,1716,847,1717,845,1718,844,1721,841,1723,838,1727,832,1736,827,1737,827,1737,827,1747,825,1755,819,1756,818,1757,817,1758,817,1760,816,1767,813,1774,807,1775,807,1776,806,1778,801,1783,798,1784,797,1784,796,1786,793,1788,791,1791,788,1792,783,1792,778,1793,775,1793,773,1795,771,1796,771,1796,770,1797,769,1797,768,1799,763,1803,761,1805,761,1807,759,1808,759,1809,758,1810,758,1810,757,1811,753,1811,749,1811,744,1807,740,1804,737,1803,734,1802,733,1802,732,1802,717,1802,702,1802,699,1801,697,1800,690,1797,686,1796,684,1795,683,1795,683,1795,682,1794,681,1794,681,1790,676,1790,671,1790,668,1790,665,1789,662,1788,661,1786,659,1784,656,1781,652,1781,644,1781,642,1781,640,1781,637,1781,633,1781,632,1781,631,1779,628,1779,624,1779,623,1779,622,1779,619,1778,617,1777,616,1776,615,1776,614,1775,613,1774,613,1774,612,1772,601,1773,588,1773,587,1772,586,1771,581,1770,576,1770,575,1769,574,1769,572,1767,570,1765,567,1762,564,1762,564,1762,563,1762,554,1761,545,1761,545,1760,544,1760,543,1760,542,1759,540,1758,540,1756,539,1756,538,1754,532,1754,526,1754,525,1753,524,1753,523,1752,522,1750,519,1749,515,1749,515,1749,514,1748,508,1747,503,Q,1746,499,1743,497,Z]],label:"Sonaco",shortLabel:"SN",labelPosition:[92.6,149.3],labelAlignment:[CEN,MID],nextId:"GW.GA.PD"},"GW.GA.PD":{outlines:[[M,2777,38,Q,2757,38,2737,38,2718,38,2699,38,2679,38,2659,38,2657,38,2655,38,2649,37,2648,42,2648,43,2648,43,2641,45,2634,44,2627,44,2623,48,2622,50,2619,50,2599,50,2579,50,2559,50,2540,50,2520,50,2501,50,2488,50,2474,50,2463,51,2452,49,2451,49,2451,48,2448,46,2447,43,2446,42,2446,41,2445,41,2444,39,2437,37,2430,39,2417,39,2404,39,2385,39,2365,40,2365,40,2364,40,2344,40,2325,40,2305,40,2285,40,2265,40,2246,40,2245,40,2245,41,2240,46,2234,46,2232,46,2230,47,2227,47,2225,51,2224,52,2224,53,2222,55,2217,55,2211,55,2207,51,2206,50,2206,49,2206,46,2204,45,2200,41,2196,40,2195,40,2193,40,2187,39,2180,39,2160,39,2140,39,2120,39,2101,39,2082,39,2063,39,2043,39,2023,39,2003,39,1984,39,1965,39,1945,39,1926,39,1906,39,1886,39,1867,39,1847,39,1828,39,1809,39,1790,39,1772,39,1753,40,1752,40,1751,40,1747,40,1743,40,1723,40,1703,40,1684,40,1665,40,1645,40,1625,40,1605,40,1586,40,1566,40,1546,40,1545,40,1543,40,1540,38,1534,38,1524,37,1515,38,1513,38,1512,41,1512,43,1511,45,1511,48,1511,51,1511,52,1510,52,1506,54,1500,54,1480,54,1460,54,1440,54,1421,54,1401,54,1381,54,1362,54,1342,54,1341,54,1340,53,1340,52,1339,50,1339,50,1339,49,1338,43,1331,44,1328,45,1327,43,1326,42,1326,41,1325,40,1324,38,1324,36,1323,36,1316,34,1306,34,1288,35,1268,34,1260,34,1254,36,1253,36,1253,36,1252,39,1252,42,1252,47,1253,52,1253,55,1251,55,1247,54,1243,54,1243,57,1243,60,1243,65,1243,70,1243,81,1236,88,1235,89,1234,90,1234,91,1233,92,1232,94,1231,97,1231,99,1230,101,1230,103,1230,105,1230,106,1229,107,1229,108,1228,108,1228,109,1227,109,1225,112,1224,116,1224,117,1223,117,1222,118,1223,122,1223,126,1223,129,1222,134,1220,137,1220,138,1219,138,1218,139,1217,140,1215,142,1213,143,1209,147,1210,153,1211,159,1208,165,1207,166,1206,168,1202,171,1202,178,1203,182,1201,186,1200,189,1196,191,1195,193,1193,194,1192,195,1192,197,1191,203,1192,208,1192,213,1190,216,1190,217,1189,218,1186,221,1184,225,1184,226,1183,226,1183,230,1183,234,1183,239,1183,243,1183,244,1184,244,1185,246,1187,248,1188,249,1189,249,1191,250,1191,252,1192,253,1192,253,1195,256,1194,261,1194,262,1194,262,1195,262,1195,264,1195,266,1196,267,1198,270,1201,272,L,1202,273,Q,1204,284,1204,295,1213,296,1222,294,1223,294,1223,293,1224,292,1225,290,1227,285,1231,284,1234,283,1237,283,1240,284,1240,286,1240,289,1241,290,1242,294,1242,299,1242,302,1242,306,1242,307,1243,308,1243,309,1243,309,1245,314,1251,313,1254,313,1256,313,1275,313,1293,312,1294,312,1296,311,1297,309,1298,307,1298,306,1299,305,1300,304,1303,304,1309,304,1314,304,1330,304,1346,304,1348,304,1348,302,1347,299,1350,296,1350,296,1351,296,1355,295,1359,296,1360,296,1360,296,1362,299,1363,303,1364,308,1368,311,1369,312,1369,313,1370,317,1370,322,1369,326,1371,327,1373,327,1374,328,1375,329,1376,330,1379,331,1380,333,1381,334,1381,335,1380,347,1382,359,1383,363,1386,366,1387,367,1388,368,1389,370,1390,371,1391,372,1391,373,1392,377,1394,382,1396,387,1401,389,1401,389,1401,390,1402,394,1405,398,1407,402,1413,402,1421,402,1425,407,1427,410,1428,411,1432,413,1437,412,1439,412,1439,409,1439,408,1440,406,1443,401,1450,403,1452,403,1453,402,1454,401,1455,401,1464,401,1474,401,1475,401,1476,400,1478,399,1480,398,1481,397,1481,396,1483,391,1487,390,1488,390,1489,390,1492,390,1494,389,1499,388,1504,387,1506,387,1506,383,1506,382,1507,381,1508,378,1509,375,1511,372,1511,369,1511,349,1511,330,1511,328,1512,328,1513,328,1513,327,1515,325,1518,324,1519,324,1519,324,1522,324,1525,324,1531,323,1532,327,1532,328,1532,329,1533,331,1533,334,1534,339,1538,342,1541,343,1542,346,1543,350,1544,354,1544,356,1545,358,1547,362,1550,365,1552,366,1552,368,1552,368,1552,369,1553,371,1553,373,1553,377,1556,378,1561,381,1562,386,1566,394,1570,401,1570,402,1571,402,1573,406,1578,408,1579,408,1579,408,1585,408,1590,409,1591,410,1591,411,1593,412,1593,414,1593,415,1594,416,1596,418,1598,421,1600,424,1605,424,1608,425,1612,425,1617,425,1621,426,1626,427,1628,432,1632,434,1634,435,1634,436,1635,436,1649,436,1662,435,L,1662,434,Q,1662,433,1663,431,1664,427,1669,427,1677,427,1683,426,1684,426,1684,425,1687,421,1689,418,1690,417,1692,415,1692,415,1693,415,1698,414,1703,414,1704,414,1705,413,1710,409,1716,413,1719,416,1723,419,1724,419,1724,420,1725,427,1722,430,1721,432,1720,432,1718,433,1717,434,1716,435,1714,435,1712,435,1713,437,1713,440,1713,442,1713,454,1714,466,1715,470,1718,472,1720,474,1721,475,1721,476,1722,476,1723,476,1724,478,1725,479,1726,479,1727,479,1728,479,1729,480,1729,482,1729,486,1732,489,1733,490,1734,492,1735,493,1736,493,1740,494,1743,497,1746,499,1747,503,1748,508,1749,514,1749,515,1749,515,1750,519,1752,522,1753,523,1753,524,1754,525,1754,526,1754,532,1756,538,1756,539,1758,540,1759,540,1760,542,1760,543,1760,544,1761,545,1761,545,1762,554,1762,563,1762,564,1762,564,1765,567,1767,570,1769,572,1769,574,1770,575,1770,576,1771,581,1772,586,1773,587,1773,588,1772,601,1774,612,1774,613,1775,613,1776,614,1776,615,1777,616,1778,617,1779,619,1779,622,1779,623,1779,624,1779,628,1781,631,1781,632,1781,633,1781,637,1781,640,1781,642,1781,644,1781,652,1784,656,1786,659,1788,661,1789,662,1790,665,1790,668,1790,671,1790,676,1794,681,1794,681,1795,682,1795,683,1795,683,1796,684,1797,686,1800,690,1801,697,1802,699,1802,702,1802,717,1802,732,1802,733,1803,734,1804,737,1807,740,1811,744,1811,749,1811,753,1810,757,1810,758,1809,758,1808,759,1807,759,1805,761,1803,761,1799,763,1797,768,1797,769,1796,770,1796,771,1795,771,1793,773,1793,775,1792,778,1792,783,1791,788,1788,791,1786,793,1784,796,1784,797,1783,798,1778,801,1776,806,1775,807,1774,807,1767,813,1760,816,1758,817,1757,817,1756,818,1755,819,1747,825,1737,827,1737,827,1736,827,1727,832,1723,838,1721,841,1718,844,1717,845,1716,847,1715,850,1713,851,1713,852,1713,852,1709,856,1705,859,1701,861,1699,864,1699,865,1698,865,1693,867,1691,870,1690,871,1690,872,1688,874,1684,874,1683,874,1682,874,1681,876,1678,876,1678,876,1677,876,1675,877,1674,879,1671,882,1666,885,1662,887,1659,891,1659,892,1658,893,1656,898,1651,899,1645,900,1642,904,1641,904,1640,905,1639,905,1638,906,1637,907,1636,908,1635,908,1634,908,1631,908,1629,910,1629,911,1628,911,1625,912,1624,914,1623,915,1622,915,1619,915,1616,915,1613,916,1611,916,1610,917,1608,917,1602,916,1597,918,1594,918,1593,920,1592,921,1591,922,1587,925,1581,925,1577,925,1573,926,1569,927,1564,927,1563,927,1562,927,1542,928,1523,928,1522,928,1521,927,1520,927,1518,925,1515,923,1512,918,1511,916,1509,917,1499,917,1489,916,1488,916,1487,916,1482,915,1478,911,1475,907,1471,906,1469,904,1465,905,1460,905,1456,904,1454,903,1454,902,1453,899,1451,897,1450,897,1449,896,1448,895,1446,895,1445,894,1444,894,1439,892,1437,888,1435,885,1430,886,1425,886,1422,884,1422,884,1421,883,1413,881,1409,877,1409,876,1408,876,1405,874,1399,874,1395,875,1391,874,1390,874,1389,873,1387,872,1385,871,1384,870,1384,869,1383,868,1381,867,1378,864,1373,862,1372,862,1370,861,1369,861,1369,860,1368,860,1367,859,1365,858,1364,857,1364,856,1363,856,1355,853,1344,853,1339,854,1333,854,1317,854,1302,854,1297,856,1294,860,1294,860,1293,861,1287,866,1275,866,1274,866,1273,866,1268,867,1264,871,1263,871,1262,871,1258,872,1254,875,1250,877,1248,880,1246,882,1243,882,1242,882,1240,882,1237,883,1235,885,1235,886,1234,886,1233,887,1232,887,1229,890,1223,890,1221,890,1219,891,1219,891,1218,891,1214,892,1211,894,1211,895,1210,895,1209,896,1208,897,1207,898,1207,899,1206,899,1206,900,1206,901,1205,901,1204,902,1203,904,1202,905,1202,906,1201,907,1201,908,1200,909,1200,910,1199,912,1197,914,1197,915,1197,916,1196,919,1195,921,1194,922,1194,922,1193,926,1193,929,1193,930,1193,930,1193,932,1193,933,1193,934,1192,935,1192,935,1192,936,1192,942,1192,948,1192,951,1193,952,1194,953,1195,954,1197,958,1201,960,1204,962,1206,965,1207,966,1208,967,1208,967,1209,968,1210,970,1212,971,1215,973,1218,975,1226,981,1225,993,1225,994,1225,995,1227,999,1229,1003,1230,1004,1230,1004,1232,1009,1237,1010,1240,1011,1243,1013,1245,1014,1248,1018,1251,1022,1254,1024,1255,1025,1256,1026,1259,1028,1263,1032,1264,1034,1265,1035,1268,1039,1271,1042,1272,1043,1273,1044,1275,1045,1276,1046,1278,1047,1279,1050,1279,1050,1280,1051,1281,1051,1281,1051,1284,1056,1290,1057,1291,1057,1291,1057,1293,1057,1294,1058,1295,1058,1295,1059,1298,1060,1299,1062,1299,1063,1300,1064,1301,1064,1301,1065,1301,1067,1302,1068,1303,1069,1303,1070,1304,1071,1304,1072,1305,1075,1306,1077,1310,1088,1315,1094,1316,1094,1316,1095,1316,1100,1317,1105,1319,1108,1319,1111,1320,1112,1320,1113,1325,1122,1328,1129,1328,1130,1329,1131,1333,1140,1337,1148,1337,1148,1338,1149,1339,1153,1340,1157,1343,1164,1350,1171,1350,1172,1351,1172,1353,1177,1357,1181,1358,1182,1359,1183,1359,1184,1361,1185,1368,1190,1376,1197,1377,1197,1378,1198,1379,1198,1379,1198,1385,1201,1387,1206,1389,1208,1390,1210,1391,1210,1391,1211,1395,1214,1397,1219,1397,1220,1398,1221,1400,1224,1402,1227,1403,1229,1406,1230,1407,1230,1407,1231,1413,1235,1419,1241,1421,1243,1422,1245,1422,1247,1422,1248,1423,1253,1426,1258,1426,1259,1427,1260,1430,1262,1432,1265,1432,1266,1433,1268,1433,1272,1436,1276,1438,1280,1441,1285,1443,1290,1445,1295,1446,1296,1446,1297,1450,1301,1453,1306,1453,1307,1453,1308,1453,1313,1454,1317,1454,1318,1454,1318,1456,1321,1458,1322,1460,1323,1462,1323,1464,1323,1465,1323,1467,1325,1470,1324,1473,1324,1475,1327,1475,1327,1475,1328,1479,1331,1481,1335,1482,1336,1484,1337,1486,1337,1486,1338,1487,1339,1488,1340,1489,1341,1490,1342,1495,1347,1499,1350,1501,1350,1502,1353,1504,1356,1506,1360,1507,1362,1509,1363,1510,1364,1512,1364,1514,1364,1515,1364,1519,1365,1523,1363,1526,1361,1529,1361,1531,1360,1532,1360,1533,1359,1535,1358,1536,1358,1537,1358,1542,1357,1546,1355,1548,1355,1549,1353,1550,1350,1553,1347,1555,1345,1559,1345,1561,1345,1564,1344,1565,1344,1566,1344,1566,1343,1567,1343,1572,1341,1575,1338,1576,1337,1577,1336,1582,1332,1593,1332,1597,1333,1602,1333,1608,1337,1609,1342,1609,1343,1610,1343,1615,1347,1622,1347,1623,1347,1624,1348,1628,1353,1635,1355,1637,1355,1639,1356,1643,1359,1648,1363,1648,1364,1650,1364,1653,1365,1658,1365,1664,1365,1665,1360,1665,1357,1666,1356,1667,1355,1668,1355,1669,1354,1669,1354,1689,1353,1709,1354,1728,1354,1748,1354,1762,1354,1775,1353,1778,1353,1779,1351,1780,1346,1783,1342,1783,1341,1785,1341,1786,1341,1786,1340,1788,1339,1790,1339,1791,1338,1792,1336,1792,1335,1793,1335,1794,1334,1797,1333,1802,1332,1806,1330,1807,1329,1807,1329,1810,1324,1813,1322,1814,1322,1815,1322,1834,1322,1854,1322,1869,1322,1883,1321,1884,1321,1885,1321,1886,1321,1887,1320,1889,1317,1892,1316,1893,1316,1894,1315,1898,1314,1904,1314,1912,1314,1920,1313,1921,1313,1921,1312,1923,1311,1925,1308,1926,1307,1927,1305,1929,1303,1931,1303,1933,1303,1934,1303,1939,1303,1943,1303,1948,1303,1951,1302,1953,1301,1955,1300,1957,1300,1959,1297,1960,1297,1961,1297,1971,1294,1981,1295,1991,1295,2e3,1295,2005,1295,2007,1299,2007,1300,2008,1300,2009,1302,2013,1303,2014,1303,2015,1304,2017,1305,2021,1305,2024,1305,2027,1307,2029,1308,2031,1309,2032,1309,2032,1310,2033,1314,2034,1318,2034,1323,2037,1326,2040,1330,2043,1333,2043,1333,2043,1334,2044,1338,2044,1342,2044,1343,2045,1343,2046,1344,2047,1347,2048,1350,2049,1351,2051,1355,2051,1359,2051,1360,2051,1360,2051,1363,2053,1364,2053,1365,2054,1366,2054,1367,2055,1368,2056,1368,2057,1369,2063,1375,2071,1382,2071,1382,2071,1383,2075,1387,2075,1394,2075,1395,2076,1396,2079,1400,2082,1405,2083,1406,2084,1406,2085,1406,2085,1406,2088,1407,2090,1407,2091,1407,2092,1407,2094,1408,2094,1409,2095,1410,2097,1411,2100,1414,2104,1415,2105,1415,2105,1415,2108,1417,2112,1418,2113,1421,2114,1423,2115,1424,2116,1425,2118,1425,2119,1425,2138,1425,2158,1425,2178,1425,2198,1425,2215,1425,2232,1424,2233,1424,2233,1423,2235,1413,2247,1414,2252,1415,2257,1415,2261,1414,2262,1410,2263,1410,2263,1409,2264,1406,2267,1406,2268,1406,2269,1405,2272,1403,2277,1404,2280,1404,2281,1402,2281,1402,2282,1401,2285,1392,2295,1392,2300,1392,2306,1391,2308,1391,2309,1390,2310,1388,2311,1386,2315,1382,2320,1383,2321,1383,2322,1382,2325,1379,2326,1375,2326,1375,2327,1374,2332,1372,2339,1373,2341,1373,2343,1373,2348,1374,2350,1379,2350,1380,2351,1380,2354,1385,2358,1386,2359,1386,2361,1387,2364,1387,2368,1389,2370,1390,2371,1391,2376,1395,2380,1400,2381,1401,2382,1402,2386,1405,2389,1408,2389,1409,2390,1410,2392,1413,2392,1418,2392,1423,2394,1425,2395,1426,2396,1427,2400,1433,2407,1438,2408,1439,2408,1442,2408,1444,2409,1446,2409,1447,2410,1448,2411,1452,2412,1455,2412,1456,2412,1457,2413,1457,2413,1458,2415,1461,2419,1463,2420,1464,2422,1465,2426,1467,2429,1471,2430,1472,2431,1473,2431,1473,2432,1474,2433,1476,2435,1479,2436,1481,2438,1483,2438,1484,2440,1484,2441,1484,2442,1485,2445,1487,2447,1490,2450,1494,2452,1499,2453,1499,2453,1500,2460,1508,2471,1507,2473,1507,2474,1508,2478,1509,2482,1512,2484,1514,2486,1517,2487,1518,2488,1518,2493,1519,2499,1520,2502,1520,2503,1523,2507,1527,2511,1528,2516,1530,2520,1532,2524,1534,2529,1536,2530,1536,2533,1538,2540,1542,2550,1542,2554,1542,2559,1542,2578,1542,2597,1542,2607,1542,2616,1541,2617,1541,2617,1540,2618,1538,2620,1537,2621,1537,2621,1536,2622,1534,2624,1533,2624,1533,2625,1532,2627,1529,2632,1529,2635,1529,2637,1528,2639,1527,2642,1526,2644,1525,2645,1524,2649,1521,2653,1520,2657,1519,2660,1519,2661,1519,2662,1518,2663,1518,2664,1518,2665,1517,2666,1516,2669,1514,2670,1509,2671,1506,2672,1505,2675,1501,2679,1499,2682,1498,2685,1496,2689,1492,2690,1485,2690,1485,2690,1484,2691,1481,2694,1479,2696,1477,2699,1476,2708,1472,2712,1464,2713,1462,2715,1460,2718,1457,2723,1457,2727,1456,2729,1455,2730,1454,2731,1454,2735,1453,2738,1451,2742,1447,2745,1444,2749,1440,2752,1438,2753,1438,2755,1437,2762,1429,2761,1418,2761,1412,2762,1405,2762,1405,2763,1404,2768,1400,2768,1392,2768,1386,2771,1379,2770,1375,2773,1373,2773,1373,2774,1372,2776,1371,2776,1369,2778,1366,2779,1361,2779,1360,2779,1359,2782,1355,2783,1352,2784,1351,2784,1350,2786,1347,2787,1342,2787,1340,2788,1339,2790,1336,2792,1332,2793,1330,2794,1328,2795,1326,2796,1323,2799,1318,2800,1313,2800,1312,2800,1310,2802,1301,2802,1291,2801,1271,2801,1252,2801,1247,2800,1242,2800,1242,2799,1241,2794,1238,2793,1229,2793,1229,2793,1228,2791,1222,2792,1216,2792,1211,2791,1207,2791,1203,2791,1198,2790,1189,2785,1182,2785,1181,2784,1180,2780,1180,2778,1177,2777,1176,2775,1174,2774,1172,2773,1170,2773,1169,2772,1168,2768,1167,2765,1164,2762,1162,2761,1158,2760,1157,2759,1155,2759,1154,2759,1153,2760,1145,2756,1140,2755,1140,2755,1138,2754,1138,2754,1137,2752,1134,2752,1130,2753,1129,2752,1128,2752,1116,2751,1105,2751,1104,2751,1103,2748,1100,2743,1098,2743,1097,2743,1095,2743,1093,2742,1092,2740,1089,2740,1086,2740,1082,2740,1078,2740,1067,2740,1056,2740,1039,2741,1022,2741,1017,2743,1015,2744,1014,2745,1014,2747,1011,2749,1009,2752,1005,2752,999,2752,997,2752,995,2752,985,2752,976,2753,972,2753,967,2753,967,2754,966,2759,963,2761,957,2762,956,2762,954,2762,947,2763,940,2765,938,2766,937,2767,936,2767,935,2768,934,2768,932,2768,927,2771,925,2773,925,2774,925,2778,924,2781,921,2782,921,2782,921,2787,913,2797,915,2800,915,2804,915,2809,916,2813,914,2815,914,2815,913,2816,912,2817,911,2817,911,2817,910,2819,905,2822,903,2823,903,2824,903,2838,902,2852,904,2853,904,2854,904,2857,904,2860,905,2863,905,2866,906,2868,906,2870,906,2889,906,2909,906,2918,906,2926,907,2927,907,2927,907,2932,908,2936,911,2940,914,2946,914,2958,914,2969,914,2971,914,2972,915,2975,917,2977,920,2977,920,2977,921,2981,923,2986,924,2988,925,2990,925,2993,925,2994,927,2995,929,2996,929,2997,930,2997,930,2998,933,3e3,934,3002,936,3005,936,3010,936,3015,936,3016,936,3017,935,3019,934,3020,933,3022,930,3023,927,3030,925,3037,924,3039,923,3040,923,3044,921,3046,917,3047,916,3048,916,3055,914,3063,914,3078,914,3093,916,3094,916,3095,917,3099,920,3103,921,3112,922,3121,921,3130,921,3140,922,3145,922,3148,926,3152,929,3155,934,3157,937,3161,937,3166,938,3170,938,3181,938,3192,937,3192,937,3192,936,3194,932,3196,928,3197,927,3199,927,3203,927,3207,926,3210,925,3212,924,3213,923,3213,921,3213,916,3218,915,3221,914,3225,913,3230,913,3235,910,3238,908,3239,905,3239,904,3240,903,3241,903,3242,902,3244,900,3247,898,3248,898,3249,896,3251,892,3253,890,3253,890,3254,889,3257,887,3259,882,3260,880,3261,878,3261,877,3261,876,3262,872,3264,870,3268,868,3271,866,3272,865,3273,863,3274,863,3274,862,3275,859,3276,856,3278,852,3280,850,3281,849,3282,849,3289,844,3296,841,3297,840,3297,838,3298,837,3298,836,3304,828,3316,828,3318,828,3320,827,3321,826,3321,824,3323,823,3324,822,3326,820,3329,820,3331,820,3332,820,3333,819,3335,819,3340,818,3345,816,3351,813,3359,807,3360,805,3361,803,3361,802,3362,801,3363,795,3365,789,3366,784,3369,781,3369,780,3371,779,3374,775,3375,769,3375,768,3375,767,3375,762,3379,760,3383,758,3384,755,3387,752,3389,746,3389,745,3389,744,3390,743,3390,742,3392,738,3398,736,3409,733,3408,722,3408,721,3408,720,3409,716,3411,712,3412,710,3412,708,3412,704,3414,703,3418,700,3420,694,3421,692,3422,691,3423,689,3425,687,3426,686,3427,686,3427,685,3428,685,3436,681,3436,672,3436,669,3436,666,3437,663,3437,660,3437,656,3440,655,3447,650,3451,641,3452,640,3452,638,3453,633,3457,629,3459,627,3463,626,3464,626,3464,625,3467,621,3467,616,3467,615,3467,615,3468,612,3468,609,3468,608,3469,606,3469,606,3470,605,3471,605,3472,604,3474,602,3476,600,3479,598,3479,594,3479,591,3480,587,3480,587,3481,586,3483,584,3485,583,3486,581,3489,580,3492,578,3493,574,3493,573,3494,572,3495,571,3495,570,3496,570,3496,569,3497,568,3497,567,3497,564,3499,561,3501,558,3502,557,3503,556,3503,556,3504,555,3505,553,3507,549,3510,545,3511,542,3513,540,3515,536,3519,535,3519,535,3520,535,3523,532,3526,530,3527,529,3527,528,3527,527,3527,527,3528,525,3529,523,3530,522,3531,520,3531,518,3532,516,3534,512,3538,508,3541,506,3544,505,3545,504,3546,503,3551,499,3552,495,3553,491,3555,488,3559,484,3563,482,3564,481,3565,480,3566,479,3567,478,3568,478,3569,477,3572,472,3572,467,3572,457,3578,452,3581,450,3585,446,3586,446,3587,445,3591,443,3595,443,3598,442,3601,442,3606,443,3608,440,3610,438,3612,437,3613,436,3613,436,3616,436,3617,435,3618,435,3619,434,3623,433,3628,433,3638,434,3647,434,3656,434,3664,433,3665,433,3665,432,3666,430,3668,428,3671,424,3675,425,3678,425,3681,425,3687,425,3693,425,3694,425,3694,425,3697,424,3700,423,3701,423,3702,422,3704,420,3705,418,3709,411,3719,412,3723,412,3727,412,3736,412,3745,411,3745,411,3746,411,3749,405,3760,405,3761,405,3763,405,3772,404,3779,397,3780,395,3782,395,3783,394,3784,394,3789,394,3793,391,3794,391,3795,390,3796,390,3797,389,3797,388,3798,387,3805,382,3811,374,3812,374,3812,372,3812,372,3813,371,3816,367,3821,365,3823,365,3826,364,3827,363,3829,363,3835,362,3839,358,3839,358,3840,357,3841,355,3841,352,3841,352,3841,351,3842,348,3842,346,3844,341,3848,337,3848,337,3848,336,3849,326,3855,320,3857,317,3858,313,3858,312,3859,311,3859,311,3859,310,3861,304,3865,299,3867,298,3868,296,L,3868,295,Q,3871,291,3873,289,3875,287,3875,283,3874,275,3875,268,3875,267,3875,265,3877,260,3881,258,3883,256,3884,255,3887,253,3888,249,3889,244,3891,239,3891,238,3893,237,3894,237,3894,236,3895,236,3896,235,3898,230,3899,226,3900,220,3905,216,3906,215,3907,214,3912,209,3914,204,3915,203,3915,202,3915,200,3916,197,3916,196,3917,195,3917,194,3917,194,3917,185,3917,176,3917,170,3920,167,3924,162,3927,157,3927,156,3927,154,3927,138,3928,122,3928,122,3928,121,3928,116,3931,111,3934,107,3934,101,3933,94,3934,87,3934,87,3934,86,3934,83,3935,82,3936,81,3936,80,3938,75,3941,72,3941,72,3941,71,3942,69,3942,67,3944,59,3944,49,3943,49,3942,49,3922,49,3902,49,3883,49,3864,49,3844,49,3824,49,3804,49,3785,49,3765,49,3745,49,3725,49,3706,49,3686,49,3667,49,3648,49,3629,49,3609,49,3590,49,3588,49,3587,49,3582,49,3581,48,3574,48,3567,48,3548,48,3529,48,3509,48,3490,48,3470,48,3450,48,3430,48,3411,48,3391,48,3371,48,3351,48,3332,48,3312,48,3292,48,3272,48,3253,48,3233,48,3213,48,3194,48,3175,48,3164,48,3155,50,3154,50,3152,50,3134,51,3115,51,3110,51,3108,47,3107,46,3106,45,3105,40,3102,39,3101,39,3099,39,3094,38,3089,37,3088,37,3088,37,3085,37,3082,37,3062,37,3042,37,3024,37,3005,38,3004,38,3003,38,2988,38,2974,38,2954,38,2935,38,2915,38,2895,38,2875,38,2856,38,2836,38,2816,38,Q,2796,38,2777,38,Z]],label:"Pirada",shortLabel:"PD",labelPosition:[243.9,47.8],labelAlignment:[CEN,MID],nextId:"GW.GA.PT"},"GW.GA.PT":{outlines:[[M,4049,41,Q,4029,41,4010,41,4005,41,4e3,43,3998,44,3999,47,3999,49,3998,49,3989,49,3981,49,3962,49,3944,49,3944,59,3942,67,3942,69,3941,71,3941,72,3941,72,3938,75,3936,80,3936,81,3935,82,3934,83,3934,86,3934,87,3934,87,3933,94,3934,101,3934,107,3931,111,3928,116,3928,121,3928,122,3928,122,3927,138,3927,154,3927,156,3927,157,3924,162,3920,167,3917,170,3917,176,3917,185,3917,194,3917,194,3917,195,3916,196,3916,197,3915,200,3915,202,3915,203,3914,204,3912,209,3907,214,3906,215,3905,216,3900,220,3899,226,3898,230,3896,235,3895,236,3894,236,3894,237,3893,237,3891,238,3891,239,3889,244,3888,249,3887,253,3884,255,3883,256,3881,258,3877,260,3875,265,3875,267,3875,268,3874,275,3875,283,3875,287,3873,289,3871,291,3868,295,L,3868,296,Q,3867,298,3865,299,3861,304,3859,310,3859,311,3859,311,3858,312,3858,313,3857,317,3855,320,3849,326,3848,336,3848,337,3848,337,3844,341,3842,346,3842,348,3841,351,3841,352,3841,352,3841,355,3840,357,3839,358,3839,358,3835,362,3829,363,3827,363,3826,364,3823,365,3821,365,3816,367,3813,371,3812,372,3812,372,3812,374,3811,374,3805,382,3798,387,3797,388,3797,389,3796,390,3795,390,3794,391,3793,391,3789,394,3784,394,3783,394,3782,395,3780,395,3779,397,3772,404,3763,405,3761,405,3760,405,3749,405,3746,411,3745,411,3745,411,3736,412,3727,412,3723,412,3719,412,3709,411,3705,418,3704,420,3702,422,3701,423,3700,423,3697,424,3694,425,3694,425,3693,425,3687,425,3681,425,3678,425,3675,425,3671,424,3668,428,3666,430,3665,432,3665,433,3664,433,3656,434,3647,434,3638,434,3628,433,3623,433,3619,434,3618,435,3617,435,3616,436,3613,436,3613,436,3612,437,3610,438,3608,440,3606,443,3601,442,3598,442,3595,443,3591,443,3587,445,3586,446,3585,446,3581,450,3578,452,3572,457,3572,467,3572,472,3569,477,3568,478,3567,478,3566,479,3565,480,3564,481,3563,482,3559,484,3555,488,3553,491,3552,495,3551,499,3546,503,3545,504,3544,505,3541,506,3538,508,3534,512,3532,516,3531,518,3531,520,3530,522,3529,523,3528,525,3527,527,3527,527,3527,528,3527,529,3526,530,3523,532,3520,535,3519,535,3519,535,3515,536,3513,540,3511,542,3510,545,3507,549,3505,553,3504,555,3503,556,3503,556,3502,557,3501,558,3499,561,3497,564,3497,567,3497,568,3496,569,3496,570,3495,570,3495,571,3494,572,3493,573,3493,574,3492,578,3489,580,3486,581,3485,583,3483,584,3481,586,3480,587,3480,587,3479,591,3479,594,3479,598,3476,600,3474,602,3472,604,3471,605,3470,605,3469,606,3469,606,3468,608,3468,609,3468,612,3467,615,3467,615,3467,616,3467,621,3464,625,3464,626,3463,626,3459,627,3457,629,3453,633,3452,638,3452,640,3451,641,3447,650,3440,655,3437,656,3437,660,3437,663,3436,666,3436,669,3436,672,3436,681,3428,685,3427,685,3427,686,3426,686,3425,687,3423,689,3422,691,3421,692,3420,694,3418,700,3414,703,3412,704,3412,708,3412,710,3411,712,3409,716,3408,720,3408,721,3408,722,3409,733,3398,736,3392,738,3390,742,3390,743,3389,744,3389,745,3389,746,3387,752,3384,755,3383,758,3379,760,3375,762,3375,767,3375,768,3375,769,3374,775,3371,779,3369,780,3369,781,3366,784,3365,789,3363,795,3362,801,3361,802,3361,803,3360,805,3359,807,3351,813,3345,816,3340,818,3335,819,3333,819,3332,820,3331,820,3329,820,3326,820,3324,822,3323,823,3321,824,3321,826,3320,827,3318,828,3316,828,3304,828,3298,836,3298,837,3297,838,3297,840,3296,841,3289,844,3282,849,3281,849,3280,850,3278,852,3276,856,3275,859,3274,862,3274,863,3273,863,3272,865,3271,866,3268,868,3264,870,3262,872,3261,876,3261,877,3261,878,3260,880,3259,882,3257,887,3254,889,3253,890,3253,890,3251,892,3249,896,3248,898,3247,898,3244,900,3242,902,3241,903,3240,903,3239,904,3239,905,3238,908,3235,910,3230,913,3225,913,3221,914,3218,915,3213,916,3213,921,3213,923,3212,924,3210,925,3207,926,3203,927,3199,927,3197,927,3196,928,3194,932,3192,936,3192,937,3192,937,3181,938,3170,938,3166,938,3161,937,3157,937,3155,934,3152,929,3148,926,3145,922,3140,922,3130,921,3121,921,3112,922,3103,921,3099,920,3095,917,3094,916,3093,916,3078,914,3063,914,3055,914,3048,916,3047,916,3046,917,3044,921,3040,923,3039,923,3037,924,3030,925,3023,927,3022,930,3020,933,3019,934,3017,935,3016,936,3015,936,3010,936,3005,936,3002,936,3e3,934,2998,933,2997,930,2997,930,2996,929,2995,929,2994,927,2993,925,2990,925,2988,925,2986,924,2981,923,2977,921,2977,920,2977,920,2975,917,2972,915,2971,914,2969,914,2958,914,2946,914,2940,914,2936,911,2932,908,2927,907,2927,907,2926,907,2918,906,2909,906,2889,906,2870,906,2868,906,2866,906,2863,905,2860,905,2857,904,2854,904,2853,904,2852,904,2838,902,2824,903,2823,903,2822,903,2819,905,2817,910,2817,911,2817,911,2816,912,2815,913,2815,914,2813,914,2809,916,2804,915,2800,915,2797,915,2787,913,2782,921,2782,921,2781,921,2778,924,2774,925,2773,925,2771,925,2768,927,2768,932,2768,934,2767,935,2767,936,2766,937,2765,938,2763,940,2762,947,2762,954,2762,956,2761,957,2759,963,2754,966,2753,967,2753,967,2753,972,2752,976,2752,985,2752,995,2752,997,2752,999,2752,1005,2749,1009,2747,1011,2745,1014,2744,1014,2743,1015,2741,1017,2741,1022,2740,1039,2740,1056,2740,1067,2740,1078,2740,1082,2740,1086,2740,1089,2742,1092,2743,1093,2743,1095,2743,1097,2743,1098,2748,1100,2751,1103,2751,1104,2751,1105,2752,1116,2752,1128,2753,1129,2752,1130,2752,1134,2754,1137,2754,1138,2755,1138,2755,1140,2756,1140,2760,1145,2759,1153,2759,1154,2759,1155,2760,1157,2761,1158,2762,1162,2765,1164,2768,1167,2772,1168,2773,1169,2773,1170,2774,1172,2775,1174,2777,1176,2778,1177,2780,1180,2784,1180,2785,1181,2785,1182,2790,1189,2791,1198,2791,1203,2791,1207,2792,1211,2792,1216,2791,1222,2793,1228,2793,1229,2793,1229,2794,1238,2799,1241,2800,1242,2800,1242,2801,1247,2801,1252,2801,1271,2802,1291,2802,1301,2800,1310,2800,1312,2800,1313,2799,1318,2796,1323,2795,1326,2794,1328,2793,1330,2792,1332,2790,1336,2788,1339,2787,1340,2787,1342,2786,1347,2784,1350,2784,1351,2783,1352,2782,1355,2779,1359,2779,1360,2779,1361,2778,1366,2776,1369,2776,1371,2774,1372,2773,1373,2773,1373,2770,1375,2771,1379,2768,1386,2768,1392,2768,1400,2763,1404,2762,1405,2762,1405,2761,1412,2761,1418,2762,1429,2755,1437,2753,1438,2752,1438,2749,1440,2745,1444,2742,1447,2738,1451,2735,1453,2731,1454,2730,1454,2729,1455,2727,1456,2723,1457,2718,1457,2715,1460,2713,1462,2712,1464,2708,1472,2699,1476,2696,1477,2694,1479,2691,1481,2690,1484,2690,1485,2690,1485,2689,1492,2685,1496,2684,1505,2683,1515,2683,1516,2682,1517,2678,1519,2675,1522,2674,1523,2673,1525,2671,1528,2671,1531,2671,1534,2670,1535,2669,1536,2668,1537,2666,1540,2662,1543,2656,1550,2650,1558,2649,1559,2649,1559,2646,1564,2639,1568,2639,1569,2638,1569,2633,1575,2626,1579,2620,1584,2613,1591,2607,1596,2602,1604,2602,1605,2600,1606,2595,1611,2593,1616,2592,1617,2591,1617,2587,1622,2582,1628,2581,1629,2580,1629,2569,1637,2559,1647,2559,1648,2558,1648,2552,1652,2547,1658,2546,1660,2545,1660,2538,1666,2531,1672,2530,1673,2529,1674,2527,1677,2523,1680,2518,1684,2515,1689,2515,1690,2514,1690,2508,1695,2501,1701,2498,1705,2495,1707,2494,1708,2493,1709,2492,1710,2492,1711,2486,1716,2478,1723,2471,1729,2467,1736,2464,1740,2461,1743,2459,1746,2457,1749,2456,1750,2456,1750,2456,1751,2455,1751,2451,1755,2446,1759,2442,1761,2439,1764,2436,1767,2434,1770,2430,1775,2424,1781,2422,1784,2420,1785,2414,1791,2405,1799,2402,1802,2400,1805,2397,1809,2395,1813,2394,1813,2393,1814,2393,1815,2392,1815,2386,1821,2382,1825,2376,1833,2371,1838,2365,1844,2357,1848,2357,1849,2356,1849,2349,1853,2344,1859,2342,1861,2341,1863,2340,1864,2339,1865,2337,1869,2335,1872,2332,1876,2329,1878,2329,1879,2328,1879,2327,1880,2327,1880,2324,1881,2323,1882,2322,1883,2321,1884,2320,1886,2319,1887,2319,1889,2318,1890,2316,1899,2310,1905,2304,1913,2301,1921,2300,1922,2300,1923,2298,1932,2291,1938,2288,1940,2284,1943,2279,1946,2275,1948,2273,1950,2272,1952,2272,1953,2271,1954,2267,1958,2265,1960,2265,1961,2264,1962,2262,1965,2260,1969,2260,1970,2259,1971,2257,1980,2251,1986,2250,1986,2248,1987,2245,1990,2243,1993,2241,1995,2240,1997,2238,2002,2237,2007,2236,2010,2235,2011,2234,2012,2234,2013,2234,2014,2232,2014,2231,2016,2228,2017,2226,2020,2226,2021,2225,2022,2225,2023,2224,2027,2223,2031,2223,2032,2223,2032,2220,2035,2220,2039,2219,2048,2213,2052,2213,2053,2212,2054,2207,2060,2201,2066,2200,2067,2200,2068,2197,2078,2190,2084,2189,2085,2187,2086,2181,2091,2174,2099,2168,2106,2162,2113,2157,2119,2152,2126,2149,2130,2145,2133,2145,2134,2144,2135,2141,2138,2137,2141,2136,2143,2133,2144,2133,2144,2132,2146,2130,2147,2129,2148,2128,2148,2127,2149,2126,2150,2125,2150,2124,2151,2123,2151,2121,2154,2118,2158,2116,2160,2115,2162,2113,2166,2112,2171,2111,2175,2111,2178,2111,2179,2111,2179,2109,2186,2109,2193,2109,2195,2110,2198,2110,2199,2111,2200,2112,2201,2112,2201,2116,2206,2120,2210,2121,2212,2121,2216,2121,2221,2121,2225,2121,2227,2122,2227,2122,2227,2122,2228,2123,2237,2132,2244,2135,2246,2136,2249,2137,2250,2138,2250,2139,2250,2139,2252,2139,2254,2141,2254,2142,2255,2142,2255,2143,2256,2144,2257,2146,2260,2149,2262,2152,2264,2154,2266,2158,2271,2165,2274,2165,2275,2166,2275,2167,2276,2168,2277,2169,2277,2169,2278,2169,2278,2170,2278,2171,2278,2172,2279,2174,2280,2176,2281,2177,2282,2177,2282,2183,2282,2186,2285,2189,2287,2192,2289,2196,2291,2200,2292,2203,2292,2205,2293,2212,2298,2222,2297,2226,2297,2228,2299,2229,2299,2230,2300,2231,2301,2233,2302,2236,2305,2239,2307,2242,2309,2247,2310,2251,2310,2254,2314,2257,2316,2260,2319,2261,2319,2262,2320,2263,2320,2263,2320,2268,2321,2272,2321,2277,2321,2280,2325,2282,2327,2283,2328,2285,2329,2286,2331,2291,2334,2297,2335,2297,2335,2298,2336,2299,2337,2301,2339,2301,2340,2301,2341,2302,2344,2305,2347,2309,2350,2309,2355,2310,2356,2310,2357,2314,2366,2320,2373,2321,2374,2323,2375,2328,2379,2331,2385,2337,2388,2345,2387,2350,2386,2353,2383,2354,2383,2354,2382,2354,2381,2354,2380,2355,2375,2359,2372,2360,2372,2360,2372,2365,2370,2367,2368,2375,2363,2385,2364,2391,2364,2396,2364,2399,2365,2402,2368,2404,2370,2409,2372,2414,2373,2420,2373,2422,2373,2423,2374,2424,2374,2425,2374,2430,2374,2435,2375,2436,2375,2437,2375,2442,2378,2446,2381,2448,2382,2450,2383,2453,2385,2457,2384,2462,2383,2467,2385,2472,2387,2475,2391,2475,2392,2477,2393,2479,2393,2479,2394,2480,2395,2481,2396,2483,2398,2487,2400,2488,2401,2489,2401,2492,2402,2494,2402,2500,2401,2504,2403,2505,2404,2506,2404,2512,2404,2517,2404,2518,2405,2518,2405,2523,2411,2529,2413,2538,2416,2547,2413,2548,2412,2548,2412,2552,2410,2552,2406,2552,2406,2553,2405,2555,2401,2562,2401,2566,2401,2570,2400,2572,2399,2573,2397,2573,2391,2580,2391,2586,2392,2591,2392,2595,2392,2596,2389,2597,2389,2597,2388,2599,2387,2601,2386,2602,2385,2603,2385,2607,2385,2611,2384,2613,2384,2615,2384,2624,2385,2628,2379,2628,2379,2629,2378,2630,2378,2631,2377,2631,2377,2632,2377,2636,2376,2640,2375,2646,2375,2652,2375,2655,2376,2654,2379,2653,2390,2660,2397,2665,2401,2667,2409,2668,2414,2670,2417,2672,2422,2674,2425,2676,2426,2677,2427,2679,2429,2682,2434,2682,2435,2682,2435,2683,2442,2685,2446,2688,2453,2692,2457,2694,2459,2694,2465,2694,2469,2695,2473,2695,2474,2695,2475,2697,2478,2700,2481,2702,2483,2702,2486,2702,2488,2702,2489,2704,2494,2705,2499,2705,2499,2705,2500,2710,2505,2713,2507,2716,2510,2716,2513,2716,2515,2717,2517,2717,2521,2718,2525,2719,2526,2719,2526,2720,2529,2721,2530,2722,2531,2723,2532,2726,2535,2727,2540,2727,2542,2728,2543,2728,2545,2730,2548,2732,2552,2735,2555,2738,2558,2738,2562,2738,2563,2739,2563,2739,2564,2740,2565,2741,2569,2742,2574,2742,2575,2743,2576,2743,2580,2745,2582,2745,2583,2746,2584,2747,2585,2747,2586,2748,2587,2748,2588,2749,2588,2749,2589,2749,2593,2750,2594,2750,2595,2751,2595,2752,2597,2753,2599,2753,2602,2755,2604,2756,2606,2756,2608,2757,2612,2758,2617,2758,2618,2758,2618,2758,2621,2759,2623,2759,2625,2761,2626,2763,2628,2765,2631,2766,2634,2767,2636,2768,2636,2768,2637,2770,2640,2770,2642,2772,2647,2773,2652,2774,2653,2774,2654,2776,2659,2778,2664,2779,2666,2780,2670,2780,2674,2781,2678,2781,2679,2781,2679,2787,2692,2801,2697,2805,2701,2806,2706,2807,2707,2807,2707,2809,2710,2810,2713,2811,2717,2812,2719,2812,2720,2812,2721,2813,2725,2814,2727,2815,2728,2815,2729,2819,2734,2824,2738,2828,2741,2831,2744,2835,2747,2836,2751,2836,2752,2837,2753,2838,2754,2839,2755,2840,2756,2840,2757,2841,2757,2842,2758,2842,2759,2843,2759,2845,2760,2846,2761,2847,2762,2847,2762,2851,2764,2853,2766,2860,2771,2868,2772,2869,2772,2870,2773,2881,2776,2886,2787,2886,2788,2886,2788,2889,2791,2890,2794,2891,2796,2893,2797,2893,2798,2894,2799,2894,2799,2895,2799,2898,2801,2901,2803,2902,2804,2903,2804,2906,2807,2908,2810,2909,2810,2909,2811,2911,2813,2911,2817,2911,2819,2911,2821,2914,2829,2921,2833,2925,2836,2928,2839,2929,2840,2929,2841,2929,2848,2931,2853,2932,2855,2932,2856,2932,2865,2933,2873,2935,2882,2940,2890,2941,2891,2941,2892,2941,2894,2942,2895,2943,2895,2943,2896,2944,2905,2949,2912,2950,2913,2950,2914,2951,2915,2952,2916,2956,2922,2959,2925,2963,2928,2968,2931,2971,2933,2976,2934,2981,2934,2984,2937,2988,2940,2992,2943,2993,2944,2993,2945,2994,2946,2995,2947,2996,2950,2997,2952,2997,2954,2998,2955,3e3,2958,3002,2961,3005,2965,3009,2968,3013,2971,3014,2977,3016,2987,3022,2994,3023,2996,3024,2997,3025,2999,3026,3001,3027,3002,3027,3003,3029,3010,3035,3015,3037,3018,3038,3021,3041,3028,3045,3034,3047,3036,3048,3036,3052,3037,3055,3038,3058,3042,3063,3045,3063,3045,3064,3045,3068,3047,3073,3046,3078,3046,3080,3049,3086,3055,3091,3064,3093,3068,3098,3068,3103,3068,3107,3069,3108,3070,3109,3070,3112,3073,3116,3076,3117,3077,3119,3078,3120,3079,3122,3079,3126,3080,3129,3082,3131,3083,3133,3084,3135,3085,3136,3088,3137,3089,3137,3089,3140,3092,3142,3093,3145,3097,3148,3098,3150,3099,3152,3100,3157,3102,3162,3104,3163,3105,3164,3105,3165,3106,3166,3107,3167,3107,3167,3107,3173,3112,3183,3112,3184,3112,3186,3112,3189,3112,3191,3110,3192,3109,3192,3108,3192,3106,3194,3105,3195,3105,3196,3104,3196,3104,3197,3103,3203,3100,3207,3094,3208,3093,3210,3092,3212,3092,3213,3092,3221,3092,3229,3089,3231,3088,3233,3085,3233,3084,3234,3083,3235,3082,3238,3081,3240,3080,3242,3079,3244,3078,3246,3077,3248,3076,3248,3075,3248,3073,3249,3072,3250,3071,3250,3070,3249,3065,3251,3060,3251,3059,3251,3057,3251,3053,3253,3048,3254,3046,3256,3044,3262,3037,3262,3027,3262,3010,3263,2993,3263,2992,3263,2991,3265,2989,3266,2987,3267,2986,3267,2985,3269,2983,3270,2982,3272,2980,3272,2977,3273,2973,3273,2970,3274,2965,3274,2960,3274,2954,3277,2951,3277,2951,3278,2950,3281,2947,3286,2947,3290,2945,3291,2943,3294,2941,3295,2937,3297,2934,3300,2934,3301,2934,3301,2934,3319,2934,3337,2934,3336,2932,3334,2930,3334,2929,3333,2928,3331,2924,3329,2919,3328,2915,3327,2910,3326,2909,3326,2908,3325,2906,3324,2903,3323,2901,3322,2899,3320,2894,3319,2885,3318,2881,3316,2879,3314,2877,3314,2874,3313,2873,3313,2872,3314,2864,3310,2860,3310,2859,3309,2858,3305,2856,3303,2854,3298,2849,3298,2839,3298,2838,3298,2838,3297,2838,3297,2836,3297,2833,3295,2832,3295,2831,3295,2830,3293,2812,3293,2794,3293,2783,3295,2773,3295,2768,3296,2763,3297,2759,3298,2755,3298,2754,3299,2753,3299,2752,3300,2751,3301,2748,3303,2747,3304,2747,3304,2747,3305,2744,3307,2743,3310,2740,3313,2737,3314,2735,3314,2733,3315,2728,3319,2726,3328,2723,3335,2716,3336,2716,3336,2716,3341,2714,3346,2712,3347,2711,3348,2711,3351,2710,3352,2709,3355,2707,3358,2705,3367,2701,3377,2701,3378,2701,3379,2700,3381,2699,3383,2699,3384,2699,3385,2698,3390,2695,3395,2694,3396,2694,3397,2693,3398,2691,3401,2690,3402,2689,3403,2688,3404,2688,3404,2688,3406,2687,3407,2687,3412,2685,3414,2682,3415,2681,3415,2681,3417,2676,3421,2674,3430,2670,3434,2662,3435,2661,3435,2661,3439,2659,3441,2654,3442,2651,3443,2647,3443,2646,3444,2645,3446,2643,3449,2641,3452,2639,3452,2637,3453,2634,3455,2632,3456,2632,3457,2630,3457,2630,3458,2629,3458,2627,3459,2626,3460,2624,3460,2621,3460,2619,3461,2617,3462,2616,3462,2615,3465,2611,3466,2605,3467,2603,3467,2601,3467,2601,3467,2600,3468,2598,3469,2596,3470,2595,3470,2594,3471,2593,3471,2593,3473,2592,3473,2590,3473,2585,3473,2580,3473,2580,3473,2579,3473,2568,3476,2559,3478,2555,3480,2554,3482,2552,3482,2550,3482,2549,3482,2548,3486,2544,3491,2539,3492,2539,3492,2538,3494,2533,3497,2531,3498,2530,3498,2530,3503,2529,3504,2523,3504,2521,3507,2520,3509,2519,3511,2519,3512,2519,3513,2518,3516,2516,3522,2514,3523,2513,3523,2513,3527,2513,3531,2513,3550,2513,3570,2513,3590,2513,3610,2513,3629,2513,3649,2513,3668,2513,3687,2513,3689,2513,3690,2512,3693,2511,3695,2512,3704,2513,3710,2509,3711,2508,3712,2507,3713,2506,3716,2506,3735,2505,3755,2505,3758,2505,3760,2504,3770,2502,3781,2501,3785,2500,3788,2498,3789,2498,3789,2497,3791,2494,3796,2494,3802,2494,3808,2494,3811,2494,3813,2493,3815,2492,3818,2491,3826,2490,3834,2490,3836,2490,3837,2490,3839,2489,3840,2488,3842,2487,3843,2486,3846,2484,3852,2484,3857,2484,3859,2481,3860,2479,3861,2478,3863,2474,3868,2471,3869,2471,3869,2470,3870,2469,3872,2469,3873,2469,3875,2468,3879,2467,3880,2461,3880,2460,3880,2459,3881,2453,3886,2450,3887,2446,3886,2441,3886,2434,3890,2430,3893,2428,3897,2427,3898,2426,3898,2425,3901,2422,3900,2417,3900,2414,3900,2412,3899,2410,3899,2407,3899,2402,3894,2401,3890,2400,3886,2399,3885,2399,3885,2399,3883,2396,3883,2391,3883,2386,3884,2381,3884,2376,3881,2374,3877,2372,3874,2370,3872,2369,3872,2368,3872,2362,3872,2356,3872,2353,3871,2350,3868,2344,3862,2342,3859,2340,3860,2337,3861,2331,3856,2329,3855,2329,3855,2329,3851,2329,3848,2329,3847,2329,3846,2328,3844,2327,3842,2324,3841,2322,3841,2320,3842,2314,3836,2315,3831,2316,3830,2314,3828,2311,3828,2306,3827,2301,3827,2297,3827,2293,3828,2289,3828,2284,3828,2282,3829,2279,3829,2277,3829,2275,3830,2274,3830,2273,3830,2271,3830,2269,3832,2269,3839,2269,3845,2269,3865,2269,3885,2269,3890,2269,3895,2268,3899,2268,3901,2266,3904,2263,3908,2262,3909,2262,3910,2262,3928,2262,3947,2262,3957,2261,3967,2262,3972,2262,3973,2268,3973,2270,3974,2272,3975,2272,3976,2273,3976,2274,3977,2274,3981,2276,3981,2280,3981,2281,3980,2283,3979,2287,3979,2292,3980,2302,3981,2312,3981,2313,3981,2314,3981,2317,3982,2319,3983,2320,3983,2320,3983,2322,3985,2324,3987,2327,3991,2331,3993,2333,3994,2334,3995,2337,3996,2342,3996,2343,3996,2344,3996,2354,3997,2363,3997,2364,3997,2364,3998,2366,3998,2368,3998,2371,3999,2374,4e3,2375,4e3,2376,4002,2377,4002,2379,4003,2379,4004,2380,4007,2381,4008,2384,4008,2384,4008,2385,4008,2387,4009,2387,4010,2388,4010,2389,4011,2390,4012,2391,4014,2392,4014,2393,4015,2398,4015,2403,4015,2404,4016,2404,4020,2405,4024,2405,4025,2405,4026,2404,4028,2404,4030,2403,4031,2403,4032,2402,4034,2401,4035,2398,4036,2395,4039,2392,4040,2390,4043,2387,4044,2387,4045,2387,4051,2385,4054,2381,4054,2381,4054,2380,4054,2376,4057,2374,4059,2372,4062,2370,4064,2368,4065,2363,4065,2363,4065,2362,4066,2360,4066,2358,4067,2353,4071,2350,4075,2347,4076,2343,4076,2342,4076,2341,4077,2340,4077,2337,4078,2333,4080,2331,4083,2329,4086,2326,4087,2326,4088,2325,4089,2324,4089,2323,4091,2320,4091,2316,4091,2314,4091,2313,4092,2311,4092,2308,4092,2307,4093,2307,4096,2303,4099,2300,4100,2298,4101,2295,4101,2294,4101,2293,4103,2288,4106,2283,4107,2282,4107,2282,4108,2279,4109,2277,4110,2276,4110,2275,4110,2273,4110,2271,4111,2269,4111,2267,4111,2266,4112,2266,4116,2261,4119,2256,4120,2255,4120,2253,4119,2249,4121,2246,4121,2245,4122,2244,4122,2242,4123,2241,4127,2239,4130,2234,4131,2232,4131,2229,4131,2229,4131,2228,4131,2225,4133,2222,4134,2219,4136,2217,4138,2217,4139,2216,4140,2214,4140,2214,4142,2213,4143,2210,4143,2209,4144,2208,4145,2207,4145,2206,4146,2205,4146,2203,4147,2195,4156,2192,4160,2191,4162,2186,4162,2186,4163,2185,4164,2181,4166,2176,4171,2175,4176,2175,4181,2175,4182,2179,4183,2181,4184,2184,4185,2188,4185,2192,4185,2193,4186,2194,4187,2198,4189,2200,4190,2201,4190,2203,4191,2206,4192,2207,4194,2208,4195,2209,4196,2210,4196,2211,4196,2228,4196,2244,4196,2246,4196,2248,4194,2257,4194,2266,4194,2267,4194,2268,4194,2278,4194,2288,4192,2299,4186,2306,4186,2307,4186,2308,4186,2312,4183,2315,4182,2315,4182,2316,4178,2319,4175,2323,4174,2324,4174,2324,4174,2329,4171,2333,4168,2335,4166,2338,4166,2339,4166,2340,4164,2345,4160,2348,4152,2354,4153,2365,4153,2366,4152,2367,4151,2368,4149,2370,4148,2371,4147,2371,4146,2372,4145,2375,4145,2380,4144,2384,4144,2385,4143,2386,4142,2387,4142,2387,4141,2389,4139,2391,4138,2392,4137,2392,4137,2393,4136,2393,4132,2398,4134,2406,4134,2407,4134,2408,4134,2411,4135,2412,4137,2413,4140,2415,4141,2416,4142,2416,4148,2417,4151,2421,4151,2422,4152,2423,4153,2424,4153,2424,4155,2428,4157,2431,4157,2431,4158,2431,4161,2432,4164,2432,4174,2432,4184,2432,4185,2432,4186,2432,4188,2432,4189,2433,4190,2435,4191,2436,4192,2440,4194,2443,4194,2444,4195,2444,4211,2445,4226,2445,4235,2445,4243,2444,4244,2443,4245,2443,4263,2443,4280,2443,4285,2443,4291,2443,4299,2444,4306,2440,4309,2438,4311,2435,4313,2433,4317,2431,4318,2431,4318,2431,4324,2429,4326,2426,4328,2422,4329,2417,4331,2416,4332,2415,4334,2414,4335,2411,4335,2406,4336,2402,4337,2400,4337,2398,4337,2395,4339,2393,4341,2390,4342,2387,4343,2380,4345,2372,4345,2372,4346,2371,4349,2369,4348,2366,4348,2357,4349,2348,4350,2347,4350,2346,4350,2343,4352,2342,4356,2338,4357,2332,4357,2328,4358,2325,4359,2320,4364,2317,4365,2317,4365,2316,4368,2314,4370,2311,4372,2308,4373,2305,4373,2304,4374,2303,4376,2302,4378,2301,4382,2300,4385,2295,4387,2290,4393,2291,4398,2291,4403,2291,4404,2291,4405,2291,4415,2292,4421,2297,4425,2300,4427,2302,4429,2304,4432,2305,4434,2306,4435,2307,4437,2309,4439,2312,4444,2319,4451,2323,4452,2323,4452,2323,4455,2328,4458,2333,4460,2337,4464,2339,4465,2339,4466,2340,4469,2344,4473,2348,4473,2349,4474,2350,4475,2351,4476,2351,4478,2353,4481,2355,4482,2357,4483,2358,4487,2364,4493,2370,4496,2373,4500,2375,4501,2375,4501,2376,4504,2377,4507,2382,4509,2385,4512,2388,4513,2389,4514,2389,4516,2391,4517,2392,4518,2394,4519,2396,4520,2397,4520,2397,4521,2400,4523,2401,4526,2405,4528,2410,4529,2412,4530,2413,4534,2414,4536,2418,4541,2423,4548,2427,4549,2428,4549,2428,4553,2429,4557,2432,4558,2434,4560,2435,4564,2439,4567,2441,4575,2448,4577,2456,4578,2461,4581,2462,4583,2463,4584,2463,4594,2463,4604,2464,4613,2464,4616,2457,4616,2457,4617,2456,4617,2454,4620,2453,4621,2453,4622,2452,4627,2450,4633,2448,4634,2448,4635,2447,4636,2446,4637,2446,4637,2445,4638,2445,4640,2440,4643,2438,4644,2437,4644,2437,4645,2436,4645,2435,4646,2430,4649,2425,4650,2423,4652,2422,4652,2421,4652,2421,4655,2418,4657,2414,4658,2413,4659,2412,4660,2410,4660,2407,4660,2402,4662,2398,4663,2397,4663,2396,4663,2395,4664,2395,4664,2394,4665,2393,4665,2391,4666,2388,4666,2388,4666,2387,4666,2384,4667,2381,4668,2376,4670,2373,4671,2372,4672,2370,4672,2368,4672,2366,4673,2356,4678,2347,4678,2339,4679,2332,4679,2327,4681,2324,4685,2319,4686,2314,4687,2312,4688,2309,4689,2307,4690,2305,4690,2304,4690,2303,4690,2295,4695,2290,4696,2288,4697,2286,4699,2279,4701,2272,4701,2272,4702,2271,4703,2270,4703,2268,4703,2266,4703,2263,4703,2258,4704,2255,4705,2254,4705,2254,4708,2249,4710,2243,4710,2242,4711,2241,4712,2240,4712,2237,4712,2236,4713,2235,4715,2231,4718,2227,4720,2223,4724,2221,4726,2220,4728,2216,4730,2212,4734,2209,4734,2208,4735,2208,4737,2208,4738,2206,4739,2205,4742,2204,4743,2204,4746,2202,4749,2202,4752,2200,4754,2199,4756,2199,4757,2199,4758,2199,4761,2199,4764,2197,4764,2197,4764,2196,4768,2194,4769,2189,4771,2185,4773,2182,4774,2180,4774,2179,4774,2178,4775,2176,4775,2174,4775,2171,4776,2170,4776,2169,4779,2166,4781,2162,4781,2161,4781,2161,4781,2157,4783,2155,4784,2152,4788,2150,4793,2147,4794,2143,4794,2142,4795,2141,4796,2136,4801,2134,4804,2132,4806,2131,4809,2129,4809,2125,4810,2120,4815,2118,4820,2115,4824,2113,4825,2113,4825,2112,4826,2112,4827,2112,4828,2111,4829,2110,4833,2106,4838,2106,4842,2106,4845,2104,4846,2103,4849,2103,4850,2103,4852,2104,4856,2104,4859,2102,4860,2102,4861,2102,4862,2101,4864,2101,4869,2098,4874,2098,4878,2097,4883,2097,4884,2097,4885,2097,4888,2096,4891,2096,4892,2096,4893,2096,4894,2095,4895,2095,4898,2092,4903,2092,4904,2092,4905,2092,4910,2092,4913,2088,4915,2086,4918,2085,4921,2084,4923,2079,4924,2075,4928,2071,4930,2070,4931,2069,4932,2067,4933,2064,4933,2063,4933,2060,4933,2059,4934,2058,4935,2055,4938,2053,4939,2052,4940,2052,4945,2048,4946,2042,4947,2038,4950,2034,4953,2030,4957,2028,4958,2027,4958,2027,4958,2026,4959,2025,4960,2024,4961,2021,4961,2020,4961,2019,4961,2012,4961,2005,4961,1996,4960,1988,4960,1987,4959,1987,4959,1986,4957,1985,4956,1984,4954,1983,4948,1982,4943,1977,4942,1976,4942,1975,4941,1967,4941,1960,4941,1940,4941,1921,4941,1911,4940,1901,4940,1896,4944,1893,4944,1892,4945,1891,4946,1890,4946,1890,4948,1888,4949,1886,4950,1885,4950,1884,4951,1876,4955,1870,4956,1869,4956,1869,4960,1867,4962,1863,4963,1862,4964,1861,4965,1857,4967,1855,4969,1851,4971,1846,4972,1844,4974,1843,4981,1835,4986,1829,4988,1827,4988,1825,4989,1813,4989,1801,4989,1795,4987,1789,4986,1788,4984,1786,4977,1779,4978,1767,4979,1757,4976,1748,4976,1746,4975,1745,4973,1743,4972,1741,4971,1739,4969,1737,4968,1736,4968,1735,4968,1732,4968,1728,4968,1723,4963,1720,4962,1719,4962,1718,4961,1716,4960,1714,4960,1713,4960,1711,4958,1698,4958,1685,4958,1683,4957,1681,4954,1677,4951,1673,4950,1673,4950,1672,4947,1667,4948,1662,4948,1658,4946,1654,4945,1651,4944,1648,4942,1643,4942,1638,4942,1638,4942,1637,4942,1632,4941,1628,4940,1627,4940,1626,4940,1623,4939,1621,4938,1619,4938,1618,4938,1615,4938,1613,4937,1610,4936,1607,4935,1601,4935,1594,4936,1591,4936,1588,4937,1579,4937,1570,4937,1569,4938,1568,4941,1564,4943,1559,4944,1559,4944,1558,4944,1556,4945,1554,4945,1553,4948,1551,4949,1550,4949,1549,4952,1547,4952,1541,4952,1539,4953,1538,4956,1533,4961,1529,4962,1528,4963,1528,4963,1527,4963,1526,4965,1523,4965,1520,4964,1517,4966,1515,4968,1513,4971,1512,4975,1508,4979,1505,4980,1504,4980,1503,4981,1499,4983,1494,4984,1491,4987,1489,4990,1488,4992,1485,4992,1485,4992,1484,4995,1482,4995,1479,4995,1478,4996,1477,4997,1476,4997,1475,4999,1474,5001,1473,5002,1472,5003,1471,5004,1471,5005,1470,5005,1469,5006,1468,5007,1465,5009,1464,5010,1463,5010,1462,5010,1461,5011,1461,5012,1460,5013,1459,5014,1458,5014,1457,5018,1453,5020,1449,5022,1446,5024,1442,5025,1440,5026,1439,5030,1434,5034,1429,5036,1426,5038,1424,5041,1418,5043,1413,5044,1413,5044,1412,5046,1411,5047,1408,5047,1407,5048,1407,5049,1407,5049,1405,5050,1404,5050,1403,5052,1402,5053,1399,5057,1391,5060,1382,5060,1381,5061,1381,5064,1381,5065,1379,5066,1374,5068,1370,5070,1367,5072,1365,5073,1364,5074,1364,5075,1362,5075,1360,5075,1357,5075,1354,5076,1352,5076,1350,5076,1349,5076,1348,5078,1342,5082,1337,5082,1336,5083,1336,5085,1332,5088,1327,5088,1326,5088,1325,5089,1313,5088,1302,5088,1301,5088,1300,5086,1295,5083,1290,5080,1288,5080,1283,5080,1282,5080,1280,5078,1276,5076,1271,5076,1268,5076,1265,5076,1263,5075,1260,5075,1259,5075,1257,5075,1246,5068,1238,5066,1235,5065,1231,5065,1229,5065,1227,5065,1226,5065,1225,5065,1224,5065,1224,5064,1223,5064,1221,5063,1215,5062,1209,5062,1208,5062,1207,5062,1202,5058,1200,5054,1197,5052,1191,5051,1189,5051,1188,5051,1185,5050,1184,5048,1182,5046,1179,5044,1177,5044,1172,5045,1166,5044,1160,5043,1157,5041,1155,5040,1154,5039,1152,5039,1151,5038,1149,5038,1148,5037,1146,5037,1145,5037,1143,5037,1140,5036,1136,5035,1134,5034,1132,5033,1131,5033,1130,5031,1129,5031,1129,5027,1124,5029,1116,5030,1110,5026,1108,5025,1108,5024,1107,5015,1100,5016,1087,5016,1086,5015,1085,5012,1083,5010,1079,5010,1077,5009,1075,5009,1072,5009,1068,5009,1066,5008,1064,5007,1059,5004,1054,4999,1049,4996,1044,4995,1043,4995,1042,4994,1036,4993,1031,4993,1027,4992,1024,4991,1023,4991,1022,4987,1018,4986,1013,4985,1009,4984,1004,4983,1003,4983,1001,4984,996,4980,995,4980,995,4979,994,4978,994,4977,993,4973,992,4972,989,4972,988,4971,987,4970,985,4970,981,4970,980,4969,979,4967,978,4964,977,4960,975,4957,972,4954,970,4953,966,4951,962,4949,958,4949,957,4948,956,4946,953,4942,951,4942,950,4941,950,4937,949,4936,946,4936,945,4935,944,4935,943,4935,942,4933,938,4931,936,4928,934,4924,934,4923,934,4922,933,4921,932,4920,930,4918,929,4918,929,4913,926,4909,922,4907,921,4906,918,4906,917,4905,917,4905,916,4904,915,4904,914,4901,913,4901,913,4900,913,4898,913,4898,911,4896,907,4894,904,4893,904,4892,903,4887,903,4884,900,4883,899,4883,898,4882,895,4881,893,4880,892,4879,891,4878,890,4876,889,4875,889,4874,888,4871,886,4868,884,4867,883,4867,882,4865,872,4857,869,4857,869,4856,868,4855,867,4852,866,4851,865,4850,864,4847,859,4846,855,4845,850,4845,845,4845,840,4844,835,4844,834,4844,833,4845,831,4842,831,4842,830,4841,829,4840,828,4840,826,4839,819,4839,812,4839,810,4839,808,4839,793,4839,777,4839,771,4835,768,4832,764,4832,759,4831,756,4831,753,4830,745,4830,738,4830,737,4830,735,4829,734,4829,733,4829,731,4829,729,4829,728,4827,727,4823,722,4821,716,4819,711,4819,704,4820,702,4820,701,4819,698,4818,697,4817,696,4816,694,4816,693,4815,693,4810,685,4811,675,4811,673,4812,671,4813,664,4807,662,4798,657,4799,645,4800,639,4799,635,4798,633,4797,632,4796,631,4794,630,4792,629,4791,628,4790,627,4789,626,4789,626,4789,625,4788,624,4788,624,4787,622,4787,620,4787,611,4786,602,4786,600,4785,599,4784,597,4782,597,4778,595,4777,591,4777,590,4777,589,4777,583,4777,576,4777,556,4777,537,4777,532,4773,531,4772,530,4772,530,4768,529,4767,525,4766,525,4766,524,4766,520,4766,516,4766,511,4766,507,4767,502,4764,499,4764,498,4763,498,4762,498,4761,497,4761,497,4760,497,4756,496,4756,493,4756,487,4757,482,4757,478,4755,475,4754,474,4754,474,4742,474,4743,462,4743,459,4742,457,4737,454,4735,451,L,4735,450,Q,4735,450,4735,449,4735,445,4734,440,4733,440,4733,439,4733,435,4732,432,4731,428,4730,424,4730,423,4729,422,4726,418,4726,412,4725,411,4725,410,4724,409,4724,407,4724,399,4724,391,4724,381,4724,371,4724,366,4725,362,4726,355,4721,352,4720,352,4719,351,4718,350,4718,350,4714,348,4715,344,4715,335,4715,326,4715,314,4714,303,4714,299,4713,295,4712,275,4713,254,4713,250,4713,245,4713,231,4713,217,4713,205,4714,195,4714,193,4714,190,4714,172,4714,153,4715,152,4714,150,4714,145,4716,141,4715,141,4714,141,4713,141,4712,140,4710,139,4707,139,4706,138,4706,138,4705,130,4705,122,4705,119,4705,117,4706,109,4700,107,4698,107,4696,105,4695,105,4695,104,4694,103,4694,101,4694,101,4693,100,4693,94,4693,88,4693,77,4693,66,4693,60,4687,61,4686,61,4685,60,4683,55,4683,50,L,4683,49,Q,4677,48,4670,48,4650,48,4631,48,4611,48,4591,48,4572,48,4553,48,4534,48,4515,48,4495,48,4475,47,4465,47,4455,47,4435,47,4416,47,4396,47,4377,47,4358,47,4339,47,4319,47,4299,47,4279,47,4260,47,4241,47,4222,47,4213,49,4205,49,4185,49,4165,49,4145,49,4126,49,4125,49,4124,48,4123,47,4121,45,4119,44,4118,42,4117,41,4115,41,4102,41,4089,41,Q,4069,41,4049,41,Z]],label:"Piche",shortLabel:"PT",labelPosition:[392.3,125.3],labelAlignment:[CEN,MID],nextId:"GW.GA.GB"},"GW.GA.GB":{outlines:[[M,2550,1542,Q,2540,1542,2533,1538,2530,1536,2529,1536,2524,1534,2520,1532,2516,1530,2511,1528,2507,1527,2503,1523,2502,1520,2499,1520,2493,1519,2488,1518,2487,1518,2486,1517,2484,1514,2482,1512,2478,1509,2474,1508,2473,1507,2471,1507,2460,1508,2453,1500,2453,1499,2452,1499,2450,1494,2447,1490,2445,1487,2442,1485,2441,1484,2440,1484,2438,1484,2438,1483,2436,1481,2435,1479,2433,1476,2432,1474,2431,1473,2431,1473,2430,1472,2429,1471,2426,1467,2422,1465,2420,1464,2419,1463,2415,1461,2413,1458,2413,1457,2412,1457,2412,1456,2412,1455,2411,1452,2410,1448,2409,1447,2409,1446,2408,1444,2408,1442,2408,1439,2407,1438,2400,1433,2396,1427,2395,1426,2394,1425,2392,1423,2392,1418,2392,1413,2390,1410,2389,1409,2389,1408,2386,1405,2382,1402,2381,1401,2380,1400,2376,1395,2371,1391,2370,1390,2368,1389,2364,1387,2361,1387,2359,1386,2358,1386,2354,1385,2351,1380,2350,1380,2350,1379,2348,1374,2343,1373,2341,1373,2339,1373,2332,1372,2327,1374,2326,1375,2326,1375,2325,1379,2322,1382,2321,1383,2320,1383,2315,1382,2311,1386,2310,1388,2309,1390,2308,1391,2306,1391,2300,1392,2295,1392,2285,1392,2282,1401,2281,1402,2281,1402,2280,1404,2277,1404,2272,1403,2269,1405,2268,1406,2267,1406,2264,1406,2263,1409,2263,1410,2262,1410,2261,1414,2257,1415,2252,1415,2247,1414,2235,1413,2233,1423,2233,1424,2232,1424,2215,1425,2198,1425,2178,1425,2158,1425,2138,1425,2119,1425,2118,1425,2116,1425,2115,1424,2114,1423,2113,1421,2112,1418,2108,1417,2105,1415,2105,1415,2104,1415,2100,1414,2097,1411,2095,1410,2094,1409,2094,1408,2092,1407,2091,1407,2090,1407,2088,1407,2085,1406,2085,1406,2084,1406,2083,1406,2082,1405,2079,1400,2076,1396,2075,1395,2075,1394,2075,1387,2071,1383,2071,1382,2071,1382,2063,1375,2057,1369,2056,1368,2055,1368,2054,1367,2054,1366,2053,1365,2053,1364,2051,1363,2051,1360,2051,1360,2051,1359,2051,1355,2049,1351,2048,1350,2047,1347,2046,1344,2045,1343,2044,1343,2044,1342,2044,1338,2043,1334,2043,1333,2043,1333,2040,1330,2037,1326,2034,1323,2034,1318,2033,1314,2032,1310,2032,1309,2031,1309,2029,1308,2027,1307,2024,1305,2021,1305,2017,1305,2015,1304,2014,1303,2013,1303,2009,1302,2008,1300,2007,1300,2007,1299,2005,1295,2e3,1295,1991,1295,1981,1295,1971,1294,1961,1297,1960,1297,1959,1297,1957,1300,1955,1300,1953,1301,1951,1302,1948,1303,1943,1303,1939,1303,1934,1303,1933,1303,1931,1303,1929,1303,1927,1305,1926,1307,1925,1308,1923,1311,1921,1312,1921,1313,1920,1313,1912,1314,1904,1314,1898,1314,1894,1315,1893,1316,1892,1316,1889,1317,1887,1320,1886,1321,1885,1321,1884,1321,1883,1321,1869,1322,1854,1322,1834,1322,1815,1322,1814,1322,1813,1322,1810,1324,1807,1329,1807,1329,1806,1330,1802,1332,1797,1333,1794,1334,1793,1335,1792,1335,1792,1336,1791,1338,1790,1339,1788,1339,1786,1340,1786,1341,1785,1341,1783,1341,1783,1342,1780,1346,1779,1351,1778,1353,1775,1353,1762,1354,1748,1354,1728,1354,1709,1354,1689,1353,1669,1354,1669,1354,1668,1355,1667,1355,1666,1356,1665,1357,1665,1360,1664,1365,1658,1365,1653,1365,1650,1364,1648,1364,1648,1363,1643,1359,1639,1356,1637,1355,1635,1355,1628,1353,1624,1348,1623,1347,1622,1347,1615,1347,1610,1343,1609,1343,1609,1342,1608,1337,1602,1333,1597,1333,1593,1332,1582,1332,1577,1336,1576,1337,1575,1338,1572,1341,1567,1343,1566,1343,1566,1344,1565,1344,1564,1344,1561,1345,1559,1345,1555,1345,1553,1347,1550,1350,1549,1353,1548,1355,1546,1355,1542,1357,1537,1358,1536,1358,1535,1358,1533,1359,1532,1360,1531,1360,1529,1361,1526,1361,1523,1363,1519,1365,1515,1364,1514,1364,1512,1364,1510,1364,1509,1363,1508,1371,1509,1378,1509,1380,1510,1381,1510,1382,1510,1383,1510,1388,1515,1389,1518,1390,1519,1392,1520,1393,1520,1394,1522,1396,1522,1400,1521,1419,1521,1439,1521,1459,1521,1478,1521,1487,1523,1496,1523,1497,1524,1499,1526,1503,1528,1509,1528,1509,1528,1510,1528,1511,1528,1511,1528,1519,1531,1526,1531,1527,1531,1528,1533,1531,1536,1534,1537,1535,1537,1536,1538,1537,1540,1538,L,1540,1539,Q,1541,1543,1541,1548,1541,1549,1541,1549,1540,1551,1540,1552,1540,1571,1540,1591,1540,1592,1540,1592,1539,1596,1538,1598,1535,1603,1532,1607,1531,1608,1531,1609,1531,1611,1530,1613,1527,1616,1526,1622,1526,1623,1525,1623,1525,1624,1524,1625,1522,1628,1517,1631,1514,1633,1511,1637,1511,1638,1511,1639,1510,1644,1508,1649,1506,1652,1505,1654,L,1504,1655,Q,1502,1656,1502,1658,1502,1659,1501,1660,1500,1664,1498,1667,1496,1670,1494,1676,1493,1679,1492,1681,1492,1682,1491,1684,1491,1686,1491,1688,1490,1691,1488,1694,1485,1697,1482,1699,1482,1700,1481,1700,1479,1704,1477,1708,1475,1713,1471,1718,1470,1721,1470,1725,1470,1726,1469,1726,1467,1730,1463,1733,1460,1736,1460,1740,1460,1741,1460,1742,1459,1743,1459,1744,1458,1748,1454,1751,1450,1753,1447,1756,1446,1756,1446,1757,1445,1758,1445,1759,1444,1763,1441,1766,1441,1767,1440,1768,1438,1769,1437,1771,1436,1773,1436,1775,1435,1780,1434,1785,1434,1785,1434,1786,1433,1789,1429,1790,1423,1790,1421,1795,1420,1798,1417,1799,1416,1800,1416,1801,1415,1801,1414,1801,1412,1803,1411,1805,1410,1807,1409,1809,1408,1810,1408,1812,1409,1815,1408,1818,1408,1819,1407,1820,1405,1825,1398,1825,1395,1825,1392,1826,1387,1826,1382,1827,1381,1827,1380,1828,1373,1835,1363,1833,1355,1832,1349,1836,1348,1836,1348,1837,1345,1846,1335,1845,1331,1845,1329,1848,1328,1849,1328,1850,1326,1855,1320,1855,1315,1855,1311,1856,1309,1856,1308,1856,1305,1856,1304,1857,1301,1860,1298,1863,1297,1864,1297,1864,1284,1865,1272,1865,1271,1865,1270,1866,1267,1868,1266,1871,1263,1875,1256,1875,1253,1874,1250,1874,1241,1873,1237,1879,1236,1879,1236,1880,1235,1881,1233,1882,1229,1884,1225,1885,1219,1886,1219,1892,L,1219,1893,Q,1201,1895,1182,1895,1172,1895,1163,1895,1157,1895,1153,1893,1153,1893,1152,1892,1147,1883,1135,1883,1130,1884,1126,1884,1125,1884,1124,1884,1119,1885,1114,1886,1113,1886,1113,1887,1112,1888,1110,1889,1109,1889,1109,1890,1108,1891,1107,1891,1106,1892,1105,1892,1101,1895,1095,1895,1089,1895,1083,1896,1078,1897,1074,1900,1072,1902,1068,1904,1067,1905,1065,1906,1063,1906,1063,1907,1063,1908,1062,1908,1061,1910,1058,1911,1048,1912,1042,1918,1041,1919,1040,1919,1034,1920,1032,1925,1031,1926,1031,1926,1029,1930,1026,1931,1021,1933,1017,1934,1011,1934,1007,1936,1007,1937,1006,1937,1005,1940,1003,1944,1003,1946,1002,1946,999,1949,995,1952,993,1952,992,1954,990,1955,989,1958,989,1959,988,1959,987,1962,987,1965,987,1968,985,1968,983,1969,983,1971,981,1972,980,1973,977,1976,976,1980,976,1981,976,1982,976,1985,975,1988,974,1988,974,1989,973,1993,969,1997,969,1998,968,1998,967,1999,967,2001,967,2006,967,2012,966,2014,966,2017,966,2019,966,2020,965,2023,962,2024,956,2025,954,2030,954,2031,954,2032,953,2036,954,2041,954,2047,952,2049,951,2050,949,2051,946,2052,944,2054,944,2055,943,2055,940,2057,940,2060,940,2062,940,2064,940,2070,936,2073,936,2073,935,2074,930,2078,931,2087,931,2091,930,2094,930,2095,930,2096,927,2100,925,2104,923,2107,923,2113,923,2117,922,2122,922,2123,921,2123,920,2123,921,2125,921,2127,920,2129,920,2130,919,2130,918,2132,918,2135,918,2138,916,2139,912,2142,911,2146,911,2147,911,2148,910,2155,910,2162,910,2173,911,2182,911,2184,912,2186,913,2189,914,2191,917,2194,919,2198,920,2199,920,2200,920,2204,921,2209,921,2210,921,2211,920,2219,922,2226,923,2227,924,2227,927,2231,927,2238,927,2239,928,2241,929,2245,933,2248,937,2249,938,2252,938,2252,939,2252,943,2254,942,2259,942,2267,945,2272,945,2273,946,2274,947,2275,947,2275,949,2279,949,2284,949,2285,949,2286,950,2302,950,2318,950,2319,950,2319,951,2321,951,2324,951,2325,951,2325,952,2326,952,2327,954,2331,957,2336,958,2336,958,2337,959,2339,960,2342,960,2343,961,2345,962,2354,970,2359,971,2360,971,2361,971,2376,971,2392,971,2411,971,2431,971,2432,971,2433,970,2434,970,2435,971,2439,970,2443,970,2445,969,2446,968,2449,968,2452,967,2455,967,2457,966,2460,963,2463,962,2465,961,2467,961,2469,960,2470,959,2472,959,2475,959,2476,959,2477,958,2479,958,2482,958,2485,958,2487,958,2488,957,2490,955,2495,953,2499,953,2500,953,2501,952,2507,951,2514,951,2515,950,2515,949,2517,948,2520,948,2521,948,2521,947,2523,946,2525,946,2527,946,2529,946,2535,945,2540,945,2541,945,2541,945,2546,944,2549,943,2550,943,2551,943,2552,942,2553,942,2554,942,2554,941,2558,938,2561,934,2565,932,2571,932,2578,932,2585,933,2597,933,2609,933,2610,932,2611,930,2615,930,2622,930,2623,929,2624,928,2625,927,2628,927,2628,927,2629,922,2633,921,2640,920,2645,919,2649,918,2651,916,2653,915,2654,914,2654,914,2655,913,2656,913,2656,912,2657,911,2658,912,2659,912,2663,910,2666,910,2666,910,2667,909,2670,907,2673,902,2677,901,2683,900,2684,900,2685,900,2688,899,2690,898,2691,896,2693,894,2694,893,2696,889,2699,888,2704,888,2708,885,2712,883,2715,880,2718,877,2721,875,2724,874,2728,872,2732,872,2732,872,2733,870,2738,867,2741,864,2744,863,2750,862,2754,862,2759,862,2768,862,2777,862,2778,862,2779,861,2782,859,2785,859,2786,858,2786,852,2793,853,2804,853,2809,851,2813,851,2813,850,2814,848,2818,846,2821,846,2822,845,2823,843,2826,843,2833,839,2838,835,2843,835,2844,835,2844,835,2846,834,2846,832,2848,833,2850,833,2855,829,2856,827,2858,826,2859,825,2860,825,2860,824,2863,822,2865,820,2870,815,2874,811,2876,810,2881,810,2882,809,2882,808,2884,808,2885,808,2887,807,2888,806,2888,806,2889,805,2890,804,2890,800,2892,799,2897,797,2903,792,2905,791,2906,790,2906,787,2908,786,2910,782,2919,774,2923,771,2925,770,2930,770,2930,770,2931,769,2933,769,2935,768,2936,768,2936,766,2939,764,2941,764,2942,764,2942,763,2947,762,2952,762,2953,761,2954,761,2955,760,2955,758,2958,756,2961,755,2962,755,2963,755,2968,754,2972,754,2974,753,2974,751,2975,751,2979,751,2980,751,2982,750,2986,748,2989,747,2990,747,2990,747,2995,746,3e3,745,3003,744,3006,743,3007,742,3008,739,3009,737,3011,734,3014,732,3018,732,3020,731,3023,731,3024,730,3025,729,3027,727,3028,724,3031,723,3036,723,3038,721,3039,719,3042,715,3043,715,3044,714,3044,710,3048,707,3053,707,3054,706,3054,704,3057,700,3056,697,3055,695,3053,692,3050,689,3047,689,3046,688,3046,687,3045,686,3044,686,3043,685,3043,681,3041,679,3037,678,3035,677,3034,676,3032,675,3031,671,3028,669,3024,669,3023,668,3023,667,3022,667,3020,667,3018,665,3016,662,3013,660,3009,659,3008,657,3005,656,3004,655,3003,654,3002,652,3001,646,2996,639,2996,638,2998,636,2999,636,2999,635,2999,630,3001,627,3006,627,3007,626,3007,626,3008,625,3009,625,3011,623,3012,623,3013,623,3013,621,3014,620,3016,620,3016,619,3017,618,3017,618,3018,616,3022,613,3025,607,3031,599,3037,596,3038,595,3039,594,3041,593,3043,592,3044,592,3045,589,3051,586,3057,586,3058,585,3058,584,3060,584,3061,584,3065,583,3069,582,3071,582,3073,581,3075,581,3076,580,3081,576,3084,575,3084,575,3085,573,3088,570,3089,568,3093,568,3099,569,3106,568,3112,567,3115,567,3117,565,3122,566,3128,566,3129,565,3129,565,3130,564,3131,562,3137,557,3137,557,3137,556,3137,554,3135,552,3133,551,3130,549,3126,549,3125,548,3125,548,3124,548,3123,548,3122,547,3120,546,3115,542,3111,538,3107,538,3103,537,3098,534,3096,533,3095,532,3095,528,3094,524,3095,523,3095,522,3095,517,3095,513,3099,512,3108,504,3111,502,3112,501,3113,500,3114,499,3114,498,3114,498,3115,497,3116,497,3117,497,3120,495,3123,494,3123,494,3123,487,3125,483,3122,482,3121,482,3121,481,3118,480,3117,480,3116,480,3115,480,3113,478,3112,473,3110,467,3112,458,3115,455,3124,L,455,3125,Q,453,3125,453,3127,453,3132,449,3136,445,3139,441,3142,441,3142,440,3142,437,3145,437,3148,436,3152,435,3156,435,3157,435,3158,434,3160,433,3162,429,3165,423,3165,423,3165,422,3165,416,3165,413,3171,413,3172,412,3172,410,3172,409,3173,408,3174,407,3174,394,3174,381,3174,380,3174,380,3175,380,3176,377,3177,377,3182,372,3183,367,3184,361,3184,355,3183,352,3185,348,3186,348,3190,348,3191,348,3191,346,3193,343,3193,338,3194,333,3193,327,3193,325,3197,324,3198,324,3199,321,3203,316,3203,315,3203,314,3203,312,3204,309,3204,308,3204,306,3205,305,3205,304,3205,303,3205,301,3205,299,3204,299,3200,300,3197,300,3195,301,3192,303,3190,303,3189,304,3189,309,3186,311,3180,311,3179,311,3179,315,3177,318,3172,320,3169,322,3166,322,3165,322,3164,323,3153,323,3142,323,3140,322,3139,321,3136,322,3133,322,3132,321,3132,320,3131,320,3129,320,3128,320,3126,319,3125,318,3125,310,3124,302,3124,301,3124,301,3125,298,3126,295,3128,287,3134,276,3134,276,3134,275,3134,269,3135,264,3136,263,3137,262,3137,257,3140,253,3142,252,3143,251,3143,250,3145,248,3145,238,3144,233,3148,229,3151,223,3152,217,3153,212,3156,208,3158,205,3160,203,3160,201,3161,200,3161,199,3161,197,3161,195,3162,190,3164,189,3167,187,3170,185,3172,182,3175,178,3177,175,3179,172,3182,171,3182,170,3183,169,3184,168,3184,163,3187,161,3193,161,3194,161,3195,160,3200,156,3203,155,3204,154,3205,153,3205,152,3206,143,3208,140,3214,139,3215,139,3215,139,3222,135,3227,134,3229,133,3230,133,3231,132,3231,129,3234,127,3239,126,3244,124,3249,122,3255,123,3261,123,3262,123,3264,124,3265,124,3265,125,3270,129,3273,131,3275,132,3278,133,3283,135,3287,137,3291,140,3294,140,3295,141,3296,142,3299,145,3300,146,3300,146,3300,150,3303,154,3305,158,3307,162,3308,165,3309,166,3311,167,3312,168,3312,169,3313,171,3315,173,3319,176,3322,178,3323,179,3325,180,3325,181,3325,183,3328,187,3331,187,3332,188,3332,192,3334,197,3337,198,3337,199,3337,205,3337,209,3340,210,3340,210,3341,213,3343,217,3346,218,3347,218,3348,219,3348,219,3349,221,3351,224,3352,225,3355,226,3357,227,3358,227,3358,229,3359,229,3361,230,3362,231,3363,231,3364,231,3364,232,3367,235,3368,235,3369,235,3369,236,3372,239,3372,241,3374,243,3375,246,3377,249,3380,250,3381,251,3382,252,3385,257,3389,261,3393,264,3397,264,3398,265,3398,267,3401,269,3402,270,3403,271,3403,278,3408,283,3414,289,3421,294,3429,294,3430,295,3431,302,3436,308,3441,L,309,3442,Q,311,3442,313,3443,317,3447,322,3447,328,3446,330,3452,331,3453,330,3453,330,3457,332,3459,332,3460,332,3461,333,3477,332,3493,332,3497,333,3501,334,3502,334,3502,334,3505,335,3507,340,3514,339,3524,338,3534,341,3543,342,3548,345,3550,348,3553,349,3557,350,3558,350,3559,352,3562,353,3564,354,3565,355,3566,357,3566,359,3567,362,3569,365,3570,366,3570,367,3570,368,3570,368,3571,370,3572,372,3573,373,3574,374,3574,376,3575,377,3576,379,3578,382,3579,386,3579,387,3584,387,3585,387,3586,388,3593,389,3600,389,3604,391,3609,391,3610,392,3610,393,3611,394,3611,397,3613,400,3614,401,3615,402,3615,403,3616,404,3616,L,405,3617,Q,406,3624,405,3632,405,3642,403,3650,403,3653,402,3656,402,3658,402,3659,400,3664,401,3671,401,3685,401,3698,401,3709,406,3717,410,3722,409,3729,409,3731,409,3733,408,3735,407,3738,405,3741,403,3742,403,3742,403,3743,401,3744,401,3745,400,3750,397,3755,396,3756,396,3757,392,3760,392,3765,392,3766,392,3767,391,3769,391,3771,390,3774,388,3777,384,3779,382,3783,382,3784,382,3785,381,3788,379,3790,378,3790,378,3791,374,3793,369,3796,367,3796,367,3798,366,3800,364,3800,364,3801,363,3802,359,3806,356,3809,355,3809,355,3809,350,3812,347,3816,346,3818,346,3820,345,3822,345,3824,344,3825,344,3826,341,3830,337,3836,337,3837,335,3838,332,3840,332,3846,332,3848,331,3850,327,3859,323,3867,322,3868,322,3869,320,3870,320,3873,321,3878,322,3881,322,3882,322,3882,323,3885,324,3886,328,3893,330,3903,331,3905,332,3906,333,3908,334,3910,335,3910,336,3911,340,3913,344,3916,345,3917,345,3917,348,3919,350,3922,351,3923,352,3924,354,3926,354,3931,355,3935,356,3939,359,3943,361,3946,363,3948,364,3949,366,3952,366,3956,367,3960,368,3964,368,3965,368,3965,368,3967,369,3969,373,3972,377,3973,377,3974,378,3975,379,3976,380,3977,381,3979,381,3980,382,3986,382,3993,383,4e3,383,4007,383,4016,388,4021,390,4023,391,4027,392,4028,392,4029,392,4033,393,4036,395,4040,398,4041,401,4043,401,4044,403,4045,405,4047,409,4049,411,4053,412,4054,413,4056,414,4056,415,4057,417,4060,420,4063,421,4064,422,4064,429,4069,433,4077,436,4082,439,4086,443,4087,446,4091,447,4092,447,4092,451,4094,454,4097,455,4098,455,4099,458,4101,461,4104,467,4109,469,4116,469,4117,470,4118,471,4119,471,4121,471,4122,472,4123,472,4125,472,4126,472,4130,473,4134,474,4135,474,4136,475,4136,476,4138,476,4139,477,4139,480,4141,481,4146,481,4149,482,4151,482,4153,482,4156,482,4163,482,4171,482,4176,483,4180,485,4185,487,4189,488,4189,489,4190,491,4192,490,4195,489,4205,495,4212,498,4215,498,4220,498,4221,498,4221,500,4223,500,4225,499,4230,502,4233,503,4233,503,4234,506,4237,508,4239,514,4245,518,4253,518,4254,519,4254,522,4259,524,4266,524,4267,525,4268,526,4275,530,4280,531,4281,532,4282,533,4283,533,4284,533,4285,534,4286,535,4287,535,4288,535,4294,540,4297,540,4300,540,4303,540,4304,540,4304,539,4306,538,4307,538,4308,538,4309,538,4312,536,4314,535,4317,532,4319,531,4321,530,4323,528,4327,526,4332,526,4333,526,4334,526,4343,523,4351,522,4354,520,4355,518,4358,518,4363,518,4366,517,4368,517,4369,516,4370,515,4373,512,4376,508,4381,505,4385,504,4387,504,4388,503,4399,503,4410,503,4429,503,4449,503,4451,503,4451,501,4455,501,4459,501,4460,500,4461,497,4465,495,4470,495,4471,494,4472,494,4473,493,4474,490,4484,491,4495,491,4496,491,4497,489,4503,485,4509,485,4510,485,4511,485,4522,479,4530,476,4534,474,4539,473,4542,473,4546,473,4547,473,4548,472,4556,472,4565,472,4574,472,4584,472,4586,471,4589,471,4592,471,4594,471,4595,471,4595,470,4597,470,4598,469,4603,464,4606,461,4608,461,4611,461,4630,461,4648,461,4653,464,4658,464,4659,465,4660,466,4663,468,4665,470,4666,469,4668,469,4673,470,4677,471,4682,475,4685,476,4686,477,4688,478,4689,478,4691,478,4693,479,4695,479,4697,479,4698,480,4700,480,4701,481,4702,481,4703,485,4706,487,4708,488,4710,489,4712,490,4713,490,4714,491,4715,491,4716,493,4719,496,4722,496,4723,496,4723,497,4724,497,4724,500,4728,500,4733,500,4734,501,4734,502,4736,502,4738,502,4751,502,4764,502,4784,502,4804,502,4823,502,4842,502,4857,503,4871,503,4875,505,4878,505,4879,506,4880,506,4881,507,4883,510,4889,509,4898,510,4903,510,4908,510,4909,510,4909,512,4911,513,4915,513,4916,514,4917,516,4920,519,4924,520,4925,520,4926,520,4935,520,4945,520,4952,525,4957,526,4958,526,4958,528,4965,527,4972,527,4982,529,4992,529,4992,529,4993,530,4995,530,4997,531,5003,534,5007,536,5010,538,5013,540,5016,539,5022,539,5023,539,5023,538,5024,538,5025,538,5039,538,5053,538,5072,538,5092,538,5112,538,5132,538,5139,538,5146,538,5154,540,5162,540,5163,541,5163,545,5168,548,5174,549,5178,550,5181,551,5183,553,5185,558,5190,561,5194,562,5195,562,5195,563,5198,565,5200,571,5206,579,5211,580,5212,582,5213,592,5215,598,5220,600,5222,605,5225,608,5228,610,5231,610,5231,610,5232,612,5233,613,5235,614,5236,614,5236,615,5237,616,5238,622,5244,628,5251,631,5254,634,5256,642,5260,643,5269,643,5272,644,5274,644,5276,645,5278,647,5283,653,5285,661,5290,660,5300,660,5304,662,5306,668,5311,669,5317,670,5318,670,5319,671,5321,672,5323,674,5324,675,5325,676,5325,677,5327,679,5330,678,5335,678,5336,678,5337,677,5342,672,5343,667,5343,663,5346,660,5348,657,5350,653,5353,653,5360,653,5363,653,5364,653,5368,653,5372,653,5374,651,5375,651,5376,650,5376,650,5377,649,5377,648,5378,648,5379,647,5379,646,5380,643,5382,642,5386,642,5387,642,5387,641,5390,641,5393,641,5399,637,5402,636,5403,636,5404,632,5406,629,5407,629,5408,628,5408,625,5412,621,5416,620,5416,620,5417,613,5420,604,5422,602,5423,601,5424,596,5433,588,5438,587,5438,587,5439,581,5446,572,5448,570,5449,569,5449,568,5450,568,5450,563,5454,561,5457,559,5459,557,5461,551,5466,543,5470,540,5471,537,5472,535,5472,533,5474,532,5474,532,5475,531,5477,529,5477,528,5478,528,5478,527,5482,524,5482,514,5484,504,5484,503,5484,502,5484,498,5484,494,5487,492,5488,491,5489,490,5491,488,5491,482,5492,479,5494,477,5496,474,5499,472,5502,468,5505,467,5505,466,5505,465,5506,464,5506,456,5513,453,5518,452,5519,452,5521,452,5522,452,5522,449,5525,446,5528,445,5529,445,5530,443,5530,442,5532,442,5533,442,5534,441,5538,441,5542,441,5544,440,5546,439,5546,439,5547,436,5551,432,5554,431,5554,430,5555,430,5556,429,5557,424,5559,419,5564,419,5565,418,5565,418,5567,416,5567,415,5569,412,5570,407,5572,406,5577,406,5578,405,5578,403,5580,401,5583,400,5583,400,5584,391,5588,389,5597,389,5599,388,5600,385,5603,383,5608,382,5608,382,5609,382,5611,381,5613,380,5616,379,5620,379,5620,379,5621,378,5630,378,5640,378,5641,379,5642,379,5643,379,5645,379,5650,381,5654,384,5659,389,5661,391,5661,392,5663,392,5664,393,5664,394,5668,394,5674,392,5676,390,5678,387,5679,386,5681,382,5684,377,5687,376,5688,375,5688,372,5689,369,5691,367,5692,365,5694,361,5696,355,5698,355,5698,354,5698,352,5699,351,5699,349,5700,348,5700,344,5700,341,5703,340,5703,339,5704,337,5707,332,5708,332,5708,331,5708,326,5708,324,5712,323,5712,323,5712,320,5712,318,5713,318,5714,317,5714,314,5714,312,5717,309,5720,306,5722,302,5724,300,5727,298,5730,297,5735,297,5737,295,5738,291,5742,291,5748,292,5757,297,5763,298,5764,298,5765,298,5766,298,5766,299,5768,299,5769,299,5775,302,5779,302,5780,303,5780,306,5782,311,5781,315,5783,317,5779,319,5776,320,5774,325,5770,333,5772,333,5772,334,5772,336,5773,338,5773,349,5774,355,5779,356,5780,357,5780,362,5784,367,5785,368,5785,369,5786,370,5787,372,5787,376,5789,379,5791,380,5792,381,5793,381,5793,383,5794,384,5794,385,5795,387,5796,389,5799,390,5800,390,5801,392,5804,395,5807,398,5810,402,5814,402,5815,402,5815,403,5817,404,5818,414,5826,423,5833,424,5833,424,5834,424,5836,426,5836,430,5838,433,5839,434,5839,435,5839,436,5839,436,5839,439,5840,441,5841,443,5841,444,5843,445,5844,446,5844,449,5848,452,5852,453,5853,453,5853,460,5859,465,5864,466,5865,466,5865,470,5868,470,5873,470,5878,471,5883,472,5885,474,5886,478,5889,483,5892,490,5895,490,5903,490,5904,491,5905,492,5906,491,5910,491,5912,491,5913,491,5915,493,5916,497,5919,501,5920,503,5920,504,5921,508,5922,513,5924,514,5924,514,5924,516,5924,517,5925,519,5928,523,5931,530,5936,541,5934,544,5934,547,5934,558,5933,561,5939,562,5940,562,5940,565,5942,569,5942,575,5942,580,5941,582,5941,584,5939,584,5939,585,5938,586,5937,588,5936,591,5934,595,5935,L,595,5935,Q,599,5934,604,5934,610,5934,616,5934,617,5934,617,5935,619,5936,621,5936,626,5937,630,5940,632,5941,632,5942,633,5943,635,5943,637,5943,639,5945,642,5946,646,5947,650,5949,655,5948,656,5948,657,5949,658,5950,660,5952,661,5953,662,5953,662,5955,664,5956,667,5956,669,5958,670,5958,671,5959,672,5960,674,5960,675,5960,675,5960,677,5960,678,5960,683,5961,685,5964,689,5968,694,5970,697,5972,702,5974,704,5974,705,5975,706,5976,706,5976,709,5979,711,5983,712,5985,714,5986,714,5986,714,5987,715,5988,715,5988,718,5991,721,5994,721,5994,722,5995,728,5995,734,5996,739,5995,743,5999,745,6001,746,6005,L,746,6006,Q,764,6007,782,6007,802,6007,822,6007,827,6007,833,6005,838,6004,844,6004,845,6004,846,6004,850,6004,853,6002,855,6e3,857,5998,859,5995,860,5994,861,5993,861,5993,862,5988,868,5986,868,5986,869,5986,872,5986,876,5985,877,5985,877,5985,879,5984,880,5984,882,5983,883,5982,885,5980,887,5978,888,5977,889,5976,893,5974,895,5971,898,5967,903,5968,908,5968,910,5964,912,5960,915,5958,917,5957,918,5957,929,5955,941,5955,946,5955,951,5953,954,5953,955,5950,959,5946,966,5946,985,5946,1005,5946,1011,5947,1016,5945,1020,5944,1025,5944,1026,5944,1026,5944,1027,5944,1028,5944,1032,5943,1034,5939,1035,5938,1035,5938,1039,5937,1041,5936,1042,5936,1042,5935,1047,5934,1049,5930,1050,5930,1050,5929,1051,5924,1052,5920,1054,5916,1057,5912,1059,5909,1059,5905,1059,5904,1060,5903,1060,5898,1060,5892,1060,5886,1060,5880,1060,5879,1060,5878,1060,5874,1062,5871,1065,5867,1067,5863,1070,5860,1070,5855,1070,5847,1069,5839,1069,5834,1071,5830,1071,5830,1072,5829,1075,5820,1076,5811,1076,5808,1077,5806,1077,5804,1078,5803,1079,5793,1079,5783,1079,5773,1080,5763,1080,5762,1081,5761,1081,5760,1081,5759,1082,5758,1082,5757,1082,5752,1084,5749,1085,5747,1086,5745,1089,5740,1095,5735,1096,5735,1097,5735,1102,5734,1105,5732,1109,5729,1115,5728,1116,5728,1116,5728,1123,5727,1131,5727,1139,5727,1144,5722,1145,5721,1146,5721,1148,5720,1150,5718,1152,5717,1156,5718,1167,5719,1174,5711,1174,5711,1175,5710,1177,5706,1182,5706,1184,5705,1187,5705,1187,5705,1188,5705,1192,5703,1195,5700,1198,5696,1203,5696,1205,5696,1207,5695,1208,5695,1211,5694,1215,5693,1217,5689,1218,5688,1218,5686,1219,5685,1219,5684,1219,5683,1219,5682,1220,5678,1221,5675,1221,5674,1222,5674,1224,5672,1227,5669,1230,5667,1233,5665,1235,5664,1236,5664,1237,5663,1238,5661,1239,5658,1242,5655,1244,5653,1245,5652,1247,5648,1251,5646,1253,5645,1254,5645,1257,5642,1259,5637,1260,5635,1262,5633,1269,5629,1274,5623,1275,5622,1275,5622,1278,5619,1280,5616,1281,5614,1282,5611,1282,5610,1283,5610,1284,5609,1283,5606,1283,5605,1284,5605,1285,5603,1286,5599,1286,5599,1286,5598,1287,5598,1288,5597,1289,5596,1290,5595,1292,5594,1294,5591,1296,5586,1299,5584,1301,5583,1304,5581,1309,5577,1310,5572,1311,5569,1311,5566,1312,5561,1315,5559,1315,5558,1316,5558,1320,5556,1320,5551,1320,5548,1321,5546,1322,5545,1322,5544,1328,5537,1335,5531,1338,5529,1339,5524,1339,5523,1339,5522,1341,5520,1341,5517,1341,5515,1342,5515,1346,5510,1350,5505,1350,5502,1350,5499,1351,5494,1354,5490,1357,5488,1359,5487,1360,5487,1360,5487,1363,5483,1365,5479,1367,5474,1369,5470,1369,5470,1369,5469,1370,5467,1370,5466,1371,5462,1375,5459,1379,5456,1383,5454,1383,5454,1384,5453,1385,5451,1387,5450,1390,5448,1392,5445,1397,5440,1398,5432,1398,5432,1399,5431,1401,5428,1402,5425,1402,5424,1403,5423,1407,5417,1413,5412,1415,5410,1416,5409,1419,5407,1420,5403,1421,5403,1421,5403,1422,5402,1423,5402,1425,5400,1427,5397,1428,5397,1428,5396,1429,5392,1431,5389,1436,5381,1440,5374,1441,5374,1441,5373,1441,5368,1443,5363,1443,5362,1443,5362,1446,5359,1450,5356,1453,5353,1458,5350,1459,5347,1461,5346,1463,5344,1463,5342,1464,5341,1465,5339,1466,5339,1467,5337,1467,5337,1467,5336,1469,5333,1472,5330,1473,5330,1474,5329,1476,5325,1479,5323,1480,5323,1480,5322,1482,5318,1487,5316,1488,5316,1488,5316,1488,5314,1489,5313,1491,5311,1492,5308,1492,5303,1497,5300,1500,5298,1502,5294,1503,5293,1503,5293,1505,5291,1506,5288,1513,5285,1517,5280,1521,5277,1525,5273,1528,5270,1530,5268,1530,5267,1531,5266,1532,5265,1532,5263,1534,5260,1537,5257,1538,5256,1539,5256,1541,5252,1542,5248,1542,5244,1544,5241,1545,5240,1545,5239,1548,5236,1549,5232,1549,5231,1550,5230,1550,5226,1550,5222,1550,5217,1551,5213,1551,5210,1551,5207,1551,5206,1552,5205,1557,5201,1559,5198,1560,5198,1560,5197,1560,5193,1560,5189,1559,5186,1557,5185,1555,5182,1553,5179,1551,5178,1550,5173,1549,5156,1549,5139,1549,5138,1550,5137,1550,5136,1550,5134,1550,5132,1551,5131,1553,5130,1554,5128,1557,5125,1561,5121,1565,5117,1565,5111,1565,5110,1565,5109,1566,5108,1567,5106,1567,5106,1568,5106,1570,5104,1570,5102,1570,5101,1570,5101,1571,5098,1571,5096,1571,5095,1571,5094,1572,5090,1573,5086,1574,5081,1579,5079,1581,5078,1583,5076,1584,5076,1584,5075,1585,5069,1585,5062,1585,5061,1584,5060,1583,5057,1579,5053,1579,5052,1579,5052,1577,5042,1578,5033,1578,5032,1577,5032,1572,5029,1568,5024,1568,5024,1567,5022,1561,5015,1563,5005,1564,4999,1559,4996,1558,4995,1556,4995,1553,4994,1553,4990,1553,4989,1552,4989,1551,4988,1552,4984,1552,4980,1550,4979,1549,4978,1549,4977,1548,4975,1547,4975,1546,4974,1545,4973,1545,4972,1544,4971,1542,4969,1542,4967,1542,4965,1540,4963,1540,4962,1539,4962,1536,4959,1533,4958,1532,4955,1531,4954,1531,4954,1531,4953,1531,4952,1530,4951,1529,4947,1527,4942,1527,4942,1526,4941,1524,4939,1522,4935,1521,4933,1521,4930,1521,4927,1519,4924,1518,4922,1517,4920,1516,4919,1516,4918,1516,4913,1515,4909,1514,4908,1514,4907,1513,4906,1512,4904,1510,4902,1509,4901,1508,4900,1508,4899,1505,4895,1503,4891,1503,4887,1501,4882,1500,4880,1499,4880,1493,4877,1490,4874,1489,4873,1489,4872,1488,4871,1487,4870,1484,4865,1482,4860,1482,4859,1482,4858,1482,4854,1480,4851,1476,4848,1472,4844,1469,4842,1467,4840,1463,4836,1460,4832,1457,4829,1454,4825,1453,4825,1453,4824,1450,4820,1448,4816,1447,4813,1448,4810,1448,4804,1443,4804,1439,4805,1434,4805,1434,4805,1433,4805,1428,4806,1426,4808,1423,4812,1418,4813,1417,4813,1415,4813,1413,4813,1412,4814,1410,4814,1408,4814,1403,4815,1399,4817,1397,4818,1395,4821,1392,4824,1387,4825,1381,4825,1378,4828,1376,4829,1375,4831,1374,4832,1373,4833,1371,4836,1367,4838,1364,4840,1362,4843,1359,4847,1355,4848,1355,4849,1354,4849,1350,4851,1346,4852,1345,4852,1343,4852,1341,4852,1340,4854,1339,4854,1339,4855,1337,4856,1337,4859,1337,4860,1336,4861,1333,4868,1327,4871,1323,4873,1319,4875,1316,4877,1315,4879,1314,4880,1314,4881,1313,4884,1308,4885,1300,4887,1289,4886,1288,4886,1287,4886,1287,4885,1286,4885,1284,4884,1284,4883,1283,4882,1283,4881,1281,4877,1278,4873,1275,4870,1275,4864,1273,4863,1272,4861,1272,4859,1271,4858,1270,4857,1269,4855,1269,4854,1268,4853,1267,4848,1267,4843,1267,4842,1266,4841,1265,4835,1265,4829,1266,4819,1267,4809,1269,4805,1274,4803,1275,4803,1275,4802,1281,4797,1286,4794,1287,4793,1288,4792,1289,4792,1290,4791,1293,4788,1297,4787,1299,4786,1300,4785,1304,4783,1306,4781,1310,4778,1316,4778,1319,4779,1320,4777,1322,4774,1326,4770,1327,4770,1328,4770,1335,4769,1342,4769,1347,4769,1351,4768,1354,4766,1355,4763,1357,4757,1363,4757,1372,4757,1380,4757,1385,4757,1389,4757,1395,4758,1397,4752,1398,4749,1403,4748,1407,4747,1412,4747,1416,4748,1418,4747,1418,4746,1419,4746,1428,4745,1437,4745,1438,4745,1439,4744,1442,4743,1445,4742,1446,4742,1447,4740,1449,4738,1451,4736,1462,4736,1473,4736,1478,4736,1482,4735,1486,4733,1488,4728,1489,4728,1489,4727,1491,4724,1494,4724,1500,4725,1505,4724,1506,4724,1506,4724,1509,4724,1512,4723,1515,4722,1515,4720,1516,4719,1516,4718,1519,4715,1525,4715,1533,4715,1539,4714,1541,4713,1542,4712,1544,4707,1549,4705,1553,4704,1559,4704,1563,4704,1567,4703,1568,4703,1568,4702,1571,4701,1572,4697,1572,4694,1571,4692,1567,4689,1567,4685,1566,4683,1567,4681,1567,4666,1567,4650,1567,4644,1566,4639,1566,4635,1566,4632,1566,4631,1565,4629,1564,4627,1564,4623,1564,4620,1564,4617,1564,4615,1563,4613,1563,4610,1562,4607,1562,4604,1562,4600,1561,4596,1560,4593,1557,4587,1555,4581,1555,4580,1555,4580,1552,4580,1552,4577,1551,4573,1551,4568,1551,4565,1550,4562,1550,4562,1550,4561,1548,4559,1545,4556,1544,4556,1544,4555,1541,4551,1539,4545,1539,4542,1536,4541,1519,4541,1502,4541,1497,4541,1494,4544,1491,4546,1486,4547,1483,4547,1480,4548,1479,4548,1477,4548,1475,4549,1472,4549,1465,4549,1462,4555,1461,4556,1461,4556,1458,4559,1454,4562,1451,4565,1446,4565,1435,4565,1428,4572,1426,4573,1424,4573,1421,4573,1419,4572,1409,4571,1403,4564,1403,4563,1402,4562,1401,4562,1400,4560,1400,4560,1399,4559,1394,4556,1390,4552,1387,4548,1384,4545,1382,4543,1380,4540,1380,4539,1380,4538,1379,4538,1379,4537,1377,4528,1372,4521,1371,4520,1370,4519,1368,4514,1363,4512,1362,4512,1361,4512,1357,4510,1356,4506,1354,4506,1352,4506,1332,4506,1312,4505,1307,4505,1304,4503,1303,4503,1302,4502,1301,4500,1299,4499,1297,4498,1293,4497,1291,4496,1288,4496,1287,4496,1286,4496,1284,4495,1282,4492,1281,4490,1278,4490,1275,4490,1273,4488,1273,4487,1273,4487,1272,4483,1271,4480,1269,4476,1269,4471,1269,4461,1270,4452,1271,4448,1272,4445,1273,4439,1275,4434,1275,4431,1276,4428,1277,4426,1278,4424,1279,4423,1279,4422,1281,4417,1283,4414,1286,4409,1286,4403,1286,4402,1287,4400,1288,4396,1292,4395,1293,4394,1293,4394,1295,4393,1297,4392,1298,4391,1298,4390,1303,4383,1309,4376,1310,4374,1311,4373,1311,4372,1312,4371,1313,4370,1313,4368,1313,4367,1315,4366,1319,4364,1323,4361,1325,4360,1326,4358,1327,4356,1329,4355,1332,4353,1334,4351,1337,4348,1339,4346,1339,4345,1340,4344,1341,4343,1341,4342,1344,4339,1347,4337,1349,4334,1351,4332,1356,4328,1361,4323,1364,4320,1367,4315,1367,4314,1368,4313,1369,4308,1370,4305,1370,4304,1370,4304,1371,4301,1372,4299,1373,4295,1378,4293,1383,4292,1385,4290,1387,4288,1389,4287,1393,4285,1396,4282,1399,4280,1401,4276,1402,4276,1402,4275,1404,4273,1405,4271,1406,4271,1407,4270,1411,4269,1412,4265,1413,4262,1414,4258,1414,4257,1415,4256,1415,4255,1416,4254,1416,4253,1417,4252,1419,4249,1422,4246,1423,4243,1425,4241,1428,4239,1432,4237,1433,4237,1433,4237,1438,4236,1442,4234,1443,4233,1443,4232,1447,4228,1451,4227,1452,4227,1453,4226,1456,4225,1461,4225,1462,4225,1463,4225,1464,4225,1464,4224,1469,4221,1473,4216,1473,4216,1474,4216,1481,4214,1489,4215,1491,4215,1492,4215,1502,4215,1512,4216,1513,4216,1513,4216,1519,4215,1521,4220,1522,4221,1522,4222,1524,4227,1525,4233,1525,4234,1525,4234,1525,4239,1528,4243,1531,4247,1536,4248,1537,4249,1537,4249,1539,4251,1540,4253,1545,4262,1543,4272,1542,4274,1542,4274,1538,4281,1532,4285,1531,4286,1531,4287,1529,4297,1530,4307,1530,4309,1529,4309,1528,4310,1529,4313,1529,4314,1528,4315,1526,4322,1520,4326,1518,4328,1519,4331,1519,4337,1516,4340,1513,4342,1511,4347,1511,4348,1511,4350,1511,4355,1512,4360,1513,4362,1516,4364,1520,4368,1523,4373,1523,4374,1524,4375,1524,4379,1527,4381,1528,4382,1528,4382,1530,4385,1532,4386,1533,4386,1533,4387,1536,4390,1540,4391,1541,4392,1543,4393,1544,4394,1545,4394,1551,4395,1555,4396,1556,4397,1557,4397,1557,4398,1560,4398,1560,4398,1561,4398,1563,4401,1565,4402,1565,4402,1566,4402,1570,4404,1574,4405,1575,4405,1576,4405,1581,4405,1585,4407,1588,4410,1591,4412,1592,4413,1592,4413,1612,4413,1632,4413,1651,4413,1671,4413,1673,4413,1674,4413,1675,4412,1677,4412,1680,4413,1682,4412,1686,4408,1690,4404,1691,4403,1692,4404,1696,4404,1700,4403,1701,4403,1702,4402,1711,4399,1719,4396,1725,4393,1727,4388,1728,4387,1728,4387,1732,4384,1736,4381,1736,4381,1738,4380,1738,4379,1739,4378,1739,4378,1740,4377,1741,4375,1742,4372,1743,4371,1743,4371,1742,4363,1747,4359,1747,4358,1748,4357,1750,4351,1752,4346,1753,4343,1754,4342,1757,4338,1760,4334,1760,4333,1760,4333,1763,4325,1768,4318,1769,4318,1769,4317,1769,4313,1770,4310,1771,4308,1772,4305,1772,4304,1774,4303,1776,4301,1777,4300,1778,4298,1780,4295,1780,4294,1780,4293,1781,4289,1781,4285,1781,4265,1781,4245,1782,4244,1782,4243,1786,4240,1788,4234,1788,4232,1789,4231,1789,4229,1789,4226,1789,4222,1791,4218,1791,4217,1791,4217,1794,4216,1796,4215,1801,4214,1808,4214,1827,4214,1846,4214,1866,4214,1886,4214,1888,4214,1889,4215,1890,4217,1892,4220,1894,4224,1897,4226,L,1898,4227,Q,1908,4227,1919,4227,1921,4227,1922,4226,1923,4226,1925,4226,1929,4226,1933,4225,1935,4225,1937,4224,1939,4224,1940,4223,1942,4221,1945,4219,1946,4218,1947,4218,1951,4218,1956,4217,1960,4216,1963,4213,1965,4211,1969,4210,1971,4210,1972,4210,1974,4209,1977,4209,1983,4209,1987,4205,1989,4202,1994,4200,1995,4200,1996,4200,1999,4199,2003,4195,2005,4192,2008,4191,2012,4190,2018,4189,2021,4189,2022,4188,2023,4187,2023,4187,2032,4183,2038,4178,2038,4177,2038,4176,2040,4174,2043,4174,2044,4174,2045,4174,2046,4173,2047,4173,2048,4172,2049,4172,2052,4171,2054,4169,2057,4165,2060,4165,2061,4165,2062,4166,2069,4169,2073,4175,2074,4175,2074,4176,2077,4181,2080,4183,2080,4184,2080,4184,2086,4189,2092,4192,2096,4195,2098,4198,2102,4204,2105,4214,2105,4215,2105,4215,2107,4219,2108,4223,2108,4224,2109,4225,2109,4225,2110,4226,2111,4227,2113,4228,2120,4233,2127,4240,2128,4241,2129,4242,2129,4243,2131,4244,2132,4244,2132,4245,2134,4250,2139,4252,2140,4252,2140,4252,2150,4257,2157,4264,2160,4267,2163,4270,2164,4273,2166,4275,2167,4277,2168,4280,2169,4283,2171,4285,2174,4286,2176,4288,2177,4289,2178,4290,2179,4291,2181,4293,2183,4296,2187,4300,2188,4301,2189,4302,2192,4304,2195,4306,2199,4307,2202,4312,2203,4313,2204,4314,2206,4317,2208,4321,2209,4321,2210,4323,2211,4324,2211,4324,2212,4325,2213,4326,2214,4327,2214,4328,2216,4331,2220,4332,2230,4331,2234,4338,2239,4346,2250,4345,2252,4345,2253,4346,2254,4347,2255,4347,2257,4349,2258,4351,2258,4351,2259,4351,2260,4352,2260,4352,L,2261,4353,Q,2265,4354,2269,4354,2271,4354,2271,4355,2275,4357,2277,4360,2277,4361,2279,4362,2283,4364,2289,4364,2293,4363,2295,4366,2296,4368,2297,4370,2297,4371,2298,4371,2300,4374,2303,4374,2304,4375,2304,4375,2317,4375,2330,4375,2331,4376,2331,4376,2333,4378,2335,4380,2335,4381,2335,4381,2336,4382,2337,4382,2341,4386,2347,4386,2362,4386,2377,4386,2381,4386,2386,4388,2387,4389,2387,4390,2389,4392,2391,4394,2393,4397,2397,4397,2407,4397,2417,4396,2418,4396,2420,4395,2422,4394,2425,4392,2425,4392,2425,4391,2427,4386,2432,4385,2433,4384,2434,4384,2443,4384,2451,4384,2453,4384,2454,4383,2457,4382,2461,4378,2461,4377,2462,4376,2463,4376,2463,4375,2466,4371,2468,4366,2469,4365,2470,4364,2471,4363,2472,4362,2473,4361,2474,4361,2476,4360,2477,4359,2477,4358,2478,4357,2480,4356,2481,4354,2484,4349,2489,4347,2493,4345,2496,4342,2497,4341,2497,4341,2498,4340,2498,4339,2501,4337,2503,4335,2507,4332,2511,4330,2512,4329,2513,4328,2520,4321,2527,4313,2528,4313,2528,4312,2533,4306,2538,4300,2545,4294,2552,4290,2557,4288,2560,4286,2561,4286,2562,4285,2562,4285,2564,4284,2566,4283,2569,4282,2573,4281,2578,4279,2579,4279,2579,4278,2582,4275,2587,4274,2589,4274,2589,4273,2590,4271,2593,4271,2595,4272,2595,4271,2596,4270,2597,4269,2598,4268,2599,4268,2600,4267,2600,4266,2601,4266,2601,4265,2606,4258,2609,4249,2609,4248,2610,4247,2613,4241,2615,4234,2617,4230,2619,4227,2621,4225,2623,4221,2624,4221,2624,4220,2625,4215,2629,4213,2633,4210,2637,4208,2637,4208,2638,4208,2640,4204,2644,4200,2645,4198,2647,4196,2649,4194,2650,4192,2650,4192,2650,4191,2651,4185,2651,4179,2651,4178,2651,4177,2652,4176,2652,4175,2652,4170,2656,4167,2657,4166,2657,4165,2658,4163,2659,4163,2661,4161,2661,4158,2661,4157,2661,4155,2662,4142,2662,4128,L,2662,4127,Q,2662,4120,2662,4113,2662,4104,2660,4096,2660,4094,2659,4093,2658,4092,2657,4091,2655,4090,2654,4088,2652,4084,2651,4079,2651,4079,2651,4078,2649,4059,2650,4039,2650,4034,2652,4029,2654,4026,2655,4023,2657,4021,2658,4019,2661,4015,2663,4011,2663,4010,2664,4009,2666,4006,2666,4001,2666,3996,2670,3996,2676,3995,2680,3997,2681,3997,2682,3997,2684,3998,2686,3999,2686,4e3,2686,4e3,2687,4001,2688,4002,2690,4005,2695,4005,2715,4005,2735,4005,2754,4005,2774,4005,2784,4005,2792,4003,2793,4003,2794,4003,2796,4003,2796,4001,2797,4e3,2798,4e3,2800,3999,2802,3998,2805,3996,2808,3996,2810,3996,2813,3995,2816,3994,2821,3993,2824,3992,2826,3990,2827,3989,2829,3987,2833,3983,2835,3979,2835,3978,2836,3977,2838,3973,2840,3969,2841,3968,2841,3967,2842,3947,2842,3927,2842,3907,2842,3888,2841,3886,2841,3884,2841,3883,2841,3882,2840,3881,2840,3880,2840,3879,2840,3878,2839,3877,2839,3874,2839,3873,2838,3872,2832,3869,2828,3863,2824,3857,2818,3856,2817,3856,2816,3855,2814,3854,2814,3854,2810,3851,2807,3850,2805,3848,2803,3848,2800,3848,2797,3848,2797,3848,2796,3847,2794,3846,2791,3845,2790,3844,2790,3844,2784,3844,2779,3842,2779,3842,2778,3842,2777,3842,2776,3841,2776,3840,2774,3839,2769,3835,2769,3828,2770,3824,2771,3820,2773,3817,2775,3814,2777,3811,2779,3807,2779,3806,2779,3805,2780,3800,2781,3796,2782,3793,2785,3791,2789,3788,2794,3786,2795,3786,2796,3785,2798,3783,2801,3783,2804,3783,2806,3781,2808,3778,2811,3776,2814,3773,2817,3771,2818,3770,2820,3769,2826,3766,2830,3762,2833,3758,2836,3756,2840,3752,2842,3747,2843,3743,2845,3740,2847,3737,2848,3734,2848,3732,2848,3731,2849,3720,2849,3709,2849,3706,2848,3703,2847,3698,2847,3692,2847,3691,2847,3690,2845,3685,2841,3681,2839,3679,2839,3676,2840,3667,2833,3662,2833,3662,2832,3661,2830,3658,2829,3655,2829,3653,2828,3650,2828,3649,2827,3648,2824,3644,2821,3642,2821,3641,2820,3640,2820,3636,2820,3633,2820,3628,2819,3622,2819,3617,2822,3615,2826,3614,2830,3614,2836,3614,2841,3613,2842,3613,2843,3613,2846,3613,2847,3611,2850,3607,2853,3604,2854,3603,2855,3603,2861,3603,2868,3603,2887,3603,2907,3603,2908,3603,2909,3603,2923,3604,2936,3604,2946,3603,2955,3606,2956,3606,2956,3607,2957,3608,2958,3609,2959,3610,2959,3610,2961,3612,2962,3612,2968,3612,2974,3613,2985,3613,2995,3610,2996,3610,2996,3609,2997,3608,2999,3606,3e3,3606,3e3,3606,3001,3604,3003,3603,3007,3601,3011,3601,3016,3601,3020,3600,3023,3600,3024,3598,3027,3595,3032,3594,3037,3593,3038,3588,3039,3584,3039,3579,3039,3559,3039,3539,3039,3534,3038,3530,3038,3529,3037,3529,3036,3527,3036,3525,3037,3519,3033,3516,3033,3515,3032,3514,3031,3513,3030,3511,3028,3507,3029,3502,3029,3499,3029,3496,3029,3496,3030,3495,3031,3493,3031,3489,3031,3488,3031,3487,3033,3482,3033,3478,3033,3476,3033,3475,3033,3470,3034,3466,3034,3465,3035,3464,3037,3462,3039,3460,3040,3459,3040,3459,3042,3458,3043,3456,3043,3455,3043,3455,3048,3452,3049,3448,3050,3447,3050,3447,3052,3446,3053,3444,3057,3436,3066,3431,3069,3429,3073,3426,3074,3425,3074,3424,3077,3422,3079,3420,3081,3416,3084,3413,3085,3412,3086,3409,3086,3409,3086,3408,3090,3406,3090,3402,3090,3401,3090,3401,3091,3399,3091,3397,3092,3386,3092,3373,3092,3372,3092,3371,3093,3367,3096,3363,3096,3362,3097,3361,3100,3359,3101,3355,3101,3354,3101,3353,3102,3343,3102,3333,3102,3331,3101,3329,3101,3327,3101,3325,3101,3320,3101,3315,3100,3311,3100,3307,3099,3297,3092,3289,3091,3288,3090,3286,3090,3285,3090,3284,3088,3273,3089,3262,3089,3257,3089,3252,3089,3251,3089,3249,3090,3244,3090,3238,3090,3233,3091,3229,3092,3228,3092,3226,3093,3221,3096,3217,3097,3216,3097,3215,3099,3211,3101,3209,3102,3207,3103,3206,3104,3205,3105,3204,3109,3200,3111,3195,3112,3193,3114,3192,3114,3192,3116,3190,3117,3188,3121,3188,3125,3188,3127,3185,3128,3184,3129,3184,3130,3183,3132,3182,3140,3177,3149,3176,3150,3176,3150,3175,3152,3174,3153,3174,3157,3172,3158,3169,3159,3168,3159,3167,3160,3164,3161,3161,3161,3160,3161,3158,3161,3155,3163,3154,3163,3154,3163,3153,3163,3152,3165,3151,3171,3146,3174,3139,3175,3138,3175,3137,3179,3134,3180,3129,3181,3127,3182,3126,3182,3125,3182,3125,3183,3123,3183,3121,3183,3116,3183,3112,3173,3112,3167,3107,3167,3107,3166,3107,3165,3106,3164,3105,3163,3105,3162,3104,3157,3102,3152,3100,3150,3099,3148,3098,3145,3097,3142,3093,3140,3092,3137,3089,3137,3089,3136,3088,3135,3085,3133,3084,3131,3083,3129,3082,3126,3080,3122,3079,3120,3079,3119,3078,3117,3077,3116,3076,3112,3073,3109,3070,3108,3070,3107,3069,3103,3068,3098,3068,3093,3068,3091,3064,3086,3055,3080,3049,3078,3046,3073,3046,3068,3047,3064,3045,3063,3045,3063,3045,3058,3042,3055,3038,3052,3037,3048,3036,3047,3036,3045,3034,3041,3028,3038,3021,3037,3018,3035,3015,3029,3010,3027,3003,3027,3002,3026,3001,3025,2999,3024,2997,3023,2996,3022,2994,3016,2987,3014,2977,3013,2971,3009,2968,3005,2965,3002,2961,3e3,2958,2998,2955,2997,2954,2997,2952,2996,2950,2995,2947,2994,2946,2993,2945,2993,2944,2992,2943,2988,2940,2984,2937,2981,2934,2976,2934,2971,2933,2968,2931,2963,2928,2959,2925,2956,2922,2952,2916,2951,2915,2950,2914,2950,2913,2949,2912,2944,2905,2943,2896,2943,2895,2942,2895,2941,2894,2941,2892,2941,2891,2940,2890,2935,2882,2933,2873,2932,2865,2932,2856,2932,2855,2931,2853,2929,2848,2929,2841,2929,2840,2928,2839,2925,2836,2921,2833,2914,2829,2911,2821,2911,2819,2911,2817,2911,2813,2909,2811,2909,2810,2908,2810,2906,2807,2903,2804,2902,2804,2901,2803,2898,2801,2895,2799,2894,2799,2894,2799,2893,2798,2893,2797,2891,2796,2890,2794,2889,2791,2886,2788,2886,2788,2886,2787,2881,2776,2870,2773,2869,2772,2868,2772,2860,2771,2853,2766,2851,2764,2847,2762,2847,2762,2846,2761,2845,2760,2843,2759,2842,2759,2842,2758,2841,2757,2840,2757,2840,2756,2839,2755,2838,2754,2837,2753,2836,2752,2836,2751,2835,2747,2831,2744,2828,2741,2824,2738,2819,2734,2815,2729,2815,2728,2814,2727,2813,2725,2812,2721,2812,2720,2812,2719,2811,2717,2810,2713,2809,2710,2807,2707,2807,2707,2806,2706,2805,2701,2801,2697,2787,2692,2781,2679,2781,2679,2781,2678,2780,2674,2780,2670,2779,2666,2778,2664,2776,2659,2774,2654,2774,2653,2773,2652,2772,2647,2770,2642,2770,2640,2768,2637,2768,2636,2767,2636,2766,2634,2765,2631,2763,2628,2761,2626,2759,2625,2759,2623,2758,2621,2758,2618,2758,2618,2758,2617,2757,2612,2756,2608,2756,2606,2755,2604,2753,2602,2753,2599,2752,2597,2751,2595,2750,2595,2750,2594,2749,2593,2749,2589,2749,2588,2748,2588,2748,2587,2747,2586,2747,2585,2746,2584,2745,2583,2745,2582,2743,2580,2743,2576,2742,2575,2742,2574,2741,2569,2740,2565,2739,2564,2739,2563,2738,2563,2738,2562,2738,2558,2735,2555,2732,2552,2730,2548,2728,2545,2728,2543,2727,2542,2727,2540,2726,2535,2723,2532,2722,2531,2721,2530,2720,2529,2719,2526,2719,2526,2718,2525,2717,2521,2717,2517,2716,2515,2716,2513,2716,2510,2713,2507,2710,2505,2705,2500,2705,2499,2705,2499,2704,2494,2702,2489,2702,2488,2702,2486,2702,2483,2700,2481,2697,2478,2695,2475,2695,2474,2695,2473,2694,2469,2694,2465,2694,2459,2692,2457,2688,2453,2685,2446,2683,2442,2682,2435,2682,2435,2682,2434,2679,2429,2677,2427,2676,2426,2674,2425,2672,2422,2670,2417,2668,2414,2667,2409,2665,2401,2660,2397,2653,2390,2654,2379,2655,2376,2652,2375,2646,2375,2640,2375,2636,2376,2632,2377,2631,2377,2631,2377,2630,2378,2629,2378,2628,2379,2628,2379,2624,2385,2615,2384,2613,2384,2611,2384,2607,2385,2603,2385,2602,2385,2601,2386,2599,2387,2597,2388,2597,2389,2596,2389,2595,2392,2591,2392,2586,2392,2580,2391,2573,2391,2573,2397,2572,2399,2570,2400,2566,2401,2562,2401,2555,2401,2553,2405,2552,2406,2552,2406,2552,2410,2548,2412,2548,2412,2547,2413,2538,2416,2529,2413,2523,2411,2518,2405,2518,2405,2517,2404,2512,2404,2506,2404,2505,2404,2504,2403,2500,2401,2494,2402,2492,2402,2489,2401,2488,2401,2487,2400,2483,2398,2481,2396,2480,2395,2479,2394,2479,2393,2477,2393,2475,2392,2475,2391,2472,2387,2467,2385,2462,2383,2457,2384,2453,2385,2450,2383,2448,2382,2446,2381,2442,2378,2437,2375,2436,2375,2435,2375,2430,2374,2425,2374,2424,2374,2423,2374,2422,2373,2420,2373,2414,2373,2409,2372,2404,2370,2402,2368,2399,2365,2396,2364,2391,2364,2385,2364,2375,2363,2367,2368,2365,2370,2360,2372,2360,2372,2359,2372,2355,2375,2354,2380,2354,2381,2354,2382,2354,2383,2353,2383,2350,2386,2345,2387,2337,2388,2331,2385,2328,2379,2323,2375,2321,2374,2320,2373,2314,2366,2310,2357,2310,2356,2309,2355,2309,2350,2305,2347,2302,2344,2301,2341,2301,2340,2301,2339,2299,2337,2298,2336,2297,2335,2297,2335,2291,2334,2286,2331,2285,2329,2283,2328,2282,2327,2280,2325,2277,2321,2272,2321,2268,2321,2263,2320,2263,2320,2262,2320,2261,2319,2260,2319,2257,2316,2254,2314,2251,2310,2247,2310,2242,2309,2239,2307,2236,2305,2233,2302,2231,2301,2230,2300,2229,2299,2228,2299,2226,2297,2222,2297,2212,2298,2205,2293,2203,2292,2200,2292,2196,2291,2192,2289,2189,2287,2186,2285,2183,2282,2177,2282,2177,2282,2176,2281,2174,2280,2172,2279,2171,2278,2170,2278,2169,2278,2169,2278,2169,2277,2168,2277,2167,2276,2166,2275,2165,2275,2165,2274,2158,2271,2154,2266,2152,2264,2149,2262,2146,2260,2144,2257,2143,2256,2142,2255,2142,2255,2141,2254,2139,2254,2139,2252,2139,2250,2138,2250,2137,2250,2136,2249,2135,2246,2132,2244,2123,2237,2122,2228,2122,2227,2122,2227,2121,2227,2121,2225,2121,2221,2121,2216,2121,2212,2120,2210,2116,2206,2112,2201,2112,2201,2111,2200,2110,2199,2110,2198,2109,2195,2109,2193,2109,2186,2111,2179,2111,2179,2111,2178,2111,2175,2112,2171,2113,2166,2115,2162,2116,2160,2118,2158,2121,2154,2123,2151,2124,2151,2125,2150,2126,2150,2127,2149,2128,2148,2129,2148,2130,2147,2132,2146,2133,2144,2133,2144,2136,2143,2137,2141,2141,2138,2144,2135,2145,2134,2145,2133,2149,2130,2152,2126,2157,2119,2162,2113,2168,2106,2174,2099,2181,2091,2187,2086,2189,2085,2190,2084,2197,2078,2200,2068,2200,2067,2201,2066,2207,2060,2212,2054,2213,2053,2213,2052,2219,2048,2220,2039,2220,2035,2223,2032,2223,2032,2223,2031,2224,2027,2225,2023,2225,2022,2226,2021,2226,2020,2228,2017,2231,2016,2232,2014,2234,2014,2234,2013,2234,2012,2235,2011,2236,2010,2237,2007,2238,2002,2240,1997,2241,1995,2243,1993,2245,1990,2248,1987,2250,1986,2251,1986,2257,1980,2259,1971,2260,1970,2260,1969,2262,1965,2264,1962,2265,1961,2265,1960,2267,1958,2271,1954,2272,1953,2272,1952,2273,1950,2275,1948,2279,1946,2284,1943,2288,1940,2291,1938,2298,1932,2300,1923,2300,1922,2301,1921,2304,1913,2310,1905,2316,1899,2318,1890,2319,1889,2319,1887,2320,1886,2321,1884,2322,1883,2323,1882,2324,1881,2327,1880,2327,1880,2328,1879,2329,1879,2329,1878,2332,1876,2335,1872,2337,1869,2339,1865,L,2339,1865,Q,2340,1864,2341,1863,2342,1861,2344,1859,2349,1853,2356,1849,2357,1849,2357,1848,2365,1844,2371,1838,2376,1833,2382,1825,2386,1821,2392,1815,2393,1815,2393,1814,2394,1813,2395,1813,2397,1809,2400,1805,2402,1802,2405,1799,2414,1791,2420,1785,2422,1784,2424,1781,2430,1775,2434,1770,2436,1767,2439,1764,2442,1761,2446,1759,2451,1755,2455,1751,2456,1751,2456,1750,2456,1750,2457,1749,2459,1746,2461,1743,2464,1740,2467,1736,2471,1729,2478,1723,2486,1716,2492,1711,2492,1710,2493,1709,2494,1708,2495,1707,2498,1705,2501,1701,2508,1695,2514,1690,2515,1690,2515,1689,2518,1684,2523,1680,2527,1677,2529,1674,2530,1673,2531,1672,2538,1666,2545,1660,2546,1660,2547,1658,2552,1652,2558,1648,2559,1648,2559,1647,2569,1637,2580,1629,2581,1629,2582,1628,2587,1622,2591,1617,2592,1617,2593,1616,2595,1611,2600,1606,2602,1605,2602,1604,2607,1596,2613,1591,2620,1584,2626,1579,2633,1575,2638,1569,2639,1569,2639,1568,2646,1564,2649,1559,2649,1559,2650,1558,2656,1550,2662,1543,2666,1540,2668,1537,2669,1536,2670,1535,2671,1534,2671,1531,2671,1528,2673,1525,2674,1523,2675,1522,2678,1519,2682,1517,2683,1516,2683,1515,2684,1505,2685,1496,2682,1498,2679,1499,2675,1501,2672,1505,2671,1506,2670,1509,2669,1514,2666,1516,2665,1517,2664,1518,2663,1518,2662,1518,2661,1519,2660,1519,2657,1519,2653,1520,2649,1521,2645,1524,2644,1525,2642,1526,2639,1527,2637,1528,2635,1529,2632,1529,2627,1529,2625,1532,2624,1533,2624,1533,2622,1534,2621,1536,2621,1537,2620,1537,2618,1538,2617,1540,2617,1541,2616,1541,2607,1542,2597,1542,2578,1542,2559,1542,Q,2554,1542,2550,1542,Z]],label:"Gabú",shortLabel:"GB",labelPosition:[165.3,311.1],labelAlignment:[CEN,MID],nextId:"GW.GA.BE"},"GW.GA.BE":{outlines:[[M,3291,2943,Q,3290,2945,3286,2947,3281,2947,3278,2950,3277,2951,3277,2951,3274,2954,3274,2960,3274,2965,3273,2970,3273,2973,3272,2977,3272,2980,3270,2982,3269,2983,3267,2985,3267,2986,3266,2987,3265,2989,3263,2991,3263,2992,3263,2993,3262,3010,3262,3027,3262,3037,3256,3044,3254,3046,3253,3048,3251,3053,3251,3057,3251,3059,3251,3060,3249,3065,3250,3070,3250,3071,3249,3072,3248,3073,3248,3075,3248,3076,3246,3077,3244,3078,3242,3079,3240,3080,3238,3081,3235,3082,3234,3083,3233,3084,3233,3085,3231,3088,3229,3089,3221,3092,3213,3092,3212,3092,3210,3092,3208,3093,3207,3094,3203,3100,3197,3103,3196,3104,3196,3104,3195,3105,3194,3105,3192,3106,3192,3108,3192,3109,3191,3110,3189,3112,3186,3112,3184,3112,3183,3112,3183,3116,3183,3121,3183,3123,3182,3125,3182,3125,3182,3126,3181,3127,3180,3129,3179,3134,3175,3137,3175,3138,3174,3139,3171,3146,3165,3151,3163,3152,3163,3153,3163,3154,3163,3154,3161,3155,3161,3158,3161,3160,3161,3161,3160,3164,3159,3167,3159,3168,3158,3169,3157,3172,3153,3174,3152,3174,3150,3175,3150,3176,3149,3176,3140,3177,3132,3182,3130,3183,3129,3184,3128,3184,3127,3185,3125,3188,3121,3188,3117,3188,3116,3190,3114,3192,3114,3192,3112,3193,3111,3195,3109,3200,3105,3204,3104,3205,3103,3206,3102,3207,3101,3209,3099,3211,3097,3215,3097,3216,3096,3217,3093,3221,3092,3226,3092,3228,3091,3229,3090,3233,3090,3238,3090,3244,3089,3249,3089,3251,3089,3252,3089,3257,3089,3262,3088,3273,3090,3284,3090,3285,3090,3286,3091,3288,3092,3289,3099,3297,3100,3307,3100,3311,3101,3315,3101,3320,3101,3325,3101,3327,3101,3329,3102,3331,3102,3333,3102,3343,3101,3353,3101,3354,3101,3355,3100,3359,3097,3361,3096,3362,3096,3363,3093,3367,3092,3371,3092,3372,3092,3373,3092,3386,3091,3397,3091,3399,3090,3401,3090,3401,3090,3402,3090,3406,3086,3408,3086,3409,3086,3409,3085,3412,3084,3413,3081,3416,3079,3420,3077,3422,3074,3424,3074,3425,3073,3426,3069,3429,3066,3431,3057,3436,3053,3444,3052,3446,3050,3447,3050,3447,3049,3448,3048,3452,3043,3455,3043,3455,3043,3456,3042,3458,3040,3459,3040,3459,3039,3460,3037,3462,3035,3464,3034,3465,3034,3466,3033,3470,3033,3475,3033,3476,3033,3478,3033,3482,3031,3487,3031,3488,3031,3489,3031,3493,3030,3495,3029,3496,3029,3496,3029,3499,3029,3502,3028,3507,3030,3511,3031,3513,3032,3514,3033,3515,3033,3516,3037,3519,3036,3525,3036,3527,3037,3529,3038,3529,3038,3530,3039,3534,3039,3539,3039,3559,3039,3579,3039,3584,3038,3588,3037,3593,3032,3594,3027,3595,3024,3598,3023,3600,3020,3600,3016,3601,3011,3601,3007,3601,3003,3603,3001,3604,3e3,3606,3e3,3606,2999,3606,2997,3608,2996,3609,2996,3610,2995,3610,2985,3613,2974,3613,2968,3612,2962,3612,2961,3612,2959,3610,2959,3610,2958,3609,2957,3608,2956,3607,2956,3606,2955,3606,2946,3603,2936,3604,2923,3604,2909,3603,2908,3603,2907,3603,2887,3603,2868,3603,2861,3603,2855,3603,2854,3603,2853,3604,2850,3607,2847,3611,2846,3613,2843,3613,2842,3613,2841,3613,2836,3614,2830,3614,2826,3614,2822,3615,2819,3617,2819,3622,2820,3628,2820,3633,2820,3636,2820,3640,2821,3641,2821,3642,2824,3644,2827,3648,2828,3649,2828,3650,2829,3653,2829,3655,2830,3658,2832,3661,2833,3662,2833,3662,2840,3667,2839,3676,2839,3679,2841,3681,2845,3685,2847,3690,2847,3691,2847,3692,2847,3698,2848,3703,2849,3706,2849,3709,2849,3720,2848,3731,2848,3732,2848,3734,2847,3737,2845,3740,2843,3743,2842,3747,2840,3752,2836,3756,2833,3758,2830,3762,2826,3766,2820,3769,2818,3770,2817,3771,2814,3773,2811,3776,2808,3778,2806,3781,2804,3783,2801,3783,2798,3783,2796,3785,2795,3786,2794,3786,2789,3788,2785,3791,2782,3793,2781,3796,2780,3800,2779,3805,2779,3806,2779,3807,2777,3811,2775,3814,2773,3817,2771,3820,2770,3824,2769,3828,2769,3835,2774,3839,2776,3840,2776,3841,2777,3842,2778,3842,2779,3842,2779,3842,2784,3844,2790,3844,2790,3844,2791,3845,2794,3846,2796,3847,2797,3848,2797,3848,2800,3848,2803,3848,2805,3848,2807,3850,2810,3851,2814,3854,2814,3854,2816,3855,2817,3856,2818,3856,2824,3857,2828,3863,2832,3869,2838,3872,2839,3873,2839,3874,2839,3877,2840,3878,2840,3879,2840,3880,2840,3881,2841,3882,2841,3883,2841,3884,2841,3886,2842,3888,2842,3907,2842,3927,2842,3947,2841,3967,2841,3968,2840,3969,2838,3973,2836,3977,2835,3978,2835,3979,2833,3983,2829,3987,2827,3989,2826,3990,2824,3992,2821,3993,2816,3994,2813,3995,2810,3996,2808,3996,2805,3996,2802,3998,2800,3999,2798,4e3,2797,4e3,2796,4001,2796,4003,2794,4003,2793,4003,2792,4003,2784,4005,2774,4005,2754,4005,2735,4005,2715,4005,2695,4005,2690,4005,2688,4002,2687,4001,2686,4e3,2686,4e3,2686,3999,2684,3998,2682,3997,2681,3997,2680,3997,2676,3995,2670,3996,2666,3996,2666,4001,2666,4006,2664,4009,2663,4010,2663,4011,2661,4015,2658,4019,2657,4021,2655,4023,2654,4026,2652,4029,2650,4034,2650,4039,2649,4059,2651,4078,2651,4079,2651,4079,2652,4084,2654,4088,2655,4090,2657,4091,2658,4092,2659,4093,2660,4094,2660,4096,2662,4104,2662,4113,2662,4120,2662,4127,L,2662,4128,Q,2662,4142,2661,4155,2661,4157,2661,4158,2661,4161,2659,4163,2658,4163,2657,4165,2657,4166,2656,4167,2652,4170,2652,4175,2652,4176,2651,4177,2651,4178,2651,4179,2651,4185,2650,4191,2650,4192,2650,4192,2649,4194,2647,4196,2645,4198,2644,4200,2640,4204,2638,4208,2637,4208,2637,4208,2633,4210,2629,4213,2625,4215,2624,4220,2624,4221,2623,4221,2621,4225,2619,4227,2617,4230,2615,4234,2613,4241,2610,4247,2609,4248,2609,4249,2606,4258,2601,4265,2601,4266,2600,4266,2600,4267,2599,4268,2598,4268,2597,4269,2596,4270,2595,4271,2595,4272,2593,4271,2590,4271,2589,4273,2589,4274,2587,4274,2582,4275,2579,4278,2579,4279,2578,4279,2573,4281,2569,4282,2566,4283,2564,4284,2562,4285,2562,4285,2561,4286,2560,4286,2557,4288,2552,4290,2545,4294,2538,4300,2533,4306,2528,4312,2528,4313,2527,4313,2520,4321,2513,4328,2512,4329,2511,4330,2507,4332,2503,4335,2501,4337,2498,4339,2498,4340,2497,4341,2497,4341,2496,4342,2493,4345,2489,4347,2484,4349,2481,4354,2480,4356,2478,4357,2477,4358,2477,4359,2476,4360,2474,4361,2473,4361,2472,4362,2471,4363,2470,4364,2469,4365,2468,4366,2466,4371,2463,4375,2463,4376,2462,4376,2461,4377,2461,4378,2457,4382,2454,4383,2453,4384,2451,4384,2443,4384,2434,4384,2433,4384,2432,4385,2427,4386,2425,4391,2425,4392,2425,4392,2422,4394,2420,4395,2418,4396,2417,4396,2407,4397,2397,4397,2393,4397,2391,4394,2389,4392,2387,4390,2387,4389,2386,4388,2381,4386,2377,4386,2362,4386,2347,4386,2341,4386,2337,4382,2336,4382,2335,4381,2335,4381,2335,4380,2333,4378,2331,4376,2331,4376,2330,4375,2317,4375,2304,4375,2304,4375,2303,4374,2300,4374,2298,4371,2297,4371,2297,4370,2296,4368,2295,4366,2293,4363,2289,4364,2283,4364,2279,4362,2277,4361,2277,4360,2275,4357,2271,4355,2271,4354,2269,4354,2265,4354,2261,4353,L,2260,4352,Q,2260,4352,2259,4351,2258,4351,2258,4351,2257,4349,2255,4347,2254,4347,2253,4346,2252,4345,2250,4345,2239,4346,2234,4338,2230,4331,2220,4332,2216,4331,2214,4328,2214,4327,2213,4326,2212,4325,2211,4324,2211,4324,2210,4323,2209,4321,2208,4321,2206,4317,2204,4314,2203,4313,2202,4312,2199,4307,2195,4306,2192,4304,2189,4302,2188,4301,2187,4300,2183,4296,2181,4293,2179,4291,2178,4290,2177,4289,2176,4288,2174,4286,2171,4285,2169,4283,2168,4280,2167,4277,2166,4275,2164,4273,2163,4270,2160,4267,2157,4264,2150,4257,2140,4252,2140,4252,2139,4252,2134,4250,2132,4245,2132,4244,2131,4244,2129,4243,2129,4242,2128,4241,2127,4240,2120,4233,2113,4228,2111,4227,2110,4226,2109,4225,2109,4225,2108,4224,2108,4223,2107,4219,2105,4215,2105,4215,2105,4214,2102,4204,2098,4198,2096,4195,2092,4192,2086,4189,2080,4184,2080,4184,2080,4183,2077,4181,2074,4176,2074,4175,2073,4175,2069,4169,2062,4166,2061,4165,2060,4165,2057,4165,2054,4169,2052,4171,2049,4172,2048,4172,2047,4173,2046,4173,2045,4174,2044,4174,2043,4174,2040,4174,2038,4176,2038,4177,2038,4178,2032,4183,2023,4187,2023,4187,2022,4188,2021,4189,2018,4189,2012,4190,2008,4191,2005,4192,2003,4195,1999,4199,1996,4200,1995,4200,1994,4200,1989,4202,1987,4205,1983,4209,1977,4209,1974,4209,1972,4210,1971,4210,1969,4210,1965,4211,1963,4213,1960,4216,1956,4217,1951,4218,1947,4218,1946,4218,1945,4219,1942,4221,1940,4223,1939,4224,1937,4224,1935,4225,1933,4225,1929,4226,1925,4226,1923,4226,1922,4226,1921,4227,1919,4227,1908,4227,1898,4227,L,1897,4226,Q,1894,4224,1892,4220,1890,4217,1889,4215,1888,4214,1886,4214,1866,4214,1846,4214,1827,4214,1808,4214,1801,4214,1796,4215,1794,4216,1791,4217,1791,4217,1791,4218,1789,4222,1789,4226,1789,4229,1789,4231,1788,4232,1788,4234,1786,4240,1782,4243,1782,4244,1781,4245,1781,4265,1781,4285,1781,4289,1780,4293,1780,4294,1780,4295,1778,4298,1777,4300,1776,4301,1774,4303,1772,4304,1772,4305,1771,4308,1770,4310,1769,4313,1769,4317,1769,4318,1768,4318,1763,4325,1760,4333,1760,4333,1760,4334,1757,4338,1754,4342,1753,4343,1752,4346,1750,4351,1748,4357,1747,4358,1747,4359,1742,4363,1743,4371,1743,4371,1742,4372,1741,4375,1740,4377,1739,4378,1739,4378,1738,4379,1738,4380,1736,4381,1736,4381,1732,4384,1728,4387,1728,4387,1727,4388,1725,4393,1719,4396,1711,4399,1702,4402,1701,4403,1700,4403,1696,4404,1692,4404,1691,4403,1690,4404,1686,4408,1682,4412,1680,4413,1677,4412,1675,4412,1674,4413,1673,4413,1671,4413,1651,4413,1632,4413,1612,4413,1592,4413,1592,4413,1591,4412,1588,4410,1585,4407,1581,4405,1576,4405,1575,4405,1574,4405,1570,4404,1566,4402,1565,4402,1565,4402,1563,4401,1561,4398,1560,4398,1560,4398,1557,4398,1557,4397,1556,4397,1555,4396,1551,4395,1545,4394,1544,4394,1543,4393,1541,4392,1540,4391,1536,4390,1533,4387,1533,4386,1532,4386,1530,4385,1528,4382,1528,4382,1527,4381,1524,4379,1524,4375,1523,4374,1523,4373,1520,4368,1516,4364,1513,4362,1512,4360,1511,4355,1511,4350,1511,4348,1511,4347,1513,4342,1516,4340,1519,4337,1519,4331,1518,4328,1520,4326,1526,4322,1528,4315,1529,4314,1529,4313,1528,4310,1529,4309,1530,4309,1530,4307,1529,4297,1531,4287,1531,4286,1532,4285,1538,4281,1542,4274,1542,4274,1543,4272,1545,4262,1540,4253,1539,4251,1537,4249,1537,4249,1536,4248,1531,4247,1528,4243,1525,4239,1525,4234,1525,4234,1525,4233,1524,4227,1522,4222,1522,4221,1521,4220,1519,4215,1513,4216,1513,4216,1512,4216,1502,4215,1492,4215,1491,4215,1489,4215,1481,4214,1474,4216,1473,4216,1473,4216,1469,4221,1464,4224,1464,4225,1463,4225,1462,4225,1461,4225,1456,4225,1453,4226,1452,4227,1451,4227,1447,4228,1443,4232,1443,4233,1442,4234,1438,4236,1433,4237,1433,4237,1432,4237,1428,4239,1425,4241,1423,4243,1422,4246,1419,4249,1417,4252,1416,4253,1416,4254,1415,4255,1415,4256,1414,4257,1414,4258,1413,4262,1412,4265,1411,4269,1407,4270,1406,4271,1405,4271,1404,4273,1402,4275,1402,4276,1401,4276,1399,4280,1396,4282,1393,4285,1389,4287,1387,4288,1385,4290,1383,4292,1378,4293,1373,4295,1372,4299,1371,4301,1370,4304,1370,4304,1370,4305,1369,4308,1368,4313,1367,4314,1367,4315,1364,4320,1361,4323,1356,4328,1351,4332,1349,4334,1347,4337,1344,4339,1341,4342,1341,4343,1340,4344,1339,4345,1339,4346,1337,4348,1334,4351,1332,4353,1329,4355,1327,4356,1326,4358,1325,4360,1323,4361,1319,4364,1315,4366,1313,4367,1313,4368,1313,4370,1312,4371,1311,4372,1311,4373,1310,4374,1309,4376,1303,4383,1298,4390,1298,4391,1297,4392,1295,4393,1293,4394,1293,4394,1292,4395,1288,4396,1287,4400,1286,4402,1286,4403,1286,4409,1283,4414,1281,4417,1279,4422,1279,4423,1278,4424,1277,4426,1276,4428,1275,4431,1275,4434,1273,4439,1272,4445,1271,4448,1270,4452,1269,4461,1269,4471,1269,4476,1271,4480,1272,4483,1273,4487,1273,4487,1273,4488,1275,4490,1278,4490,1281,4490,1282,4492,1284,4495,1286,4496,1287,4496,1288,4496,1291,4496,1293,4497,1297,4498,1299,4499,1301,4500,1302,4502,1303,4503,1304,4503,1307,4505,1312,4505,1332,4506,1352,4506,1354,4506,1356,4506,1357,4510,1361,4512,1362,4512,1363,4512,1368,4514,1370,4519,1371,4520,1372,4521,1377,4528,1379,4537,1379,4538,1380,4538,1380,4539,1380,4540,1382,4543,1384,4545,1387,4548,1390,4552,1394,4556,1399,4559,1400,4560,1400,4560,1401,4562,1402,4562,1403,4563,1403,4564,1409,4571,1419,4572,1421,4573,1424,4573,1426,4573,1428,4572,1435,4565,1446,4565,1451,4565,1454,4562,1458,4559,1461,4556,1461,4556,1462,4555,1465,4549,1472,4549,1475,4549,1477,4548,1479,4548,1480,4548,1483,4547,1486,4547,1491,4546,1494,4544,1497,4541,1502,4541,1519,4541,1536,4541,1539,4542,1539,4545,1541,4551,1544,4555,1544,4556,1545,4556,1548,4559,1550,4561,1550,4562,1550,4562,1551,4565,1551,4568,1551,4573,1552,4577,1552,4580,1555,4580,1555,4580,1555,4581,1557,4587,1560,4593,1561,4596,1562,4600,1562,4604,1562,4607,1563,4610,1563,4613,1564,4615,1564,4617,1564,4620,1564,4623,1564,4627,1565,4629,1566,4631,1566,4632,1566,4635,1566,4639,1567,4644,1567,4650,1567,4666,1567,4681,1566,4683,1567,4685,1567,4689,1571,4692,1572,4694,1572,4697,1571,4701,1568,4702,1568,4703,1567,4703,1563,4704,1559,4704,1553,4704,1549,4705,1544,4707,1542,4712,1541,4713,1539,4714,1533,4715,1525,4715,1519,4715,1516,4718,1516,4719,1515,4720,1515,4722,1512,4723,1509,4724,1506,4724,1506,4724,1505,4724,1500,4725,1494,4724,1491,4724,1489,4727,1489,4728,1488,4728,1486,4733,1482,4735,1478,4736,1473,4736,1462,4736,1451,4736,1449,4738,1447,4740,1446,4742,1445,4742,1442,4743,1439,4744,1438,4745,1437,4745,1428,4745,1419,4746,1418,4746,1418,4747,1416,4748,1412,4747,1407,4747,1403,4748,1398,4749,1397,4752,1395,4758,1389,4757,1385,4757,1380,4757,1372,4757,1363,4757,1357,4757,1355,4763,1354,4766,1351,4768,1347,4769,1342,4769,1335,4769,1328,4770,1327,4770,1326,4770,1322,4774,1320,4777,1319,4779,1316,4778,1310,4778,1306,4781,1304,4783,1300,4785,1299,4786,1297,4787,1293,4788,1290,4791,1289,4792,1288,4792,1287,4793,1286,4794,1281,4797,1275,4802,1275,4803,1274,4803,1269,4805,1267,4809,1266,4819,1265,4829,1265,4835,1266,4841,1267,4842,1267,4843,1267,4848,1268,4853,1269,4854,1269,4855,1270,4857,1271,4858,1272,4859,1272,4861,1273,4863,1275,4864,1275,4870,1278,4873,1281,4877,1283,4881,1283,4882,1284,4883,1284,4884,1286,4885,1287,4885,1287,4886,1288,4886,1289,4886,1300,4887,1308,4885,1313,4884,1314,4881,1314,4880,1315,4879,1316,4877,1319,4875,1323,4873,1327,4871,1333,4868,1336,4861,1337,4860,1337,4859,1337,4856,1339,4855,1339,4854,1340,4854,1341,4852,1343,4852,1345,4852,1346,4852,1350,4851,1354,4849,1355,4849,1355,4848,1359,4847,1362,4843,1364,4840,1367,4838,1371,4836,1373,4833,1374,4832,1375,4831,1376,4829,1378,4828,1381,4825,1387,4825,1392,4824,1395,4821,1397,4818,1399,4817,1403,4815,1408,4814,1410,4814,1412,4814,1413,4813,1415,4813,1417,4813,1418,4813,1423,4812,1426,4808,1428,4806,1433,4805,1434,4805,1434,4805,1439,4805,1443,4804,1448,4804,1448,4810,1447,4813,1448,4816,1450,4820,1453,4824,1453,4825,1454,4825,1457,4829,1460,4832,1463,4836,1467,4840,1469,4842,1472,4844,1476,4848,1480,4851,1482,4854,1482,4858,1482,4859,1482,4860,1484,4865,1487,4870,1488,4871,1489,4872,1489,4873,1490,4874,1493,4877,1499,4880,1500,4880,1501,4882,1503,4887,1503,4891,1505,4895,1508,4899,1508,4900,1509,4901,1510,4902,1512,4904,1513,4906,1514,4907,1514,4908,1515,4909,1516,4913,1516,4918,1516,4919,1517,4920,1518,4922,1519,4924,1521,4927,1521,4930,1521,4933,1522,4935,1524,4939,1526,4941,1527,4942,1527,4942,1529,4947,1530,4951,1531,4952,1531,4953,1531,4954,1531,4954,1532,4955,1533,4958,1536,4959,1539,4962,1540,4962,1540,4963,1542,4965,1542,4967,1542,4969,1544,4971,1545,4972,1545,4973,1546,4974,1547,4975,1548,4975,1549,4977,1549,4978,1550,4979,1552,4980,1552,4984,1551,4988,1552,4989,1553,4989,1553,4990,1553,4994,1556,4995,1558,4995,1559,4996,1564,4999,1563,5005,1561,5015,1567,5022,1568,5024,1568,5024,1572,5029,1577,5032,1578,5032,1578,5033,1577,5042,1579,5052,1579,5052,1579,5053,1583,5057,1584,5060,1585,5061,1585,5062,1585,5069,1584,5075,1584,5076,1583,5076,1581,5078,1579,5079,1574,5081,1573,5086,1572,5090,1571,5094,1571,5095,1571,5096,1571,5098,1570,5101,1570,5101,1570,5102,1570,5104,1568,5106,1567,5106,1567,5106,1566,5108,1565,5109,1565,5110,1565,5111,1565,5117,1561,5121,1557,5125,1554,5128,1553,5130,1551,5131,1550,5132,1550,5134,1550,5136,1550,5137,1549,5138,1549,5139,1549,5156,1550,5173,1551,5178,1553,5179,1555,5182,1557,5185,1559,5186,1560,5189,1560,5193,1560,5197,1560,5198,1559,5198,1557,5201,1552,5205,1551,5206,1551,5207,1551,5210,1551,5213,1550,5217,1550,5222,1550,5226,1550,5230,1549,5231,1549,5232,1548,5236,1545,5239,1545,5240,1544,5241,1542,5244,1542,5248,1541,5252,1539,5256,1538,5256,1537,5257,1534,5260,1532,5263,1532,5265,1531,5266,1530,5267,1530,5268,1528,5270,1525,5273,1521,5277,1517,5280,1513,5285,1506,5288,1505,5291,1503,5293,1503,5293,1502,5294,1500,5298,1497,5300,1492,5303,1492,5308,1491,5311,1489,5313,1488,5314,1488,5316,1488,5316,1487,5316,1482,5318,1480,5322,1480,5323,1479,5323,1476,5325,1474,5329,1473,5330,1472,5330,1469,5333,1467,5336,1467,5337,1467,5337,1466,5339,1465,5339,1464,5341,1463,5342,1463,5344,1461,5346,1459,5347,1458,5350,1453,5353,1450,5356,1446,5359,1443,5362,1443,5362,1443,5363,1441,5368,1441,5373,1441,5374,1440,5374,1436,5381,1431,5389,1429,5392,1428,5396,1428,5397,1427,5397,1425,5400,1423,5402,1422,5402,1421,5403,1421,5403,1420,5403,1419,5407,1416,5409,1415,5410,1413,5412,1407,5417,1403,5423,1402,5424,1402,5425,1401,5428,1399,5431,1398,5432,1398,5432,1397,5440,1392,5445,1390,5448,1387,5450,1385,5451,1384,5453,1383,5454,1383,5454,1379,5456,1375,5459,1371,5462,1370,5466,1370,5467,1369,5469,1369,5470,1369,5470,1367,5474,1365,5479,1363,5483,1360,5487,1360,5487,1359,5487,1357,5488,1354,5490,1351,5494,1350,5499,1350,5502,1350,5505,1346,5510,1342,5515,1341,5515,1341,5517,1341,5520,1339,5522,1339,5523,1339,5524,1338,5529,1335,5531,1328,5537,1322,5544,1322,5545,1321,5546,1320,5548,1320,5551,1320,5556,1316,5558,1315,5558,1315,5559,1312,5561,1311,5566,1311,5569,1310,5572,1309,5577,1304,5581,1301,5583,1299,5584,1296,5586,1294,5591,1292,5594,1290,5595,1289,5596,1288,5597,1287,5598,1286,5598,1286,5599,1286,5599,1285,5603,1284,5605,1283,5605,1283,5606,1284,5609,1283,5610,1282,5610,1282,5611,1281,5614,1280,5616,1278,5619,1275,5622,1275,5622,1274,5623,1269,5629,1262,5633,1260,5635,1259,5637,1257,5642,1254,5645,1253,5645,1251,5646,1247,5648,1245,5652,1244,5653,1242,5655,1239,5658,1238,5661,1237,5663,1236,5664,1235,5664,1233,5665,1230,5667,1227,5669,1224,5672,1222,5674,1221,5674,1221,5675,1220,5678,1219,5682,1219,5683,1219,5684,1219,5685,1218,5686,1218,5688,1217,5689,1215,5693,1211,5694,1208,5695,1207,5695,1205,5696,1203,5696,1198,5696,1195,5700,1192,5703,1188,5705,1187,5705,1187,5705,1184,5705,1182,5706,1177,5706,1175,5710,1174,5711,1174,5711,1167,5719,1156,5718,1152,5717,1150,5718,1148,5720,1146,5721,1145,5721,1144,5722,1139,5727,1131,5727,1123,5727,1116,5728,1116,5728,1115,5728,1109,5729,1105,5732,1102,5734,1097,5735,1096,5735,1095,5735,1089,5740,1086,5745,1085,5747,1084,5749,1082,5752,1082,5757,1082,5758,1081,5759,1081,5760,1081,5761,1080,5762,1080,5763,1079,5773,1079,5783,1079,5793,1078,5803,1077,5804,1077,5806,1076,5808,1076,5811,1075,5820,1072,5829,1071,5830,1071,5830,1069,5834,1069,5839,1070,5847,1070,5855,1070,5860,1067,5863,1065,5867,1062,5871,1060,5874,1060,5878,1060,5879,1060,5880,1060,5886,1060,5892,1060,5898,1060,5903,1059,5904,1059,5905,1059,5909,1057,5912,1054,5916,1052,5920,1051,5924,1050,5929,1050,5930,1049,5930,1047,5934,1042,5935,1042,5936,1041,5936,1039,5937,1035,5938,1035,5938,1034,5939,1032,5943,1028,5944,1027,5944,1026,5944,1026,5944,1025,5944,1020,5944,1016,5945,1011,5947,1005,5946,985,5946,966,5946,959,5946,955,5950,954,5953,951,5953,946,5955,941,5955,929,5955,918,5957,917,5957,915,5958,912,5960,910,5964,908,5968,903,5968,898,5967,895,5971,893,5974,889,5976,888,5977,887,5978,885,5980,883,5982,882,5983,880,5984,879,5984,877,5985,877,5985,876,5985,872,5986,869,5986,868,5986,868,5986,862,5988,861,5993,861,5993,860,5994,859,5995,857,5998,855,6e3,853,6002,850,6004,846,6004,845,6004,844,6004,838,6004,833,6005,827,6007,822,6007,802,6007,782,6007,764,6007,746,6006,L,746,6005,Q,745,6001,743,5999,739,5995,734,5996,728,5995,722,5995,723,5997,723,6001,722,6007,722,6012,722,6013,722,6013,721,6019,722,6023,723,6024,723,6025,724,6027,725,6028,728,6031,730,6036,730,6036,730,6037,731,6041,731,6045,731,6051,731,6056,732,6062,735,6065,736,6066,737,6067,741,6071,740,6077,740,6081,741,6084,743,6086,743,6088,744,6090,745,6091,746,6092,746,6092,748,6093,748,6094,749,6098,749,6103,748,6107,750,6110,751,6111,753,6113,757,6117,759,6121,761,6125,761,6132,763,6135,765,6139,766,6140,766,6141,767,6147,771,6149,772,6150,772,6150,773,6152,773,6152,775,6154,776,6156,776,6158,777,6158,778,6160,780,6163,783,6168,782,6175,782,6176,783,6176,783,6177,784,6178,785,6179,785,6179,787,6181,788,6182,791,6185,795,6190,798,6193,804,6194,809,6194,812,6196,813,6196,813,6196,816,6196,818,6198,818,6199,818,6200,822,6204,824,6208,824,6209,825,6209,827,6210,830,6212,836,6215,839,6220,840,6222,840,6225,840,6225,840,6226,840,6230,842,6233,842,6236,844,6239,845,6240,847,6241,848,6241,849,6243,850,6243,851,6244,852,6245,853,6246,854,6247,855,6249,857,6253,861,6255,862,6256,863,6256,869,6257,870,6263,870,6264,870,6264,870,6266,870,6267,871,6271,871,6275,871,6277,872,6278,873,6279,873,6280,873,6281,873,6281,875,6282,876,6283,877,6283,878,6283,884,6284,890,6284,891,6284,892,6284,894,6282,897,6282,900,6281,902,6280,904,6279,907,6279,909,6279,910,6278,912,6276,915,6275,916,6275,918,6274,919,6273,922,6271,926,6268,931,6266,932,6266,932,6266,934,6263,936,6262,936,6261,937,6261,939,6257,945,6256,953,6254,958,6249,959,6247,962,6247,963,6247,965,6247,970,6246,973,6244,975,6244,976,6243,977,6243,977,6242,980,6241,982,6239,984,6236,989,6235,990,6235,990,6235,992,6234,995,6233,997,6233,998,6232,999,6232,999,6231,1007,6225,1016,6221,1021,6219,1026,6217,1027,6217,1027,6216,1030,6213,1033,6211,1039,6206,1048,6204,1054,6203,1059,6200,1062,6199,1064,6198,1066,6197,1069,6195,1072,6193,1077,6190,1082,6187,1087,6186,1092,6184,1095,6181,L,1095,6180,Q,1096,6178,1097,6177,1097,6176,1098,6175,1099,6175,1100,6174,1102,6173,1104,6172,1105,6172,1106,6171,1108,6171,1109,6169,1110,6168,1112,6167,1116,6166,1119,6164,1120,6162,1122,6162,1123,6161,1123,6161,1124,6159,1127,6159,1129,6159,1131,6159,1135,6156,1139,6156,1140,6156,1140,6156,1144,6154,1149,6152,1153,6149,1157,6147,1158,6146,1158,6145,1167,6141,1174,6137,1177,6136,1179,6134,1184,6132,1187,6131,1188,6130,1190,6128,1197,6122,1207,6118,1211,6117,1214,6115,1222,6109,1231,6106,1232,6105,1233,6105,1238,6103,1242,6101,1249,6098,1256,6095,1261,6092,1265,6090,1266,6090,1266,6089,1269,6086,1274,6084,1275,6084,1277,6083,1278,6082,1279,6081,1282,6079,1286,6077,1287,6077,1287,6076,1288,6075,1289,6075,1294,6072,1298,6069,1298,6068,1299,6068,1300,6068,1302,6067,1305,6065,1310,6064,1315,6062,1320,6061,1323,6061,1328,6058,1332,6056,1334,6054,1337,6050,1341,6048,1342,6047,1342,6047,1347,6046,1350,6042,1354,6037,1358,6031,1363,6025,1369,6018,1370,6017,1370,6016,1372,6013,1375,6010,1378,6008,1380,6005,1381,6004,1381,6004,1386,5998,1390,5994,1390,5993,1390,5993,1393,5991,1393,5989,1393,5987,1393,5987,1394,5986,1394,5986,1401,5980,1403,5970,1404,5968,1405,5967,1406,5966,1408,5964,1409,5962,1410,5960,1411,5958,1412,5956,1412,5955,1412,5955,1413,5954,1413,5953,1414,5952,1416,5950,1424,5944,1428,5934,1429,5933,1430,5932,1434,5929,1437,5926,1443,5918,1446,5909,1446,5909,1447,5908,1447,5907,1448,5906,1448,5906,1449,5905,1454,5903,1456,5896,1456,5895,1457,5894,1459,5892,1463,5889,1467,5884,1470,5879,1470,5878,1471,5877,1472,5876,1473,5873,1476,5868,1478,5861,1479,5858,1482,5856,1482,5856,1482,5855,1490,5851,1492,5841,1492,5840,1493,5840,1496,5835,1500,5833,1501,5832,1502,5831,1505,5826,1508,5821,1509,5820,1510,5818,1512,5816,1515,5814,1518,5812,1521,5808,1525,5800,1532,5793,1534,5788,1536,5784,1537,5783,1537,5783,1540,5779,1540,5774,1540,5773,1540,5772,1541,5771,1542,5769,1543,5768,1543,5768,1547,5764,1549,5761,1550,5759,1551,5758,1554,5756,1554,5755,1555,5753,1557,5750,1558,5750,1558,5749,1563,5746,1565,5740,1567,5736,1569,5733,1571,5731,1574,5727,1580,5721,1583,5714,1584,5713,1584,5712,1590,5705,1593,5698,1595,5696,1597,5694,1601,5691,1604,5688,1605,5687,1605,5686,1606,5683,1609,5680,1610,5677,1611,5676,1613,5675,1613,5673,1619,5664,1623,5656,1623,5655,1624,5655,1625,5653,1625,5651,1626,5650,1626,5649,1628,5649,1628,5646,1628,5645,1628,5645,1630,5643,1631,5641,1632,5641,1632,5640,1633,5639,1634,5637,1634,5635,1635,5634,1636,5633,1637,5632,1639,5627,1643,5626,1644,5626,1644,5625,1645,5623,1647,5623,1652,5623,1657,5624,1661,5624,1663,5628,1666,5633,1670,5637,1672,5640,1673,5641,1673,5642,1674,5643,1675,5644,1676,5645,1676,5646,1677,5646,1679,5647,1681,5649,1683,5650,1684,5650,1687,5652,1690,5655,1692,5657,1694,5658,1702,5663,1707,5669,1710,5672,1714,5674,1715,5675,1716,5675,1719,5677,1724,5678,1725,5678,1725,5679,1726,5679,1727,5680,1728,5680,1729,5682,1730,5684,1732,5685,1734,5687,1738,5687,1742,5686,1747,5687,1750,5687,1752,5686,1752,5685,1753,5685,1756,5684,1757,5683,1761,5680,1766,5677,1767,5677,1767,5676,1769,5674,1774,5672,1780,5672,1782,5669,1783,5667,1786,5665,1787,5663,1788,5663,1794,5662,1799,5660,1806,5658,1812,5655,1813,5655,1813,5655,1815,5654,1815,5654,1817,5652,1822,5652,1823,5652,1823,5652,1828,5651,1833,5650,1838,5649,1840,5646,1841,5645,1842,5644,1843,5643,1845,5641,1847,5639,1850,5639,1863,5639,1876,5639,1895,5639,1914,5638,1924,5638,1932,5640,1936,5640,1939,5643,1940,5644,1940,5644,1941,5645,1942,5645,1944,5647,1945,5648,1947,5649,1949,5649,1954,5649,1959,5650,1964,5652,1969,5652,1971,5652,1973,5653,1978,5654,1983,5656,1984,5656,1984,5656,1988,5659,1992,5661,1994,5662,1997,5662,1998,5662,1998,5662,2003,5663,2006,5666,2008,5667,2009,5667,2015,5669,2018,5671,2019,5672,2020,5672,2024,5677,2033,5677,2035,5677,2036,5678,2038,5678,2041,5679,2042,5679,2043,5680,2045,5682,2047,5683,2050,5685,2055,5685,2062,5685,2066,5690,2070,5696,2080,5698,2082,5698,2082,5698,2087,5702,2091,5705,2092,5705,2092,5706,2094,5708,2097,5709,2099,5709,2101,5710,2108,5715,2115,5720,2116,5721,2117,5721,2128,5721,2138,5721,2143,5721,2147,5720,2148,5720,2149,5719,2153,5717,2156,5714,2157,5713,2158,5713,2160,5713,2161,5712,2166,5710,2174,5711,2183,5712,2187,5707,2189,5705,2193,5702,2201,5701,2210,5701,2212,5701,2215,5701,2219,5700,2224,5700,2225,5700,2226,5699,2230,5698,2235,5697,2236,5697,2236,5696,2240,5694,2242,5690,2243,5690,2243,5690,2261,5688,2278,5689,2281,5689,2285,5689,2289,5690,2293,5690,2295,5690,2296,5691,2300,5692,2303,5694,2304,5695,2307,5697,2311,5700,2317,5700,2326,5700,2335,5700,2336,5700,2337,5700,2342,5700,2346,5703,2349,5705,2352,5708,2354,5709,2355,5710,2359,5711,2362,5714,2365,5716,2369,5719,2374,5722,2381,5727,2383,5730,2387,5732,2391,5734,2394,5738,2397,5744,2401,5750,2403,5753,2405,5756,2405,5761,2409,5761,2413,5767,2417,5770,2421,5774,2424,5778,2428,5783,2432,5787,2433,5789,2435,5791,2440,5794,2444,5797,2447,5800,2451,5804,2451,5804,2451,5805,2453,5806,2453,5807,2455,5810,2458,5813,2462,5817,2465,5820,2465,5821,2466,5822,2467,5823,2467,5823,2472,5827,2474,5831,2476,5834,2478,5836,2480,5838,2482,5839,2483,5840,2483,5840,2484,5841,2485,5842,2487,5843,2488,5844,2489,5844,2490,5845,2495,5848,2501,5853,L,2503,5854,Q,2504,5854,2506,5855,2507,5855,2507,5856,2514,5858,2521,5858,2526,5858,2529,5858,2530,5859,2531,5859,2533,5860,2534,5860,2538,5862,2541,5866,2544,5869,2549,5871,2551,5872,2554,5871,2560,5871,2565,5874,2566,5875,2566,5876,2569,5880,2574,5880,2577,5880,2579,5881,2580,5881,2580,5881,2584,5880,2585,5883,2587,5886,2591,5888,2592,5889,2592,5889,2596,5890,2599,5890,2610,5891,2617,5887,2618,5887,2618,5886,2619,5882,2622,5881,2623,5881,2624,5881,2626,5881,2628,5879,2628,5879,2628,5878,2629,5877,2630,5876,2630,5873,2632,5872,2633,5871,2634,5870,2638,5869,2640,5867,2642,5865,2643,5863,2644,5863,2644,5862,2647,5859,2652,5858,2657,5857,2661,5855,2664,5854,2667,5850,2669,5848,2671,5847,2675,5846,2677,5844,2680,5842,2681,5840,2684,5836,2689,5834,2695,5832,2701,5830,2702,5830,2702,5830,2704,5826,2708,5823,2709,5822,2710,5821,2712,5820,2713,5819,2713,5818,2716,5818,2718,5818,2719,5817,2720,5817,2720,5816,2724,5814,2727,5810,2728,5809,2728,5809,2729,5807,2731,5806,2736,5804,2741,5802,2745,5801,2747,5799,2748,5798,2749,5797,2756,5792,2766,5790,2767,5790,2768,5790,2770,5789,2771,5789,2774,5788,2776,5786,2779,5784,2781,5782,2785,5779,2790,5778,2791,5778,2792,5777,2797,5776,2800,5774,2805,5771,2811,5769,2812,5769,2812,5768,2814,5767,2817,5767,2821,5767,2824,5764,2825,5764,2826,5763,2827,5763,2828,5762,2829,5761,2830,5761,2839,5758,2847,5756,2848,5756,2849,5755,2853,5753,2858,5751,2861,5749,2864,5748,2868,5747,2872,5746,2873,5746,2873,5746,2880,5745,2887,5745,2890,5745,2894,5744,2898,5743,2903,5742,2904,5742,2904,5742,2909,5743,2912,5741,2913,5740,2915,5740,2929,5739,2943,5739,2948,5739,2951,5740,2953,5741,2954,5741,2955,5742,2956,5742,2963,5745,2969,5749,2970,5750,2971,5750,2976,5750,2981,5751,2982,5752,2983,5752,2990,5751,2994,5755,2996,5756,2998,5757,2999,5758,3001,5758,3003,5759,3004,5759,3007,5760,3011,5761,3013,5761,3015,5763,3016,5766,3019,5767,3020,5767,3021,5768,3025,5769,3030,5770,3031,5770,3032,5770,3035,5772,3037,5774,3039,5779,3044,5780,3045,5781,3046,5781,3048,5781,3049,5783,3053,5790,3061,5793,3063,5793,3063,5794,3068,5798,3072,5801,3074,5804,3077,5806,3078,5808,3080,5809,3081,5809,3082,5810,3083,5810,3084,5810,3094,5813,3104,5812,3124,5812,3144,5812,3145,5812,3146,5812,3149,5811,3152,5810,3157,5808,3161,5806,3161,5805,3161,5805,3163,5804,3165,5803,3170,5803,3175,5802,3180,5802,3186,5801,3187,5801,3187,5800,3191,5796,3195,5795,3196,5794,3197,5794,3198,5792,3200,5792,3206,5791,3213,5791,3219,5791,3221,5788,3224,5785,3229,5782,3237,5780,3247,5779,3250,5779,3250,5777,3251,5776,3251,5776,3253,5776,3253,5775,3257,5772,3262,5771,3267,5768,3270,5766,3271,5766,3271,5765,3273,5764,3274,5765,3276,5765,3277,5764,3280,5763,3284,5764,3290,5764,3295,5762,3300,5760,3305,5758,3307,5758,3309,5757,3314,5757,3317,5755,3317,5755,3317,5754,3321,5752,3323,5750,3325,5749,3326,5749,3330,5747,3336,5746,3337,5746,3337,5746,3340,5745,3344,5744,3345,5744,3346,5744,3348,5742,3350,5740,3351,5740,3352,5740,3355,5739,3357,5738,3358,5736,3361,5736,3362,5736,3363,5735,3365,5734,3367,5732,3368,5730,3370,5729,3371,5729,3372,5728,3373,5727,3375,5727,3379,5726,3381,5725,3385,5722,3388,5718,3391,5717,3393,5715,3395,5713,3397,5711,3398,5711,3398,5710,3400,5709,3400,5706,3400,5705,3401,5704,3403,5700,3406,5697,3407,5697,3408,5696,3412,5688,3418,5684,3418,5683,3419,5683,3423,5680,3423,5676,3424,5674,3424,5672,3425,5671,3425,5670,3425,5667,3427,5666,3430,5662,3431,5656,3432,5651,3434,5647,3435,5645,3435,5642,3437,5637,3439,5634,3440,5634,3440,5633,3443,5631,3445,5626,3446,5624,3447,5624,3448,5623,3448,5622,3448,5621,3448,5619,3448,5617,3449,5616,3450,5615,3450,5613,3450,5612,3451,5612,3452,5611,3452,5608,3453,5604,3454,5601,3454,5600,3455,5599,3457,5597,3458,5595,3459,5594,3460,5594,3461,5593,3461,5592,3462,5591,3463,5589,3467,5585,3470,5584,3472,5583,3473,5582,3475,5580,3479,5581,3480,5581,3481,5582,3486,5583,3491,5587,3494,5590,3498,5591,3499,5592,3500,5592,3507,5593,3514,5593,3517,5593,3519,5595,3520,5595,3520,5596,3521,5596,3522,5597,3523,5598,3523,5598,3528,5598,3532,5599,3533,5599,3533,5600,3536,5605,3542,5609,3543,5609,3543,5609,3548,5611,3549,5614,3550,5616,3553,5618,3558,5624,3567,5628,3568,5628,3568,5628,3571,5630,3572,5631,3575,5633,3579,5636,3580,5636,3581,5637,3582,5637,3583,5638,3587,5640,3590,5643,3591,5645,3592,5645,3596,5648,3598,5651,3600,5652,3600,5653,3601,5654,3602,5655,3603,5656,3604,5657,3605,5658,3605,5658,3608,5659,3611,5660,3614,5660,3618,5663,3619,5663,3619,5664,3620,5665,3621,5665,3623,5669,3625,5671,3628,5674,3633,5674,3639,5673,3644,5674,3646,5674,3648,5674,3652,5675,3655,5678,3660,5682,3664,5683,3665,5683,3665,5683,3674,5682,3683,5683,3685,5683,3687,5682,3691,5682,3695,5682,3696,5682,3697,5681,3703,5678,3710,5673,3711,5673,3711,5673,3722,5671,3733,5672,3734,5672,3736,5671,3736,5671,3737,5671,3739,5671,3741,5670,3743,5670,3746,5669,3752,5667,3753,5660,3754,5658,3755,5657,3755,5656,3756,5655,3763,5652,3763,5643,3763,5642,3763,5641,3764,5637,3766,5635,3766,5634,3766,5634,3768,5633,3769,5631,3770,5630,3770,5629,3773,5627,3772,5622,3771,5617,3773,5613,3774,5613,3774,5612,3776,5608,3775,5602,3775,5597,3777,5593,3781,5588,3782,5581,3783,5575,3785,5569,3785,5569,3785,5568,3785,5566,3786,5564,3786,5564,3786,5563,3786,5562,3787,5562,3791,5559,3790,5553,3790,5551,3791,5549,3792,5545,3794,5540,3798,5539,3802,5539,3805,5539,3805,5541,3806,5544,3807,5547,3808,5551,3814,5551,3820,5552,3822,5548,3825,5543,3827,5538,3830,5538,3830,5536,3830,5532,3829,5529,3829,5526,3830,5524,3832,5522,3832,5518,3832,5518,3833,5517,3834,5517,3834,5515,3835,5512,3836,5508,3837,5504,3838,5500,3838,5499,3839,5498,3839,5498,3840,5497,3844,5494,3846,5490,3847,5489,3847,5488,3847,5482,3847,5476,3847,5471,3850,5469,3850,5468,3850,5468,3855,5463,3854,5453,3853,5447,3854,5442,3855,5441,3855,5441,3858,5437,3861,5435,3863,5433,3863,5429,3862,5425,3864,5421,3866,5417,3869,5415,3872,5411,3873,5406,3874,5400,3875,5395,3876,5394,3876,5394,3878,5393,3879,5392,3884,5387,3887,5378,3887,5377,3888,5376,3891,5371,3894,5367,3895,5367,3896,5366,3897,5363,3899,5361,3901,5359,3901,5357,3901,5348,3902,5338,3902,5327,3896,5322,3895,5321,3895,5320,3895,5318,3893,5317,3891,5317,3890,5316,3889,5315,3888,5315,3882,5315,3881,5310,3878,5301,3868,5303,3867,5303,3866,5303,3862,5305,3858,5309,3857,5310,3857,5311,3856,5311,3855,5312,3852,5314,3851,5317,3850,5319,3848,5322,3847,5324,3844,5327,3843,5327,3843,5328,3841,5333,3842,5339,3842,5343,3839,5345,3839,5345,3838,5346,3836,5347,3832,5347,3827,5347,3823,5346,3821,5345,3820,5343,3818,5338,3815,5335,3815,5334,3814,5333,3810,5330,3811,5322,3811,5320,3811,5317,3812,5313,3809,5311,3808,5310,3807,5309,3807,5309,3806,5308,3805,5306,3803,5304,3802,5303,3802,5301,3802,5297,3803,5293,3803,5288,3804,5283,3804,5278,3808,5276,3810,5274,3811,5272,3811,5265,3814,5258,3815,5258,3815,5257,3820,5255,3822,5249,3823,5244,3824,5239,3824,5239,3824,5238,3826,5235,3829,5233,3831,5232,3831,5231,3831,5227,3830,5224,3830,5218,3832,5214,3832,5214,3833,5213,3833,5212,3834,5212,3835,5209,3838,5209,3839,5209,3841,5209,3847,5208,3850,5212,3850,5212,3850,5213,3854,5215,3853,5220,3853,5231,3855,5238,3856,5240,3857,5241,3862,5246,3871,5244,3872,5241,3873,5238,3873,5235,3875,5233,3877,5232,3881,5231,3882,5231,3883,5230,3885,5228,3889,5224,3889,5223,3890,5223,3891,5222,3891,5222,3897,5220,3904,5220,3905,5220,3905,5221,3907,5222,3909,5224,3911,5225,3913,5226,3914,5226,3914,5226,3922,5228,3931,5228,3932,5228,3933,5227,3938,5227,3942,5229,3943,5230,3944,5230,3948,5230,3948,5234,3948,5239,3952,5242,3956,5244,3960,5245,3961,5246,3961,5246,3964,5250,3967,5252,3968,5252,3968,5252,3969,5252,3970,5252,3972,5253,3973,5256,3974,5257,3974,5258,3974,5261,3975,5262,3980,5265,3983,5267,3984,5268,3984,5269,3985,5271,3986,5273,3987,5273,3987,5274,3987,5278,3989,5281,3989,5282,3989,5282,3990,5287,3989,5291,3989,5291,3989,5292,3989,5293,3988,5295,3988,5296,3988,5298,3987,5301,3985,5304,3984,5305,3984,5305,3985,5313,3978,5316,3977,5316,3976,5317,3976,5317,3975,5318,3973,5318,3973,5319,3970,5323,3967,5324,3964,5326,3961,5328,3960,5330,3959,5333,3958,5335,3956,5336,3948,5340,3948,5348,3948,5351,3947,5352,3944,5355,3945,5360,3945,5361,3945,5362,3946,5363,3946,5365,3947,5370,3948,5375,3948,5378,3952,5378,3952,5378,3953,5378,3954,5378,3956,5379,3959,5379,3961,5379,3967,5379,3972,5380,3973,5380,3974,5380,3980,5381,3985,5381,3986,5381,3987,5381,3989,5385,3990,5389,3991,5393,3990,5396,3990,5399,3991,5402,3992,5409,3996,5411,4001,5413,4004,5419,4005,5421,4005,5422,4006,5427,4009,5430,4010,5431,4011,5431,4011,5432,4012,5433,4017,5438,4019,5444,4020,5449,4022,5454,4022,5454,4022,5455,4022,5456,4023,5456,4030,5456,4038,5457,4040,5457,4042,5455,4044,5454,4046,5452,4050,5449,4052,5444,4053,5443,4053,5442,4053,5439,4055,5438,4059,5435,4064,5435,4066,5434,4067,5434,4070,5433,4072,5430,4078,5422,4088,5422,4093,5421,4097,5421,4107,5421,4116,5421,4117,5421,4118,5421,4121,5420,4124,5419,4125,5418,4125,5417,4126,5417,4127,5416,L,4128,5415,Q,4133,5415,4135,5412,4135,5411,4136,5411,4137,5410,4137,5408,4137,5403,4143,5401,4144,5400,4145,5400,4148,5400,4150,5398,4154,5394,4157,5391,4158,5390,4159,5390,4163,5389,4167,5390,4168,5390,4169,5390,4173,5390,4174,5391,4175,5392,4176,5393,4176,5395,4176,5397,4177,5403,4174,5407,4169,5409,4168,5413,4168,5413,4168,5414,4168,5416,4167,5417,4166,5417,4165,5418,4161,5420,4160,5424,4159,5424,4159,5425,4159,5428,4157,5431,4157,5431,4156,5431,4151,5433,4151,5438,4151,5439,4152,5440,4152,5442,4153,5444,4153,5447,4155,5448,4162,5452,4169,5457,4171,5458,4171,5461,4171,5466,4168,5468,4168,5469,4167,5469,4167,5470,4166,5470,4164,5471,4162,5473,4158,5476,4158,5481,4157,5487,4157,5493,4157,5496,4158,5498,4159,5503,4158,5509,4158,5511,4160,5513,4164,5518,4168,5521,4169,5521,4169,5521,4171,5522,4174,5524,4175,5524,4176,5525,4177,5527,4180,5530,4181,5530,4182,5531,4184,5532,4188,5533,4189,5533,4190,5533,4191,5534,4192,5534,4195,5535,4197,5538,4197,5538,4198,5540,4199,5542,4202,5542,4206,5542,4210,5544,4212,5544,4213,5545,4214,5546,4214,5547,4215,5548,4215,5548,4216,5550,4217,5552,4219,5553,4220,5553,4225,5553,4227,5558,4230,5564,4238,5563,4239,5563,4240,5562,4241,5561,4242,5561,4243,5560,4244,5559,4244,5558,4245,5557,4247,5552,4248,5547,4248,5547,4249,5546,4250,5545,4251,5543,4251,5542,4252,5542,4260,5540,4269,5541,4270,5541,4270,5542,4272,5545,4272,5549,4273,5552,4274,5554,4274,5555,4275,5556,4276,5561,4278,5564,4279,5566,4280,5566,4281,5567,4281,5567,4282,5568,4283,5569,4290,5570,4297,5570,4303,5570,4308,5568,4309,5568,4309,5568,4310,5567,4311,5567,4312,5566,4314,5566,4321,5566,4328,5564,4330,5564,4332,5563,4340,5561,4350,5562,4352,5562,4354,5562,4359,5561,4365,5560,4367,5560,4368,5559,4369,5559,4369,5558,4374,5556,4379,5555,4381,5554,4383,5553,4392,5551,4401,5552,4404,5552,4406,5551,4410,5551,4413,5550,4419,5548,4426,5548,4428,5548,4429,5548,4430,5547,4433,5547,4434,5546,4435,5545,4441,5538,4452,5538,4452,5539,4453,5538,4453,5537,4454,5536,4458,5531,4466,5529,4467,5528,4468,5528,4474,5529,4479,5524,4483,5524,4486,5521,4489,5518,4492,5515,4493,5515,4493,5514,4492,5508,4497,5508,4498,5508,4499,5507,4505,5502,4511,5499,4512,5499,4512,5499,4515,5496,4519,5495,4520,5495,4521,5494,4525,5493,4528,5488,4528,5487,4529,5487,4529,5486,4530,5485,4531,5484,4532,5483,4538,5481,4542,5477,4543,5477,4544,5475,4546,5473,4548,5472,4553,5468,4558,5467,4559,5466,4561,5465,4567,5461,4573,5456,4574,5455,4575,5454,4578,5454,4581,5453,4585,5453,4588,5455,4589,5456,4590,5456,4593,5458,4597,5462,4601,5465,4606,5465,4610,5464,4616,5464,4621,5464,4625,5462,4626,5462,4627,5461,4632,5456,4638,5452,4640,5452,4641,5452,4645,5452,4649,5449,4650,5448,4651,5447,4653,5446,4655,5445,4657,5444,4658,5440,4659,5437,4660,5435,4661,5434,4662,5433,4664,5432,4664,5430,4664,5429,4664,5428,4664,5419,4664,5409,4665,5390,4665,5370,4665,5350,4665,5331,4665,5327,4663,5324,4660,5319,4656,5314,4656,5313,4656,5312,4655,5306,4655,5300,4655,5299,4656,5299,4658,5295,4657,5290,4657,5289,4658,5287,4658,5285,4659,5282,4658,5281,4658,5279,4658,5278,4658,5278,4658,5277,4659,5275,4660,5273,4660,5269,4659,5263,4660,5257,4660,5257,4660,5256,4660,5245,4660,5233,4660,5224,4661,5214,4661,5209,4659,5205,4658,5202,4658,5199,4658,5198,4658,5197,4657,5194,4657,5190,4656,5186,4653,5183,4652,5182,4652,5181,4650,5178,4648,5175,4647,5173,4646,5171,4645,5169,4645,5167,4646,5161,4641,5159,4639,5159,4638,5157,4637,5157,4636,5157,4632,5156,4632,5152,4631,5150,4631,5148,4630,5148,4630,5147,4631,5141,4627,5138,4625,5136,4624,5132,4621,5127,4622,5121,4623,5116,4624,5110,4624,5110,4624,5109,4632,5104,4632,5093,4632,5093,4632,5092,4632,5089,4634,5086,4635,5086,4635,5085,4635,5078,4635,5071,4635,5065,4640,5061,4641,5058,4642,5056,4643,5054,4644,5049,4644,5045,4645,5040,4645,5039,4646,5039,4651,5034,4651,5027,4651,5026,4651,5025,4651,5020,4653,5017,4654,5016,4656,5013,4656,5013,4656,5012,4655,5001,4661,4994,4661,4993,4661,4993,4664,4984,4663,4974,4663,4963,4665,4953,4666,4946,4665,4939,4665,4938,4666,4937,4666,4936,4666,4935,4666,4934,4667,4933,4667,4929,4671,4927,4672,4926,4672,4926,4674,4925,4674,4925,4674,4921,4675,4917,4675,4915,4675,4912,4675,4902,4675,4891,4675,4871,4675,4852,4675,4846,4674,4841,4674,4838,4673,4835,4673,4835,4673,4834,4672,4828,4669,4825,4667,4823,4666,4819,4665,4818,4665,4818,4664,4818,4664,4816,4664,4808,4664,4800,4664,4794,4665,4789,4666,4786,4666,4782,4666,4781,4666,4780,4668,4770,4668,4761,4668,4760,4667,4758,4666,4753,4662,4748,4660,4745,4660,4743,4659,4742,4659,4740,4658,4739,4658,4738,4657,4730,4657,4723,4657,4703,4658,4683,4658,4679,4656,4676,4651,4668,4647,4659,4647,4659,4647,4658,4647,4638,4645,4618,4645,4615,4643,4613,4641,4609,4635,4607,4630,4606,4631,4600,4631,4595,4631,4590,4632,4583,4633,4576,4633,4575,4633,4573,4633,4570,4634,4566,4634,4555,4633,4546,4632,4545,4632,4543,4632,4543,4631,4542,4630,4541,4629,4540,4628,4540,4628,4538,4628,4537,4627,4537,4624,4535,4624,4532,4624,4531,4623,4531,4623,4530,4623,4529,4623,4524,4623,4520,4623,4517,4623,4515,4623,4500,4623,4485,4623,4465,4623,4446,4623,4426,4623,4406,4623,4401,4624,4397,4625,4392,4626,4388,4627,4384,4629,4380,4629,4380,4629,4379,4630,4378,4630,4376,4631,4374,4631,4372,4631,4371,4632,4369,4632,4367,4632,4366,4633,4364,4633,4361,4633,4351,4634,4342,4634,4341,4634,4341,4634,4337,4637,4335,4638,4334,4638,4333,4638,4331,4639,4330,4641,4329,4641,4325,4641,4320,4642,4315,4642,4314,4642,4313,4644,4309,4644,4304,4643,4294,4645,4286,4645,4285,4646,4284,4649,4279,4650,4275,4650,4274,4651,4272,4651,4270,4651,4266,4651,4265,4652,4265,4652,4264,4652,4264,4653,4258,4654,4253,4654,4253,4654,4252,4655,4249,4655,4244,4655,4224,4655,4204,4655,4203,4655,4202,4656,4200,4656,4199,4656,4196,4656,4194,4656,4186,4656,4177,4656,4166,4657,4155,4657,4149,4660,4145,4663,4141,4665,4136,4665,4135,4665,4134,4666,4120,4666,4105,4666,4085,4665,4066,4665,4058,4667,4050,4667,4049,4667,4048,4668,4030,4668,4012,4668,4012,4668,4011,4672,4003,4671,3993,4671,3988,4673,3983,4675,3977,4676,3972,4677,3971,4677,3970,4677,3966,4678,3962,4678,3961,4678,3960,4679,3956,4681,3954,4684,3951,4685,3946,4686,3942,4686,3937,4685,3925,4686,3915,4687,3913,4687,3912,4688,3909,4690,3906,4690,3905,4690,3905,4691,3903,4691,3901,4692,3897,4692,3894,4692,3889,4692,3884,4693,3879,4693,3875,4692,3871,4696,3869,4699,3866,4701,3862,4703,3860,4703,3858,4704,3856,4704,3854,4705,3848,4705,3842,4705,3841,4705,3841,4705,3833,4706,3825,4708,3812,4708,3799,4708,3796,4706,3795,4702,3791,4699,3788,4698,3787,4697,3786,4691,3779,4681,3779,4680,3779,4679,3778,4677,3776,4675,3775,4673,3775,4673,3774,4671,3772,4670,3772,4667,3772,4663,3772,4658,3771,4654,3769,4652,3767,4651,3765,4650,3765,4650,3765,4645,3763,4640,3762,4631,3761,4624,3756,4621,3754,4616,3754,4605,3754,4597,3749,4597,3748,4596,3748,4587,3745,4577,3745,4576,3745,4574,3745,4567,3746,4561,3743,4557,3741,4553,3739,4550,3737,4546,3736,4545,3736,4543,3736,4540,3735,4535,3735,4535,3735,4534,3735,4533,3734,4531,3733,4530,3733,4529,3732,4523,3727,4516,3728,4512,3728,4507,3728,4506,3728,4505,3728,4503,3728,4501,3727,4494,3722,4486,3723,4481,3723,4476,3723,4473,3723,4469,3721,4469,3721,4468,3720,4463,3716,4457,3714,4450,3712,4442,3713,4436,3713,4432,3712,4427,3710,4423,3706,4422,3705,4420,3705,4412,3702,4402,3702,4401,3702,4400,3701,4399,3701,4396,3700,4396,3700,4395,3699,4388,3693,4378,3693,4377,3693,4376,3693,4371,3693,4368,3691,4363,3687,4358,3685,4357,3684,4355,3684,4353,3683,4349,3683,4344,3683,4339,3682,4329,3682,4321,3675,4319,3674,4317,3672,4313,3669,4308,3668,4303,3668,4298,3667,4294,3666,4291,3662,4291,3662,4291,3661,4284,3656,4273,3655,4272,3655,4270,3654,4261,3651,4257,3646,4251,3641,4243,3639,4236,3637,4231,3630,4230,3629,4230,3627,4229,3625,4228,3625,4227,3624,4226,3624,4218,3620,4215,3616,4214,3615,4214,3613,4214,3609,4211,3608,4211,3608,4210,3607,4207,3603,4204,3599,4203,3599,4202,3598,4202,3597,4201,3596,4201,3595,4199,3594,4196,3590,4193,3586,4191,3582,4186,3579,4181,3578,4179,3573,4178,3572,4178,3571,4178,3570,4176,3569,4175,3568,4175,3567,4173,3565,4172,3564,4167,3562,4165,3558,4163,3554,4162,3549,4161,3548,4161,3546,4161,3544,4160,3543,4158,3541,4155,3539,4153,3535,4152,3531,4151,3528,4150,3525,4148,3521,4147,3517,4146,3512,4144,3509,4143,3507,4142,3505,4140,3499,4140,3492,4140,3489,4139,3487,4137,3485,4136,3483,4135,3481,4134,3480,4132,3479,4131,3477,4131,3476,4130,3475,4130,3474,4130,3473,4128,3466,4128,3458,4128,3457,4128,3455,4127,3454,4127,3452,4126,3449,4126,3446,4126,3442,4123,3437,4123,3436,4122,3435,4122,3434,4121,3433,4117,3428,4115,3422,4113,3414,4112,3404,4112,3403,4111,3402,4110,3400,4110,3398,4110,3397,4108,3395,4107,3394,4107,3393,4106,3389,4104,3385,4103,3383,4102,3382,4098,3379,4094,3373,4093,3372,4093,3371,4090,3368,4088,3365,4085,3360,4079,3358,4079,3358,4078,3357,4071,3356,4067,3352,4066,3351,4066,3350,4064,3348,4061,3347,4060,3346,4059,3346,4055,3346,4051,3344,4049,3343,4047,3341,4045,3340,4042,3339,4039,3339,4038,3337,4035,3334,4033,3333,4032,3333,4031,3332,4031,3331,4030,3331,4026,3327,4019,3327,4014,3327,4010,3324,4009,3324,4008,3323,4003,3322,4e3,3320,3999,3320,3998,3320,3993,3318,3988,3318,3987,3318,3986,3317,3984,3315,3982,3315,3973,3315,3963,3315,3962,3315,3960,3315,3955,3314,3953,3311,3952,3310,3951,3310,3944,3310,3936,3310,3929,3310,3924,3306,3924,3305,3923,3304,3921,3303,3918,3302,3910,3301,3901,3301,3900,3301,3900,3301,3899,3300,3897,3299,3896,3299,3896,3298,3894,3296,3891,3295,3890,3295,3889,3295,3886,3295,3883,3293,3881,3291,3877,3287,3876,3286,3876,3285,3875,3285,3875,3285,3871,3284,3867,3284,3860,3284,3857,3283,3856,3282,3855,3282,3852,3279,3849,3276,3846,3272,3842,3272,3837,3271,3832,3271,3832,3271,3831,3271,3830,3270,3829,3270,3828,3269,3828,3269,3825,3266,3822,3262,3817,3259,3811,3257,3808,3256,3805,3256,3802,3256,3800,3255,3799,3254,3799,3254,3796,3251,3792,3250,3789,3249,3785,3246,3782,3244,3780,3242,3778,3238,3773,3233,3773,3232,3772,3232,3769,3231,3768,3228,3768,3227,3767,3227,3765,3224,3764,3221,3763,3220,3763,3220,3760,3217,3759,3214,3758,3214,3758,3213,3757,3211,3757,3211,3754,3209,3753,3206,3752,3205,3752,3204,3751,3199,3750,3195,3749,3192,3747,3191,3744,3186,3741,3180,3740,3179,3739,3178,3738,3176,3736,3172,3733,3169,3732,3164,3732,3163,3732,3162,3731,3161,3731,3160,3731,3158,3731,3157,3731,3155,3730,3153,3729,3150,3727,3146,3724,3137,3719,3130,3718,3128,3716,3127,3714,3124,3713,3122,3711,3120,3708,3117,3703,3112,3699,3109,3699,3109,3698,3108,3693,3106,3689,3102,3688,3102,3687,3101,3686,3101,3685,3100,3684,3100,3683,3100,3682,3099,3681,3099,3678,3098,3675,3097,3674,3097,3673,3096,3669,3093,3665,3091,3661,3087,3655,3087,3645,3087,3638,3083,3638,3082,3637,3082,3634,3081,3632,3081,3631,3080,3630,3080,3628,3079,3626,3079,3617,3079,3608,3079,3588,3079,3569,3079,3549,3079,3530,3079,3528,3079,3525,3080,3518,3081,3510,3080,3506,3080,3501,3081,3490,3082,3478,3081,3473,3081,3469,3080,3469,3080,3468,3080,3463,3078,3460,3076,3454,3073,3448,3073,3439,3073,3432,3070,3428,3068,3426,3065,3424,3064,3423,3064,3418,3063,3416,3060,3413,3056,3411,3052,3410,3052,3410,3051,3404,3044,3402,3035,3402,3034,3402,3033,3401,3032,3401,3030,3402,3027,3400,3027,3399,3026,3398,3025,3398,3024,3396,3023,3389,3020,3388,3013,3387,3010,3386,3008,3386,3007,3385,3007,3383,3005,3381,3003,3377,2998,3375,2992,3374,2989,3372,2988,3369,2985,3367,2981,3366,2978,3364,2975,3364,2974,3364,2973,3361,2969,3358,2965,3357,2965,3356,2964,3354,2960,3351,2957,3349,2956,3349,2955,3342,2949,3338,2940,3337,2940,3337,2939,3337,2936,3337,2934,3319,2934,3301,2934,3301,2934,3300,2934,3297,2934,3295,2937,Q,3294,2941,3291,2943,Z]],label:"Boe",shortLabel:"BE",labelPosition:[271.4,493.3],labelAlignment:[CEN,MID]}}}];exports["default"]={extension:geodefinitions,name:"gabu",type:"maps"}}})});
function HelloController($scope){ $scope.title = "Basic AngularJS demo"; $scope.value = 0; $scope.toggle = true; $scope.increment = function(){ $scope.value++; } }
import React, { Component } from 'react'; import ReactDOM from 'react-dom'; import YTSearch from 'youtube-api-search'; import SearchBar from './components/search_bar'; import VideoList from './components/video_list'; import VideoDetail from './components/video_detail'; const API_KEY ='AIzaSyB0mb3U06meFtYPHdMuPs2e49hyClMGIQ8' class App extends Component{ constructor(props) { super(props); this.state = { videos: [], selectedVideo : null }; this.videoSearch('surfboards'); } videoSearch(term){ YTSearch({key: API_KEY, term: term}, videos => { this.setState({ videos : videos, selectedVideo : videos[0] }); }); } render(){ return ( <div> <SearchBar onSearchTermChange ={term => this.videoSearch(term)}/> <VideoDetail video={this.state.selectedVideo }/> <VideoList onVideoSelect ={selectedVideo => this.setState({selectedVideo})} videos ={this.state.videos} /> </div> ); } } ReactDOM.render(<App />, document.querySelector('.container'));
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-36e5"],{3040:function(t,e,r){"use strict";function n(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function c(t,e){try{var r=o[t](e),c=r.value}catch(t){return void i(t)}r.done?n(c):Promise.resolve(c).then(s,a)}function s(t){c("next",t)}function a(t){c("throw",t)}s()})}}r.d(e,"a",function(){return n})},"577c":function(t,e,r){},"5dd2":function(t,e,r){"use strict";e["a"]={props:["id"],computed:{user:{get:function(){return this.$store.state.User.user}},title:{get:function(){return this.$store.state.Product.product.title},set:function(t){this.$store.commit("SET_PRODUCT_TITLE",t)}},description:{get:function(){return this.$store.state.Product.product.description},set:function(t){this.$store.commit("SET_PRODUCT_DESCRIPTION",t)}},price:{get:function(){return this.$store.state.Product.product.price},set:function(t){this.$store.commit("SET_PRODUCT_PRICE",t)}},isVisibleProductPatch:{get:function(){return this.$store.state.Product.product.meta.isVisibleProductPatch},set:function(t){this.$store.commit("SET_IS_VISIBLE_PRODUCT_PATCH",t)}}}}},"6b42":function(t,e,r){"use strict";r.r(e);var n=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",[t.isVisibleProductPatch?r("product-patch",{attrs:{id:t.id}}):t._e(),t._l(t.products,function(e){return r("mt-cell",{key:e.id,attrs:{title:e.title}},[r("mt-button",{attrs:{size:"small",type:"default"},on:{click:function(r){t.showPatchForm(e.id)}}},[t._v("\n "+t._s(t.t("productsget.mixin.button.first"))+"\n ")]),r("mt-button",{attrs:{size:"small",type:"danger"},on:{click:function(r){t.deleteProduct(e.id)}}},[t._v("\n "+t._s(t.t("productsget.mixin.button.second"))+"\n ")])],1)})],2)},i=[],o=(r("96cf"),r("3040")),c=(r("cadf"),r("551c"),r("097d"),r("8cab")),s=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",[r("mt-popup",{staticClass:"mint-popup-1",model:{value:t.isVisibleProductPatch,callback:function(e){t.isVisibleProductPatch=e},expression:"isVisibleProductPatch"}},[r("mt-field",{attrs:{label:t.t("productpatch.mixin.label.first")},model:{value:t.title,callback:function(e){t.title=e},expression:"title"}}),r("mt-field",{attrs:{label:t.t("productpatch.mixin.label.third")},model:{value:t.description,callback:function(e){t.description=e},expression:"description"}}),r("mt-field",{attrs:{label:t.t("productpatch.mixin.label.second")},model:{value:t.price,callback:function(e){t.price=e},expression:"price"}}),r("mt-cell",{attrs:{title:""}},[r("mt-button",{attrs:{size:"small",type:"default",plain:""},on:{click:t.cancel}},[t._v(t._s(t.t("productpatch.mixin.button.first"))+"\n ")]),r("mt-button",{attrs:{size:"small",type:"primary",plain:""},on:{click:t.patchProduct}},[t._v(t._s(t.t("productpatch.mixin.button.second"))+"\n ")])],1)],1)],1)},a=[],u=r("5dd2"),l=r("76a0"),h={mixins:[u["a"]],created:function(){var t=Object(o["a"])(regeneratorRuntime.mark(function t(){var e;return regeneratorRuntime.wrap(function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,this.$store.dispatch("getProduct",this.id);case 2:e=t.sent,this.$store.commit("SET_PRODUCT_TITLE",e.title),this.$store.commit("SET_PRODUCT_DESCRIPTION",e.description),this.$store.commit("SET_PRODUCT_PRICE",e.price);case 6:case"end":return t.stop()}},t,this)}));return function(){return t.apply(this,arguments)}}(),methods:{patchProduct:function(){var t=Object(o["a"])(regeneratorRuntime.mark(function t(){return regeneratorRuntime.wrap(function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,this.$store.dispatch("patchProduct",{id:this.id,title:this.title,price:this.price,description:this.description});case 2:return Object(l["Toast"])({message:this.t("productpatch.mixin.product.patched"),position:"bottom",duration:3e3}),t.next=5,this.$store.dispatch("getProductsByUser",this.user);case 5:this.$store.commit("SET_IS_VISIBLE_PRODUCT_PATCH",!1),this.$store.commit("RESET_PRODUCT");case 7:case"end":return t.stop()}},t,this)}));return function(){return t.apply(this,arguments)}}(),cancel:function(){this.$store.commit("SET_IS_VISIBLE_PRODUCT_PATCH",!1)}},destroyed:function(){this.$store.commit("RESET_PRODUCT")}},f=h,p=(r("7003"),r("2877")),d=Object(p["a"])(f,s,a,!1,null,null,null);d.options.__file="ProductPatch.mobile.vue";var m=d.exports,v={mixins:[c["a"]],components:{ProductPatch:m},methods:{showPatchForm:function(t){this.$set(this,"id",t),this.$store.commit("SET_IS_VISIBLE_PRODUCT_PATCH",!0)},deleteProduct:function(){var t=Object(o["a"])(regeneratorRuntime.mark(function t(e){return regeneratorRuntime.wrap(function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,this.$store.dispatch("deleteProduct",e);case 2:return Object(l["Toast"])({message:this.t("productsget.mobile.product.removed"),position:"bottom",duration:3e3}),t.next=5,this.$store.dispatch("getProductsByUser",this.user);case 5:case"end":return t.stop()}},t,this)}));return function(e){return t.apply(this,arguments)}}()}},y=v,g=Object(p["a"])(y,n,i,!1,null,null,null);g.options.__file="ProductsGet.mobile.vue";e["default"]=g.exports},7003:function(t,e,r){"use strict";var n=r("577c"),i=r.n(n);i.a},"8cab":function(t,e,r){"use strict";r("96cf");var n=r("3040");e["a"]={data:function(){return{id:""}},created:function(){var t=Object(n["a"])(regeneratorRuntime.mark(function t(){return regeneratorRuntime.wrap(function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,this.$store.dispatch("getProductsByUser",this.user);case 2:case"end":return t.stop()}},t,this)}));return function(){return t.apply(this,arguments)}}(),computed:{fields:{get:function(){return{title:{label:this.t("productsget.mixin.field.first")},description:{label:this.t("productsget.mixin.field.second")},price:{label:this.t("productsget.mixin.field.third")},actions:{label:this.t("productsget.mixin.field.fourth")}}}},products:{get:function(){return this.$store.state.Products.products}},user:{get:function(){return this.$store.state.User.user}},isVisibleProductPatch:{get:function(){return this.$store.state.Product.product.meta.isVisibleProductPatch},set:function(t){this.$store.commit("SET_IS_VISIBLE_PRODUCT_PATCH",t)}}}}},"96cf":function(t,e){!function(e){"use strict";var r,n=Object.prototype,i=n.hasOwnProperty,o="function"===typeof Symbol?Symbol:{},c=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",a=o.toStringTag||"@@toStringTag",u="object"===typeof t,l=e.regeneratorRuntime;if(l)u&&(t.exports=l);else{l=e.regeneratorRuntime=u?t.exports:{},l.wrap=w;var h="suspendedStart",f="suspendedYield",p="executing",d="completed",m={},v={};v[c]=function(){return this};var y=Object.getPrototypeOf,g=y&&y(y(k([])));g&&g!==n&&i.call(g,c)&&(v=g);var P=E.prototype=b.prototype=Object.create(v);x.prototype=P.constructor=E,E.constructor=x,E[a]=x.displayName="GeneratorFunction",l.isGeneratorFunction=function(t){var e="function"===typeof t&&t.constructor;return!!e&&(e===x||"GeneratorFunction"===(e.displayName||e.name))},l.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,E):(t.__proto__=E,a in t||(t[a]="GeneratorFunction")),t.prototype=Object.create(P),t},l.awrap=function(t){return{__await:t}},T(L.prototype),L.prototype[s]=function(){return this},l.AsyncIterator=L,l.async=function(t,e,r,n){var i=new L(w(t,e,r,n));return l.isGeneratorFunction(e)?i:i.next().then(function(t){return t.done?t.value:i.next()})},T(P),P[a]="Generator",P[c]=function(){return this},P.toString=function(){return"[object Generator]"},l.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){while(e.length){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},l.values=k,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=r,this.done=!1,this.delegate=null,this.method="next",this.arg=r,this.tryEntries.forEach(R),!t)for(var e in this)"t"===e.charAt(0)&&i.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=r)},stop:function(){this.done=!0;var t=this.tryEntries[0],e=t.completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(n,i){return s.type="throw",s.arg=t,e.next=n,i&&(e.method="next",e.arg=r),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var c=this.tryEntries[o],s=c.completion;if("root"===c.tryLoc)return n("end");if(c.tryLoc<=this.prev){var a=i.call(c,"catchLoc"),u=i.call(c,"finallyLoc");if(a&&u){if(this.prev<c.catchLoc)return n(c.catchLoc,!0);if(this.prev<c.finallyLoc)return n(c.finallyLoc)}else if(a){if(this.prev<c.catchLoc)return n(c.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<c.finallyLoc)return n(c.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var c=o?o.completion:{};return c.type=t,c.arg=e,o?(this.method="next",this.next=o.finallyLoc,m):this.complete(c)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),R(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;R(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:k(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=r),m}}}function w(t,e,r,n){var i=e&&e.prototype instanceof b?e:b,o=Object.create(i.prototype),c=new I(n||[]);return o._invoke=O(t,r,c),o}function _(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}function b(){}function x(){}function E(){}function T(t){["next","throw","return"].forEach(function(e){t[e]=function(t){return this._invoke(e,t)}})}function L(t){function e(r,n,o,c){var s=_(t[r],t,n);if("throw"!==s.type){var a=s.arg,u=a.value;return u&&"object"===typeof u&&i.call(u,"__await")?Promise.resolve(u.__await).then(function(t){e("next",t,o,c)},function(t){e("throw",t,o,c)}):Promise.resolve(u).then(function(t){a.value=t,o(a)},c)}c(s.arg)}var r;function n(t,n){function i(){return new Promise(function(r,i){e(t,n,r,i)})}return r=r?r.then(i,i):i()}this._invoke=n}function O(t,e,r){var n=h;return function(i,o){if(n===p)throw new Error("Generator is already running");if(n===d){if("throw"===i)throw o;return C()}r.method=i,r.arg=o;while(1){var c=r.delegate;if(c){var s=S(c,r);if(s){if(s===m)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===h)throw n=d,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=p;var a=_(t,e,r);if("normal"===a.type){if(n=r.done?d:f,a.arg===m)continue;return{value:a.arg,done:r.done}}"throw"===a.type&&(n=d,r.method="throw",r.arg=a.arg)}}}function S(t,e){var n=t.iterator[e.method];if(n===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=r,S(t,e),"throw"===e.method))return m;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return m}var i=_(n,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,m;var o=i.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=r),e.delegate=null,m):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,m)}function $(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function R(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function I(t){this.tryEntries=[{tryLoc:"root"}],t.forEach($,this),this.reset(!0)}function k(t){if(t){var e=t[c];if(e)return e.call(t);if("function"===typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){while(++n<t.length)if(i.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=r,e.done=!0,e};return o.next=o}}return{next:C}}function C(){return{value:r,done:!0}}}(function(){return this}()||Function("return this")())}}]);
/* */ "format cjs"; import { Subscriber } from '../Subscriber'; import { tryCatch } from '../util/tryCatch'; import { errorObject } from '../util/errorObject'; export function sequenceEqual(compareTo, comparor) { return (source) => source.lift(new SequenceEqualOperator(compareTo, comparor)); } export class SequenceEqualOperator { constructor(compareTo, comparor) { this.compareTo = compareTo; this.comparor = comparor; } call(subscriber, source) { return source.subscribe(new SequenceEqualSubscriber(subscriber, this.compareTo, this.comparor)); } } export class SequenceEqualSubscriber extends Subscriber { constructor(destination, compareTo, comparor) { super(destination); this.compareTo = compareTo; this.comparor = comparor; this._a = []; this._b = []; this._oneComplete = false; this.add(compareTo.subscribe(new SequenceEqualCompareToSubscriber(destination, this))); } _next(value) { if (this._oneComplete && this._b.length === 0) { this.emit(false); } else { this._a.push(value); this.checkValues(); } } _complete() { if (this._oneComplete) { this.emit(this._a.length === 0 && this._b.length === 0); } else { this._oneComplete = true; } } checkValues() { const { _a, _b, comparor } = this; while (_a.length > 0 && _b.length > 0) { let a = _a.shift(); let b = _b.shift(); let areEqual = false; if (comparor) { areEqual = tryCatch(comparor)(a, b); if (areEqual === errorObject) { this.destination.error(errorObject.e); } } else { areEqual = a === b; } if (!areEqual) { this.emit(false); } } } emit(value) { const { destination } = this; destination.next(value); destination.complete(); } nextB(value) { if (this._oneComplete && this._a.length === 0) { this.emit(false); } else { this._b.push(value); this.checkValues(); } } } class SequenceEqualCompareToSubscriber extends Subscriber { constructor(destination, parent) { super(destination); this.parent = parent; } _next(value) { this.parent.nextB(value); } _error(err) { this.parent.error(err); } _complete() { this.parent._complete(); } } //# sourceMappingURL=sequenceEqual.js.map
/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: "./index", stats: { colors: true, hash: false, entrypoints: true }, performance: { hints: false } };
/* __Seed builder__ (Read_only) Example test Be careful copying content */ import React from "react"; import '@testing-library/jest-dom/extend-expect'; import { screen } from '@testing-library/react'; import { render, mockGql } from 'seed/jest'; import * as data from 'seed/examples/tests/data'; import FormSet from 'seed/examples/components/matches/FormSet'; test('examples/components/matches/FormSet', () => { mockGql.useDetail({"match": data.GQL_MATCH}); mockGql.useQuery({"teams": data.GQL_TEAMS}); mockGql.useSet({"setMatch": data.GQL_MATCH}); render(<FormSet />); expect(screen).toBeDefined(); });
const { orderBy } = require('lodash'); const dates = require('@envage/water-abstraction-helpers').nald.dates; const licenceQueries = require('./lib/nald-queries/licences'); const partyQueries = require('./lib/nald-queries/parties'); const addressQueries = require('./lib/nald-queries/addresses'); const rolesQueries = require('./lib/nald-queries/roles'); const purposesQueries = require('./lib/nald-queries/purposes'); const cams = require('./lib/nald-queries/cams'); const { getEndDate } = require('./lib/end-date'); const { getFormatPoints, getFormatPurposes } = require('./lib/nald-queries/returns'); const { logger } = require('../../logger'); /** * Gets the purposes together with their points, agreements and conditions * for the specified current version * @param {Object} licenceRow * @param {Object} [currentVersion] - optional current version * @return {Promise} */ const getPurposesJson = async (licenceRow, currentVersion = null) => { const regionCode = licenceRow.FGAC_REGION_CODE; let purposes; if (currentVersion) { purposes = await purposesQueries.getPurposes(licenceRow.ID, regionCode, currentVersion.ISSUE_NO, currentVersion.INCR_NO); } else { purposes = await purposesQueries.getPurposes(licenceRow.ID, regionCode); } for (const purpose of purposes) { purpose.purpose = await purposesQueries.getPurpose({ primary: purpose.APUR_APPR_CODE, secondary: purpose.APUR_APSE_CODE, tertiary: purpose.APUR_APUS_CODE }); purpose.purposePoints = await purposesQueries.getPurposePoints(purpose.ID, regionCode); purpose.licenceAgreements = await purposesQueries.getPurposePointLicenceAgreements(purpose.ID, regionCode); purpose.licenceConditions = await purposesQueries.getPurposePointLicenceConditions(purpose.ID, regionCode); } return purposes; }; /** * Gets current return formats for specified licence ID and region code * @param {Number} licenceId - from NALD_ABS_LICENCES table * @param {Number} regionCode - FGAC_REGION_CODE * @return {Promise} resolves with formats and purposes/points */ const getReturnFormats = async (licenceId, regionCode) => { const formats = await licenceQueries.getCurrentFormats(licenceId, regionCode); for (const format of formats) { format.points = await getFormatPoints(format.ID, regionCode); format.purposes = await getFormatPurposes(format.ID, regionCode); } return formats; }; /** * Gets the JSON for the current version of the licence (if available) * @param {Object} licenceRow * return {Promise} resolves with object of current version, or null */ const getCurrentVersionJson = async (licenceRow) => { const regionCode = licenceRow.FGAC_REGION_CODE; const currentVersion = await licenceQueries.getCurrentVersion(licenceRow.ID, regionCode); if (currentVersion) { const data = { licence: currentVersion }; data.licence.party = await partyQueries.getParties(currentVersion.ACON_APAR_ID, regionCode); for (const p in data.licence.parties) { data.licence.parties[p].contacts = await partyQueries.getPartyContacts(currentVersion.parties[p].ID, regionCode); } data.party = (await partyQueries.getParty(currentVersion.ACON_APAR_ID, regionCode))[0]; data.address = (await addressQueries.getAddress(currentVersion.ACON_AADD_ID, regionCode))[0]; data.original_effective_date = dates.calendarToSortable(licenceRow.ORIG_EFF_DATE); data.version_effective_date = dates.calendarToSortable(currentVersion.EFF_ST_DATE); data.expiry_date = dates.calendarToSortable(licenceRow.EXPIRY_DATE); data.purposes = await getPurposesJson(licenceRow, currentVersion); data.formats = await getReturnFormats(licenceRow.ID, regionCode); return data; } return null; }; /** * Gets all licence versions (including current) * @param {Object} licenceRow * @return {Promise} resolves with versions array */ const getVersionsJson = async (licenceRow) => { const versions = await licenceQueries.getVersions(licenceRow.ID, licenceRow.FGAC_REGION_CODE); for (const version of versions) { version.parties = await partyQueries.getParties(version.ACON_APAR_ID, licenceRow.FGAC_REGION_CODE); for (const party of version.parties) { party.contacts = await partyQueries.getPartyContacts(party.ID, licenceRow.FGAC_REGION_CODE); } } return versions; }; /** * Build full licence JSON for storing in permit repo from NALD import tables * @param {String} licenceNumber * @return {Promise} resolves with permit repo JSON packet */ const getLicenceJson = async (licenceNumber) => { try { const data = await licenceQueries.getLicence(licenceNumber); for (const licenceRow in data) { const thisLicenceRow = data[licenceRow]; thisLicenceRow.vmlVersion = 2; thisLicenceRow.data = {}; thisLicenceRow.data.versions = await getVersionsJson(thisLicenceRow); thisLicenceRow.data.current_version = await getCurrentVersionJson(thisLicenceRow); thisLicenceRow.data.cams = await cams.getCams(thisLicenceRow.AREP_CAMS_CODE, thisLicenceRow.FGAC_REGION_CODE); thisLicenceRow.data.roles = await rolesQueries.getRoles(thisLicenceRow.ID, thisLicenceRow.FGAC_REGION_CODE); thisLicenceRow.data.purposes = await getPurposesJson(thisLicenceRow); return thisLicenceRow; } } catch (error) { logger.error('Error getting licence JSON', error, { licenceNumber }); } }; /** * Gets the latest version of the specified licence data * by sorting on the effective start date of the versions array * - Note: this may not be the current version * @param {Array} versions - licence data versions array from NALD import process * @return {Object} latest version */ const getLatestVersion = (versions) => { const sortedVersions = orderBy(versions, (version) => { const issueNo = 1000 * parseInt(version.ISSUE_NO, 10); const incrNo = parseInt(version.INCR_NO, 10); return issueNo + incrNo; }); return sortedVersions[sortedVersions.length - 1]; }; /** * Build packet of data to post to permit repository * @param {String} licenceRef - the licence number * @param {Number} regimeId - the numeric ID of the permitting regime * @param {Number} licenceTypeId - the ID of the licence type, e.g abstraction, impoundment etc * @param {Object} data - the licence JS object data * @return {Object} - packet of data for posting to permit repo */ const buildPermitRepoPacket = (licenceRef, regimeId, licenceTypeId, data) => { const latestVersion = getLatestVersion(data.data.versions); const permitRepoData = { licence_ref: licenceRef, licence_start_dt: dates.calendarToSortable(latestVersion.EFF_ST_DATE), licence_end_dt: getEndDate(data), licence_status_id: '1', licence_type_id: licenceTypeId, licence_regime_id: regimeId, licence_data_value: JSON.stringify(data) }; // remove null attributes so as not to anger JOI if (permitRepoData.licence_end_dt == null) { delete permitRepoData.licence_end_dt; } if (permitRepoData.licence_start_dt == null) { delete permitRepoData.licence_start_dt; } return permitRepoData; }; exports.getLicenceJson = getLicenceJson; exports.buildPermitRepoPacket = buildPermitRepoPacket;
function addWidgetsfrmDatagrid() { var hbxDatagrids = new kony.ui.Box({ "id": "hbxDatagrids", "isVisible": true, "orientation": constants.BOX_LAYOUT_HORIZONTAL, "position": constants.BOX_POSITION_AS_NORMAL }, { "containerWeight": 100, "layoutAlignment": constants.BOX_LAYOUT_ALIGN_FROM_LEFT, "layoutType": constants.CONTAINER_LAYOUT_BOX, "margin": [0, 0, 0, 0], "marginInPixel": false, "padding": [1, 1, 1, 1], "paddingInPixel": false, "percent": true, "vExpand": false, "widgetAlignment": constants.WIDGET_ALIGN_TOP_LEFT }, {}); var vbox192926642422365 = new kony.ui.Box({ "id": "vbox192926642422365", "isVisible": true, "orientation": constants.BOX_LAYOUT_VERTICAL, "position": constants.BOX_POSITION_AS_NORMAL }, { "containerWeight": 100, "layoutType": constants.CONTAINER_LAYOUT_BOX, "margin": [0, 0, 0, 0], "marginInPixel": false, "padding": [1, 1, 1, 1], "paddingInPixel": false, "vExpand": false, "widgetAlignment": constants.WIDGET_ALIGN_TOP_LEFT }, {}); var label118085056438503 = new kony.ui.Label({ "id": "label118085056438503", "isVisible": true, "skin": "lblNormalSimilar", "text": "Default datagrid" }, { "containerWeight": 100, "contentAlignment": constants.CONTENT_ALIGN_MIDDLE_LEFT, "hExpand": true, "margin": [2, 2, 2, 2], "marginInPixel": false, "padding": [0, 1, 0, 1], "paddingInPixel": false, "vExpand": false, "widgetAlignment": constants.WIDGET_ALIGN_CENTER }, { "textCopyable": false, "wrapping": constants.WIDGET_TEXT_WORD_WRAP }); var datagrid103994549624149 = new kony.ui.DataGrid({ "columnHeadersConfig": [{ "columnContentAlignment": constants.CONTENT_ALIGN_CENTER, "columnHeaderText": "FIRST", "columnID": "a", "columnType": constants.DATAGRID_COLUMN_TYPE_TEXT, "columnWidthInPercentage": 33, "isColumnSortable": false }, { "columnContentAlignment": constants.CONTENT_ALIGN_CENTER, "columnHeaderText": "SECOND", "columnID": "b", "columnType": constants.DATAGRID_COLUMN_TYPE_TEXT, "columnWidthInPercentage": 33, "isColumnSortable": false }, { "columnContentAlignment": constants.CONTENT_ALIGN_CENTER, "columnHeaderText": "THIRD", "columnID": "c", "columnType": constants.DATAGRID_COLUMN_TYPE_TEXT, "columnWidthInPercentage": 33, "isColumnSortable": false }, ], "data": [{ "a": "A", "b": "E", "c": "HELLO" }, { "a": "B", "b": "D", "c": "WORLD" }, { "a": "C", "b": "C", "c": "HELLO" }, { "a": "D", "b": "B", "c": "WORLD" }, { "a": "E", "b": "A", "c": "HELLO" }], "gridlineColor": "5c115c", "headerSkin": "dgHead", "id": "datagrid103994549624149", "isMultiSelect": false, "isVisible": true, "rowAlternateSkin": "dgRow", "rowCount": 4, "rowFocusSkin": "dgFocus", "rowNormalSkin": "dgRow", "showColumnHeaders": true }, { "containerWeight": 100, "contentAlignment": constants.CONTENT_ALIGN_MIDDLE_LEFT, "margin": [2, 2, 2, 2], "marginInPixel": false, "padding": [0, 2, 0, 2], "paddingInPixel": false, "widgetAlignment": constants.WIDGET_ALIGN_CENTER }, {}); var label118085056438537 = new kony.ui.Label({ "id": "label118085056438537", "isVisible": true, "skin": "lblNormalSimilar", "text": "Datagrid with images" }, { "containerWeight": 100, "contentAlignment": constants.CONTENT_ALIGN_MIDDLE_LEFT, "hExpand": true, "margin": [2, 2, 2, 2], "marginInPixel": false, "padding": [0, 1, 0, 1], "paddingInPixel": false, "vExpand": false, "widgetAlignment": constants.WIDGET_ALIGN_CENTER }, { "textCopyable": false, "wrapping": constants.WIDGET_TEXT_WORD_WRAP }); var datagrid118085056438159 = new kony.ui.DataGrid({ "columnHeadersConfig": [{ "columnContentAlignment": constants.CONTENT_ALIGN_CENTER, "columnHeaderText": "Audi", "columnID": "Audi", "columnType": constants.DATAGRID_COLUMN_TYPE_IMAGE, "columnWidthInPercentage": 33, "isColumnSortable": false }, { "columnContentAlignment": constants.CONTENT_ALIGN_CENTER, "columnHeaderText": "Ford", "columnID": "Ford", "columnType": constants.DATAGRID_COLUMN_TYPE_IMAGE, "columnWidthInPercentage": 33, "isColumnSortable": false }, { "columnContentAlignment": constants.CONTENT_ALIGN_CENTER, "columnHeaderText": "Skoda", "columnID": "Skoda", "columnType": constants.DATAGRID_COLUMN_TYPE_IMAGE, "columnWidthInPercentage": 33, "isColumnSortable": false }, ], "data": [{ "Audi": "audi.png", "Ford": "ford.png", "Skoda": "skoda.png" }, { "Audi": "audi.png", "Ford": "ford.png", "Skoda": "skoda.png" }, { "Audi": "audi.png", "Ford": "ford.png", "Skoda": "skoda.png" }, { "Audi": "audi.png", "Ford": "ford.png", "Skoda": "skoda.png" }], "gridlineColor": "5c115c", "headerSkin": "dgHead", "id": "datagrid118085056438159", "isMultiSelect": false, "isVisible": true, "rowAlternateSkin": "dgRow", "rowCount": 4, "rowFocusSkin": "dgFocus", "rowNormalSkin": "dgRow", "showColumnHeaders": true }, { "containerWeight": 100, "contentAlignment": constants.CONTENT_ALIGN_MIDDLE_LEFT, "margin": [2, 2, 2, 2], "marginInPixel": false, "padding": [0, 1, 0, 1], "paddingInPixel": false, "widgetAlignment": constants.WIDGET_ALIGN_CENTER }, {}); var label118085056439129 = new kony.ui.Label({ "id": "label118085056439129", "isVisible": true, "skin": "lblNormalSimilar", "text": "Datagrid with Row skins" }, { "containerWeight": 100, "contentAlignment": constants.CONTENT_ALIGN_MIDDLE_LEFT, "hExpand": true, "margin": [2, 2, 2, 2], "marginInPixel": false, "padding": [0, 1, 0, 1], "paddingInPixel": false, "vExpand": false, "widgetAlignment": constants.WIDGET_ALIGN_CENTER }, { "textCopyable": false, "wrapping": constants.WIDGET_TEXT_WORD_WRAP }); var datagrid118085056439309 = new kony.ui.DataGrid({ "columnHeadersConfig": [{ "columnContentAlignment": constants.CONTENT_ALIGN_CENTER, "columnHeaderText": "Audi", "columnID": "Audi", "columnType": constants.DATAGRID_COLUMN_TYPE_IMAGE, "columnWidthInPercentage": 33, "isColumnSortable": false }, { "columnContentAlignment": constants.CONTENT_ALIGN_CENTER, "columnHeaderText": "Ford", "columnID": "Ford", "columnType": constants.DATAGRID_COLUMN_TYPE_IMAGE, "columnWidthInPercentage": 33, "isColumnSortable": false }, { "columnContentAlignment": constants.CONTENT_ALIGN_CENTER, "columnHeaderText": "Skoda", "columnID": "Skoda", "columnType": constants.DATAGRID_COLUMN_TYPE_IMAGE, "columnWidthInPercentage": 33, "isColumnSortable": false }, ], "data": [{ "Audi": "audi.png", "Ford": "ford.png", "Skoda": "skoda.png" }, { "Audi": "audi.png", "Ford": "ford.png", "Skoda": "skoda.png" }, { "Audi": "audi.png", "Ford": "ford.png", "Skoda": "skoda.png" }, { "Audi": "audi.png", "Ford": "ford.png", "Skoda": "skoda.png" }], "gridlineColor": "5c115c", "headerSkin": "dgHead", "id": "datagrid118085056439309", "isMultiSelect": false, "isVisible": true, "rowAlternateSkin": "dGridRowNormal", "rowCount": 4, "rowFocusSkin": "dgFocus", "rowNormalSkin": "dGridRowNormal", "showColumnHeaders": true }, { "containerWeight": 100, "contentAlignment": constants.CONTENT_ALIGN_MIDDLE_LEFT, "margin": [2, 2, 2, 2], "marginInPixel": false, "padding": [0, 1, 0, 1], "paddingInPixel": false, "widgetAlignment": constants.WIDGET_ALIGN_CENTER }, {}); var label118085056439396 = new kony.ui.Label({ "id": "label118085056439396", "isVisible": true, "skin": "lblNormalSimilar", "text": "Datagrid with Row alternate skins" }, { "containerWeight": 100, "contentAlignment": constants.CONTENT_ALIGN_MIDDLE_LEFT, "hExpand": true, "margin": [2, 2, 2, 2], "marginInPixel": false, "padding": [0, 1, 0, 1], "paddingInPixel": false, "vExpand": false, "widgetAlignment": constants.WIDGET_ALIGN_CENTER }, { "textCopyable": false, "wrapping": constants.WIDGET_TEXT_WORD_WRAP }); var datagrid118085056439441 = new kony.ui.DataGrid({ "columnHeadersConfig": [{ "columnContentAlignment": constants.CONTENT_ALIGN_CENTER, "columnHeaderText": "Audi", "columnID": "Audi", "columnType": constants.DATAGRID_COLUMN_TYPE_IMAGE, "columnWidthInPercentage": 33, "isColumnSortable": false }, { "columnContentAlignment": constants.CONTENT_ALIGN_CENTER, "columnHeaderText": "Ford", "columnID": "Ford", "columnType": constants.DATAGRID_COLUMN_TYPE_IMAGE, "columnWidthInPercentage": 33, "isColumnSortable": false }, { "columnContentAlignment": constants.CONTENT_ALIGN_CENTER, "columnHeaderText": "Skoda", "columnID": "Skoda", "columnType": constants.DATAGRID_COLUMN_TYPE_IMAGE, "columnWidthInPercentage": 33, "isColumnSortable": false }, ], "data": [{ "Audi": "audi.png", "Ford": "ford.png", "Skoda": "skoda.png" }, { "Audi": "audi.png", "Ford": "ford.png", "Skoda": "skoda.png" }, { "Audi": "audi.png", "Ford": "ford.png", "Skoda": "skoda.png" }, { "Audi": "audi.png", "Ford": "ford.png", "Skoda": "skoda.png" }], "gridlineColor": "5c115c", "headerSkin": "dgHead", "id": "datagrid118085056439441", "isMultiSelect": false, "isVisible": true, "rowAlternateSkin": "dGridRowNormal", "rowCount": 4, "rowFocusSkin": "dgFocus", "rowNormalSkin": "dgRow", "showColumnHeaders": true }, { "containerWeight": 100, "contentAlignment": constants.CONTENT_ALIGN_MIDDLE_LEFT, "margin": [2, 2, 2, 2], "marginInPixel": false, "padding": [0, 1, 0, 1], "paddingInPixel": false, "widgetAlignment": constants.WIDGET_ALIGN_CENTER }, {}); var label1181029310128738 = new kony.ui.Label({ "id": "label1181029310128738", "isVisible": true, "skin": "lblNormalSimilar", "text": "Datagrid with Text and Image" }, { "containerWeight": 100, "contentAlignment": constants.CONTENT_ALIGN_MIDDLE_LEFT, "hExpand": true, "margin": [2, 2, 2, 2], "marginInPixel": false, "padding": [0, 1, 0, 1], "paddingInPixel": false, "vExpand": false, "widgetAlignment": constants.WIDGET_ALIGN_CENTER }, { "textCopyable": false, "wrapping": constants.WIDGET_TEXT_WORD_WRAP }); var datagrid1181029310128779 = new kony.ui.DataGrid({ "columnHeadersConfig": [{ "columnContentAlignment": constants.CONTENT_ALIGN_CENTER, "columnHeaderText": "Audi", "columnID": "Audi", "columnType": constants.DATAGRID_COLUMN_TYPE_TEXT, "columnWidthInPercentage": 33, "isColumnSortable": false }, { "columnContentAlignment": constants.CONTENT_ALIGN_CENTER, "columnHeaderText": "Ford", "columnID": "Ford", "columnType": constants.DATAGRID_COLUMN_TYPE_TEXT, "columnWidthInPercentage": 33, "isColumnSortable": false }, { "columnContentAlignment": constants.CONTENT_ALIGN_CENTER, "columnHeaderText": "Skoda", "columnID": "Skoda", "columnType": constants.DATAGRID_COLUMN_TYPE_IMAGE, "columnWidthInPercentage": 33, "isColumnSortable": false }, ], "data": [{ "Audi": "A", "Ford": "F", "Skoda": "skoda.png" }, { "Audi": "A", "Ford": "F", "Skoda": "skoda.png" }, { "Audi": "A", "Ford": "F", "Skoda": "skoda.png" }, { "Audi": "A", "Ford": "F", "Skoda": "skoda.png" }], "gridlineColor": "5c115c", "headerSkin": "dgHead", "id": "datagrid1181029310128779", "isMultiSelect": false, "isVisible": true, "rowAlternateSkin": "dgRow", "rowCount": 4, "rowFocusSkin": "dgFocus", "rowNormalSkin": "dgRow", "showColumnHeaders": true }, { "containerWeight": 100, "contentAlignment": constants.CONTENT_ALIGN_MIDDLE_LEFT, "margin": [2, 2, 2, 2], "marginInPixel": false, "padding": [0, 1, 0, 1], "paddingInPixel": false, "widgetAlignment": constants.WIDGET_ALIGN_CENTER }, {}); vbox192926642422365.add(label118085056438503, datagrid103994549624149, label118085056438537, datagrid118085056438159, label118085056439129, datagrid118085056439309, label118085056439396, datagrid118085056439441, label1181029310128738, datagrid1181029310128779); hbxDatagrids.add(vbox192926642422365); frmDatagrid.add(hbxDatagrids); }; function frmDatagridGlobals() { frmDatagrid = new kony.ui.Form2({ "addWidgets": addWidgetsfrmDatagrid, "bounces": true, "enabledForIdleTimeout": false, "id": "frmDatagrid", "needAppMenu": true, "skin": "frm" }, { "displayOrientation": constants.FORM_DISPLAY_ORIENTATION_PORTRAIT, "layoutType": constants.CONTAINER_LAYOUT_BOX, "padding": [0, 0, 0, 0], "paddingInPixel": false }, { "bounces": true, "configureExtendBottom": false, "configureExtendTop": false, "configureStatusBarStyle": false, "footerOverlap": false, "formTransparencyDuringPostShow": 100, "headerOverlap": false, "inputAccessoryViewType": constants.FORM_INPUTACCESSORYVIEW_DEFAULT, "inTransitionConfig": { "transitionDirection": "none", "transitionEffect": "none" }, "needsIndicatorDuringPostShow": true, "outTransitionConfig": { "transitionDirection": "none", "transitionEffect": "none" }, "retainScrollPosition": false, "statusBarStyle": constants.STATUS_BAR_STYLE_DEFAULT, "titleBar": true }); frmDatagrid.info = { "kuid": "p2kwiet12889314953767" }; };
import React from "react"; import ReactDOM from "react-dom"; import "./tailwind.css"; import App from "./App"; import Auth0ProviderWithHistory from './auth/auth0-provider-with-history'; import { BrowserRouter } from "react-router-dom"; ReactDOM.render( <BrowserRouter> <Auth0ProviderWithHistory> <App /> </Auth0ProviderWithHistory > </BrowserRouter>, document.getElementById("root") );
'use strict'; const DefinedNameXform = require('../../../../../lib/xlsx/xform/book/defined-name-xform'); const testXformHelper = require('./../test-xform-helper'); const expectations = [ { title: 'Defined Names', create() { return new DefinedNameXform(); }, preparedModel: { name: 'foo', ranges: ['bar!$A$1:$C$1'] }, xml: '<definedName name="foo">bar!$A$1:$C$1</definedName>', parsedModel: { name: 'foo', ranges: ['bar!$A$1:$C$1'] }, tests: ['render', 'renderIn', 'parse'], }, { title: 'Print Area', create() { return new DefinedNameXform(); }, preparedModel: { name: '_xlnm.Print_Area', localSheetId: 0, ranges: ['bar!$A$1:$C$10'], }, xml: '<definedName name="_xlnm.Print_Area" localSheetId="0">bar!$A$1:$C$10</definedName>', parsedModel: { name: '_xlnm.Print_Area', localSheetId: 0, ranges: ['bar!$A$1:$C$10'], }, tests: ['render', 'renderIn', 'parse'], }, { title: 'String with something that looks like a range', create() { return new DefinedNameXform(); }, preparedModel: { name: 'foo', ranges: [] }, xml: '<definedName name="foo">"OFFSET($A$10;0;0;0;1)"</definedName>', parsedModel: { name: 'foo', ranges: [] }, tests: ['parse'], }, ]; describe('DefinedNameXform', () => { testXformHelper(expectations); });
/** * @license Apache-2.0 * * Copyright (c) 2020 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ 'use strict'; // MODULES // var resolve = require( 'path' ).resolve; var bench = require( '@stdlib/bench' ); var randu = require( '@stdlib/random/base/randu' ); var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var pow = require( '@stdlib/math/base/special/pow' ); var Float32Array = require( '@stdlib/array/float32' ); var tryRequire = require( '@stdlib/utils/try-require' ); var pkg = require( './../package.json' ).name; // VARIABLES // var scusumkbn = tryRequire( resolve( __dirname, './../lib/ndarray.native.js' ) ); var opts = { 'skip': ( scusumkbn instanceof Error ) }; // FUNCTIONS // /** * Creates a benchmark function. * * @private * @param {PositiveInteger} len - array length * @returns {Function} benchmark function */ function createBenchmark( len ) { var x; var y; var i; x = new Float32Array( len ); y = new Float32Array( len ); for ( i = 0; i < x.length; i++ ) { x[ i ] = ( randu()*20.0 ) - 10.0; } return benchmark; function benchmark( b ) { var v; var i; for ( i = 0; i < len; i++ ) { y[ i ] = 0.0; } b.tic(); for ( i = 0; i < b.iterations; i++ ) { x[ 0 ] += 1.0; v = scusumkbn( x.length, 0.0, x, 1, 0, y, 1, 0 ); if ( isnanf( v[ i%len ] ) ) { b.fail( 'should not return NaN' ); } } b.toc(); if ( isnanf( v[ i%len ] ) ) { b.fail( 'should not return NaN' ); } b.pass( 'benchmark finished' ); b.end(); } } // MAIN // /** * Main execution sequence. * * @private */ function main() { var len; var min; var max; var f; var i; min = 1; // 10^min max = 6; // 10^max for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); bench( pkg+'::native:ndarray:len='+len, opts, f ); } } main();
'use strict' const byteUtils = require('../../util/byte-limit') module.exports = TraceAttributes /** * @class * @private */ function TraceAttributes(opts) { opts = opts || Object.create(null) this.limit = opts.limit || Infinity this.attributes = Object.create(null) this.count = 0 } /** * Checks if a given string is within agent attribute limits. * * @param {string} str - Object key name or value */ TraceAttributes.prototype.isValidLength = isValidLength function isValidLength(str) { return byteUtils.isValidLength(str, 256) } /** * Adds the given attribute to the instance attributes object, * overwriting existing keys if necessary. * * @param {AttributeFilter.DESTINATIONS} destinations - Allowed destinations * @param {string} key - Attribute key * @param {string} value - Attribute value */ TraceAttributes.prototype.set = function set(destinations, key, value) { this.attributes[key] = {value, destinations} } /** * Retrieves all attribute key-value pairs where the given `dest` is included * in the list of allowed destinations. If there is a limit on the number of * attributes allowed, no more than that number will be included in the result. * * @param {AttributeFilter.DESTINATIONS} dest * @return {object} */ TraceAttributes.prototype.get = function get(dest) { var attrs = Object.create(null) var attrCount = 0 for (var key in this.attributes) { // eslint-disable-line guard-for-in var attr = this.attributes[key] if (!(attr.destinations & dest) || !isValidType(attr.value)) { continue } attrs[key] = typeof attr.value === 'string' ? byteUtils.truncate(attr.value, 255) : attr.value if (++attrCount >= this.limit) { break } } return attrs } /** * Checks if a given key exists in the instance attributes object. * * @param {string} key */ TraceAttributes.prototype.has = function has(key) { // `null` is considered valid, so only check against undefined return this.attributes[key] !== undefined } /** * Clears instance attributes and count. Used for enforcing updated LASP * settings on connect. */ TraceAttributes.prototype.reset = function reset() { this.count = 0 this.attributes = Object.create(null) } /** * Checks incoming attribute value against valid types: * string, number, boolean, & null. * * @param {*} val * * @return {boolean} */ function isValidType(val) { return val === null || typeof val !== 'object' && val !== undefined }
// @flow import RenderBlockConversationWarning from './' import * as Constants from '../../../constants/chat2' import * as Chat2Gen from '../../../actions/chat2-gen' import {connect} from '../../../util/container' import * as RouteTreeGen from '../../../actions/route-tree-gen' import {type RouteProps} from '../../../route-tree/render-route' import {type ConversationIDKey} from '../../../constants/types/chat2' type RenderBlockConversationWarningRouteProps = RouteProps<{conversationIDKey: ConversationIDKey}, {}> type OwnProps = RenderBlockConversationWarningRouteProps const mapStateToProps = (state, {routeProps}: OwnProps) => { const conversationIDKey = routeProps.get('conversationIDKey') const participants = Constants.getMeta(state, conversationIDKey).participants.join(',') return { conversationIDKey, participants, } } const mapDispatchToProps = dispatch => ({ _onBlock: (conversationIDKey: ConversationIDKey, reportUser: boolean) => dispatch( Chat2Gen.createBlockConversation({ conversationIDKey, reportUser, }) ), onBack: () => dispatch(RouteTreeGen.createNavigateUp()), }) const mergeProps = (stateProps, dispatchProps, ownProps) => ({ conversationIDKey: stateProps.conversationIDKey, onBack: dispatchProps.onBack, onBlock: () => dispatchProps._onBlock(stateProps.conversationIDKey, false), onBlockAndReport: () => dispatchProps._onBlock(stateProps.conversationIDKey, true), participants: stateProps.participants, }) export default connect<OwnProps, _, _, _, _>( mapStateToProps, mapDispatchToProps, mergeProps )(RenderBlockConversationWarning)
// Test Subject ID No. menu and default plots function getName() { // Select dropdown menu id and assign it to a variable var dropdownMenu = d3.select('#selDataset'); // Read "names" values from json file and append into dropdown menu d3.json('data/samples.json') .then(subject => subject.names .forEach(name => dropdownMenu .append('option') .text(name) .property('value'), // Initialize page with default metadata and plots getMetadata(subject.names[0]), getBar(subject.names[0]), getBubble(subject.names[0]), getGauge(subject.names[0]) ), ); }; // Function called by DOM changes function optionChanged(id) { getMetadata(id); getBar(id); getBubble(id); getGauge(id); }; // Demographic Info function getMetadata(id) { // Read "metadata" from json file for each subject and assign it to a variable d3.json('data/samples.json') .then(data => { var subjectData = data.metadata .filter(subject => subject.id.toString() === id)[0]; // Select demographic info id and assign it to a variable var subjectMetadata = d3.select('#sample-metadata'); // Clear metadata befor displaying new selection data subjectMetadata.html(''); // Push data into demographic info card Object.entries(subjectData) .forEach(([key, value]) => subjectMetadata .append('p') .text(`${key}: ${value}`), ); }); }; getName(); // Bar chart function getBar(id) { // Read data from json file for each sample, assign it to a variable, and plot it d3.json('data/samples.json') .then(data => { var sortedSample = data.samples .filter(sample => sample.id === id)[0]; console.log(sortedSample); // Trace for bar chart that displays each sample top 10 OTU values var barTrace = { x: sortedSample.sample_values.slice(0, 10).reverse(), y: sortedSample.otu_ids.slice(0, 10).map(otuid => `OTU ${otuid}`).reverse(), text: sortedSample.otu_labels.slice(0, 10).reverse(), hoverlabel: { font: { size: 12 } }, marker: { color: [ '#001f4d', '#003380', '#0047b3', '#005ce6', '#1a75ff', '#3399ff', '#66a3ff', '#99c2ff', '#b3d9ff', '#e6f0ff' ], opacity: 1, }, type: 'bar', orientation: 'h' }; // Data var data = [barTrace]; // Layout var layout = { title: { text: `Top 10 OTU for Test Subject No. ${id}`, font: { family: 'Arial', size: 24, color: 'black' }, }, //margin: {l: 100, r: 50, t: 50, b: 50}, height: 600, width: 630, xaxis: { tickwidth: 10, tickcolor: '#ffffff', tickfont: { family: 'Arial', color: 'darkgrey' }, title: { text: "Value", font: { family: 'Arial', size: 18, color: 'darkgrey' }, }, }, yaxis: { automargin: true, tickwidth: 20, tickcolor: '#ffffff', tickfont: { family: 'Arial', color: 'darkgrey' }, title: { text: 'Bacteria ID ', font: { family: 'Arial', size: 18, color: 'darkgrey' }, }, }, }; // Render the plot to the div tag with id 'bar' Plotly.newPlot('bar', data, layout, { modeBarButtonsToRemove: [ 'zoom2d', 'pan2d', 'select2d', 'lasso2d', 'autoScale2d', 'toggleSpikelines', 'hoverCompareCartesian' ] }, ); }); }; // Bubble chart function getBubble(id) { // Read data from json file for each sample, assign it to a variable, and plot it d3.json('data/samples.json') .then(data => { var sortedSample = data.samples .filter(sample => sample.id === id)[0]; console.log(sortedSample); // Trace for bubble chart that displays each sample values var bubbleTrace = { x: sortedSample.otu_ids, y: sortedSample.sample_values, text: sortedSample.otu_labels, mode: "markers", marker: { size: sortedSample.sample_values, color: sortedSample.otu_ids, colorscale: [ [0, '#b3d1ff'], [0.2, '#b3d1ff'], [0.2, '#1a75ff'], [0.4, '#1a75ff'], [0.4, '#00cc88'], [0.6, '#00cc88'], [0.6, '#ccffcc'], [0.8, '#ccffcc'], [0.8, '#99ff33'], [1.0, '#99ff33'], ], opacity: 0.8, line: { color: '#999999', width: 1 } }, }; // Data var data = [bubbleTrace]; // Layout var layout = { title: { text: `Test Subject No. ${id} Belly Button Biodiversity`, font: { family: 'Arial', size: 24, color: 'black' }, }, //margin: {l: 50, r: 100, t: 30, b: 30}, height: 520, width: 920, xaxis: { tickcolor: '#ffffff', tickfont: { family: 'Arial', color: 'darkgrey' }, title: { text: 'OTU ID (Bacteria)', font: { family: 'Arial', size: 18, color: 'darkgrey' }, }, }, yaxis: { automargin: true, tickcolor: '#ffffff', tickfont: { family: 'Arial', color: 'darkgrey' }, title: { text: 'Sample Value', font: { family: 'Arial', size: 18, color: 'darkgrey' }, }, }, }; // Render the plot to the div tag with id 'bubble' Plotly.newPlot('bubble', data, layout, { modeBarButtonsToRemove: [ 'zoom2d', 'pan2d', 'select2d', 'lasso2d', 'autoScale2d', 'toggleSpikelines', 'hoverCompareCartesian' ] }, ); }); }; // Gauge chart function getGauge(id) { // Read "metadata" from json file for each subject and assign it to a variable d3.json('data/samples.json') .then(data => { var subjectData = data.metadata .filter(subject => subject.id.toString() === id)[0]; console.log(subjectData); // Extract "wfreq" data and assign it to a variable to build an indicator var value = subjectData.wfreq; console.log(value); // Data var data = [ { domain: { x: [0, 1], y: [0, 1] }, type: 'indicator', mode: 'gauge+number', data-otu_labels value: value, title: { text: 'Belly Button Washing Frequency <br><i>Scrubs per Week</i>', font: { size: 24, color: 'black', family: 'Arial' } }, gauge: { axis: { range: [null, 9], tickwidth: 1, tickcolor: 'darkgrey' }, bar: { color: '#cccccc', thickness: 0.3 }, bgcolor: 'white', borderwidth: 0, bordercolor: 'gray', steps: [ { range: [0, 1], color: '#9CF6AE' }, { range: [1, 2], color: '#bbff99' }, { range: [2, 3], color: '#ccffcc' }, { range: [3, 4], color: '#00cc88' }, { range: [4, 5], color: '#b3d9ff' }, { range: [5, 6], color: '#66a3ff' }, { range: [6, 7], color: '#1a75ff' }, { range: [7, 8], color: '#005ce6' }, { range: [8, 9], color: '#003d99' } ], }, }, ]; // Layout var layout = { width: 440, height: 360, margin: { t: 35, r: 15, l: 15, b: 0 }, font: { color: 'darkgrey', family: 'Arial' } }; // Render the plot to the div tag with id 'gauge' Plotly.newPlot('gauge', data, layout); }); };
App({ })
/* axios v0.19.0-beta.1 | (c) 2018 by Matt Zabriskie */ (function webpackUniversalModuleDefinition(root, factory) { if(typeof exports === 'object' && typeof module === 'object') module.exports = factory(); else if(typeof define === 'function' && define.amd) define([], factory); else if(typeof exports === 'object') exports["axios"] = factory(); else root["axios"] = factory(); })(this, function() { return /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) /******/ return installedModules[moduleId].exports; /******/ /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ exports: {}, /******/ id: moduleId, /******/ loaded: false /******/ }; /******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/ module.loaded = true; /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = ""; /******/ /******/ // Load entry module and return exports /******/ return __webpack_require__(0); /******/ }) /************************************************************************/ /******/ ([ /* 0 */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__(1); /***/ }), /* 1 */ /***/ (function(module, exports, __webpack_require__) { 'use strict'; var utils = __webpack_require__(2); var bind = __webpack_require__(3); var Axios = __webpack_require__(5); var mergeConfig = __webpack_require__(22); var defaults = __webpack_require__(11); /** * Create an instance of Axios * * @param {Object} defaultConfig The default config for the instance * @return {Axios} A new instance of Axios */ function createInstance(defaultConfig) { var context = new Axios(defaultConfig); var instance = bind(Axios.prototype.request, context); // Copy axios.prototype to instance utils.extend(instance, Axios.prototype, context); // Copy context to instance utils.extend(instance, context); return instance; } // Create the default instance to be exported var axios = createInstance(defaults); // Expose Axios class to allow class inheritance axios.Axios = Axios; // Factory for creating new instances axios.create = function create(instanceConfig) { return createInstance(mergeConfig(axios.defaults, instanceConfig)); }; // Expose Cancel & CancelToken axios.Cancel = __webpack_require__(23); axios.CancelToken = __webpack_require__(24); axios.isCancel = __webpack_require__(10); // Expose all/spread axios.all = function all(promises) { return Promise.all(promises); }; axios.spread = __webpack_require__(25); module.exports = axios; // Allow use of default import syntax in TypeScript module.exports.default = axios; /***/ }), /* 2 */ /***/ (function(module, exports, __webpack_require__) { 'use strict'; var bind = __webpack_require__(3); var isBuffer = __webpack_require__(4); /*global toString:true*/ // utils is a library of generic helper functions non-specific to axios var toString = Object.prototype.toString; /** * Determine if a value is an Array * * @param {Object} val The value to test * @returns {boolean} True if value is an Array, otherwise false */ function isArray(val) { return toString.call(val) === '[object Array]'; } /** * Determine if a value is an ArrayBuffer * * @param {Object} val The value to test * @returns {boolean} True if value is an ArrayBuffer, otherwise false */ function isArrayBuffer(val) { return toString.call(val) === '[object ArrayBuffer]'; } /** * Determine if a value is a FormData * * @param {Object} val The value to test * @returns {boolean} True if value is an FormData, otherwise false */ function isFormData(val) { return (typeof FormData !== 'undefined') && (val instanceof FormData); } /** * Determine if a value is a view on an ArrayBuffer * * @param {Object} val The value to test * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false */ function isArrayBufferView(val) { var result; if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) { result = ArrayBuffer.isView(val); } else { result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer); } return result; } /** * Determine if a value is a String * * @param {Object} val The value to test * @returns {boolean} True if value is a String, otherwise false */ function isString(val) { return typeof val === 'string'; } /** * Determine if a value is a Number * * @param {Object} val The value to test * @returns {boolean} True if value is a Number, otherwise false */ function isNumber(val) { return typeof val === 'number'; } /** * Determine if a value is undefined * * @param {Object} val The value to test * @returns {boolean} True if the value is undefined, otherwise false */ function isUndefined(val) { return typeof val === 'undefined'; } /** * Determine if a value is an Object * * @param {Object} val The value to test * @returns {boolean} True if value is an Object, otherwise false */ function isObject(val) { return val !== null && typeof val === 'object'; } /** * Determine if a value is a Date * * @param {Object} val The value to test * @returns {boolean} True if value is a Date, otherwise false */ function isDate(val) { return toString.call(val) === '[object Date]'; } /** * Determine if a value is a File * * @param {Object} val The value to test * @returns {boolean} True if value is a File, otherwise false */ function isFile(val) { return toString.call(val) === '[object File]'; } /** * Determine if a value is a Blob * * @param {Object} val The value to test * @returns {boolean} True if value is a Blob, otherwise false */ function isBlob(val) { return toString.call(val) === '[object Blob]'; } /** * Determine if a value is a Function * * @param {Object} val The value to test * @returns {boolean} True if value is a Function, otherwise false */ function isFunction(val) { return toString.call(val) === '[object Function]'; } /** * Determine if a value is a Stream * * @param {Object} val The value to test * @returns {boolean} True if value is a Stream, otherwise false */ function isStream(val) { return isObject(val) && isFunction(val.pipe); } /** * Determine if a value is a URLSearchParams object * * @param {Object} val The value to test * @returns {boolean} True if value is a URLSearchParams object, otherwise false */ function isURLSearchParams(val) { return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams; } /** * Trim excess whitespace off the beginning and end of a string * * @param {String} str The String to trim * @returns {String} The String freed of excess whitespace */ function trim(str) { return str.replace(/^\s*/, '').replace(/\s*$/, ''); } /** * Determine if we're running in a standard browser environment * * This allows axios to run in a web worker, and react-native. * Both environments support XMLHttpRequest, but not fully standard globals. * * web workers: * typeof window -> undefined * typeof document -> undefined * * react-native: * navigator.product -> 'ReactNative' * nativescript * navigator.product -> 'NativeScript' or 'NS' */ function isStandardBrowserEnv() { if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' || navigator.product === 'NativeScript' || navigator.product === 'NS')) { return false; } return ( typeof window !== 'undefined' && typeof document !== 'undefined' ); } /** * Iterate over an Array or an Object invoking a function for each item. * * If `obj` is an Array callback will be called passing * the value, index, and complete array for each item. * * If 'obj' is an Object callback will be called passing * the value, key, and complete object for each property. * * @param {Object|Array} obj The object to iterate * @param {Function} fn The callback to invoke for each item */ function forEach(obj, fn) { // Don't bother if no value provided if (obj === null || typeof obj === 'undefined') { return; } // Force an array if not already something iterable if (typeof obj !== 'object') { /*eslint no-param-reassign:0*/ obj = [obj]; } if (isArray(obj)) { // Iterate over array values for (var i = 0, l = obj.length; i < l; i++) { fn.call(null, obj[i], i, obj); } } else { // Iterate over object keys for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { fn.call(null, obj[key], key, obj); } } } } /** * Accepts varargs expecting each argument to be an object, then * immutably merges the properties of each object and returns result. * * When multiple objects contain the same key the later object in * the arguments list will take precedence. * * Example: * * ```js * var result = merge({foo: 123}, {foo: 456}); * console.log(result.foo); // outputs 456 * ``` * * @param {Object} obj1 Object to merge * @returns {Object} Result of all merge properties */ function merge(/* obj1, obj2, obj3, ... */) { var result = {}; function assignValue(val, key) { if (typeof result[key] === 'object' && typeof val === 'object') { result[key] = merge(result[key], val); } else { result[key] = val; } } for (var i = 0, l = arguments.length; i < l; i++) { forEach(arguments[i], assignValue); } return result; } /** * Function equal to merge with the difference being that no reference * to original objects is kept. * * @see merge * @param {Object} obj1 Object to merge * @returns {Object} Result of all merge properties */ function deepMerge(/* obj1, obj2, obj3, ... */) { var result = {}; function assignValue(val, key) { if (typeof result[key] === 'object' && typeof val === 'object') { result[key] = deepMerge(result[key], val); } else if (typeof val === 'object') { result[key] = deepMerge({}, val); } else { result[key] = val; } } for (var i = 0, l = arguments.length; i < l; i++) { forEach(arguments[i], assignValue); } return result; } /** * Extends object a by mutably adding to it the properties of object b. * * @param {Object} a The object to be extended * @param {Object} b The object to copy properties from * @param {Object} thisArg The object to bind function to * @return {Object} The resulting value of object a */ function extend(a, b, thisArg) { forEach(b, function assignValue(val, key) { if (thisArg && typeof val === 'function') { a[key] = bind(val, thisArg); } else { a[key] = val; } }); return a; } module.exports = { isArray: isArray, isArrayBuffer: isArrayBuffer, isBuffer: isBuffer, isFormData: isFormData, isArrayBufferView: isArrayBufferView, isString: isString, isNumber: isNumber, isObject: isObject, isUndefined: isUndefined, isDate: isDate, isFile: isFile, isBlob: isBlob, isFunction: isFunction, isStream: isStream, isURLSearchParams: isURLSearchParams, isStandardBrowserEnv: isStandardBrowserEnv, forEach: forEach, merge: merge, deepMerge: deepMerge, extend: extend, trim: trim }; /***/ }), /* 3 */ /***/ (function(module, exports) { 'use strict'; module.exports = function bind(fn, thisArg) { return function wrap() { var args = new Array(arguments.length); for (var i = 0; i < args.length; i++) { args[i] = arguments[i]; } return fn.apply(thisArg, args); }; }; /***/ }), /* 4 */ /***/ (function(module, exports) { /*! * Determine if an object is a Buffer * * @author Feross Aboukhadijeh <https://feross.org> * @license MIT */ module.exports = function isBuffer (obj) { return obj != null && obj.constructor != null && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj) } /***/ }), /* 5 */ /***/ (function(module, exports, __webpack_require__) { 'use strict'; var utils = __webpack_require__(2); var buildURL = __webpack_require__(6); var InterceptorManager = __webpack_require__(7); var dispatchRequest = __webpack_require__(8); var mergeConfig = __webpack_require__(22); /** * Create a new instance of Axios * * @param {Object} instanceConfig The default config for the instance */ function Axios(instanceConfig) { this.defaults = instanceConfig; this.interceptors = { request: new InterceptorManager(), response: new InterceptorManager() }; } /** * Dispatch a request * * @param {Object} config The config specific for this request (merged with this.defaults) */ Axios.prototype.request = function request(config) { /*eslint no-param-reassign:0*/ // Allow for axios('example/url'[, config]) a la fetch API if (typeof config === 'string') { config = arguments[1] || {}; config.url = arguments[0]; } else { config = config || {}; } config = mergeConfig(this.defaults, config); config.method = config.method ? config.method.toLowerCase() : 'get'; // Hook up interceptors middleware var chain = [dispatchRequest, undefined]; var promise = Promise.resolve(config); this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) { chain.unshift(interceptor.fulfilled, interceptor.rejected); }); this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) { chain.push(interceptor.fulfilled, interceptor.rejected); }); while (chain.length) { promise = promise.then(chain.shift(), chain.shift()); } return promise; }; Axios.prototype.getUri = function getUri(config) { config = mergeConfig(this.defaults, config); return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\?/, ''); }; // Provide aliases for supported request methods utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) { /*eslint func-names:0*/ Axios.prototype[method] = function(url, config) { return this.request(utils.merge(config || {}, { method: method, url: url })); }; }); utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { /*eslint func-names:0*/ Axios.prototype[method] = function(url, data, config) { return this.request(utils.merge(config || {}, { method: method, url: url, data: data })); }; }); module.exports = Axios; /***/ }), /* 6 */ /***/ (function(module, exports, __webpack_require__) { 'use strict'; var utils = __webpack_require__(2); function encode(val) { return encodeURIComponent(val). replace(/%40/gi, '@'). replace(/%3A/gi, ':'). replace(/%24/g, '$'). replace(/%2C/gi, ','). replace(/%20/g, '+'). replace(/%5B/gi, '['). replace(/%5D/gi, ']'); } /** * Build a URL by appending params to the end * * @param {string} url The base of the url (e.g., http://www.google.com) * @param {object} [params] The params to be appended * @returns {string} The formatted url */ module.exports = function buildURL(url, params, paramsSerializer) { /*eslint no-param-reassign:0*/ if (!params) { return url; } var serializedParams; if (paramsSerializer) { serializedParams = paramsSerializer(params); } else if (utils.isURLSearchParams(params)) { serializedParams = params.toString(); } else { var parts = []; utils.forEach(params, function serialize(val, key) { if (val === null || typeof val === 'undefined') { return; } if (utils.isArray(val)) { key = key + '[]'; } else { val = [val]; } utils.forEach(val, function parseValue(v) { if (utils.isDate(v)) { v = v.toISOString(); } else if (utils.isObject(v)) { v = JSON.stringify(v); } parts.push(encode(key) + '=' + encode(v)); }); }); serializedParams = parts.join('&'); } if (serializedParams) { url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams; } return url; }; /***/ }), /* 7 */ /***/ (function(module, exports, __webpack_require__) { 'use strict'; var utils = __webpack_require__(2); function InterceptorManager() { this.handlers = []; } /** * Add a new interceptor to the stack * * @param {Function} fulfilled The function to handle `then` for a `Promise` * @param {Function} rejected The function to handle `reject` for a `Promise` * * @return {Number} An ID used to remove interceptor later */ InterceptorManager.prototype.use = function use(fulfilled, rejected) { this.handlers.push({ fulfilled: fulfilled, rejected: rejected }); return this.handlers.length - 1; }; /** * Remove an interceptor from the stack * * @param {Number} id The ID that was returned by `use` */ InterceptorManager.prototype.eject = function eject(id) { if (this.handlers[id]) { this.handlers[id] = null; } }; /** * Iterate over all the registered interceptors * * This method is particularly useful for skipping over any * interceptors that may have become `null` calling `eject`. * * @param {Function} fn The function to call for each interceptor */ InterceptorManager.prototype.forEach = function forEach(fn) { utils.forEach(this.handlers, function forEachHandler(h) { if (h !== null) { fn(h); } }); }; module.exports = InterceptorManager; /***/ }), /* 8 */ /***/ (function(module, exports, __webpack_require__) { 'use strict'; var utils = __webpack_require__(2); var transformData = __webpack_require__(9); var isCancel = __webpack_require__(10); var defaults = __webpack_require__(11); var isAbsoluteURL = __webpack_require__(20); var combineURLs = __webpack_require__(21); /** * Throws a `Cancel` if cancellation has been requested. */ function throwIfCancellationRequested(config) { if (config.cancelToken) { config.cancelToken.throwIfRequested(); } } /** * Dispatch a request to the server using the configured adapter. * * @param {object} config The config that is to be used for the request * @returns {Promise} The Promise to be fulfilled */ module.exports = function dispatchRequest(config) { throwIfCancellationRequested(config); // Support baseURL config if (config.baseURL && !isAbsoluteURL(config.url)) { config.url = combineURLs(config.baseURL, config.url); } // Ensure headers exist config.headers = config.headers || {}; // Transform request data config.data = transformData( config.data, config.headers, config.transformRequest ); // Flatten headers config.headers = utils.merge( config.headers.common || {}, config.headers[config.method] || {}, config.headers || {} ); utils.forEach( ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'], function cleanHeaderConfig(method) { delete config.headers[method]; } ); var adapter = config.adapter || defaults.adapter; return adapter(config).then(function onAdapterResolution(response) { throwIfCancellationRequested(config); // Transform response data response.data = transformData( response.data, response.headers, config.transformResponse ); return response; }, function onAdapterRejection(reason) { if (!isCancel(reason)) { throwIfCancellationRequested(config); // Transform response data if (reason && reason.response) { reason.response.data = transformData( reason.response.data, reason.response.headers, config.transformResponse ); } } return Promise.reject(reason); }); }; /***/ }), /* 9 */ /***/ (function(module, exports, __webpack_require__) { 'use strict'; var utils = __webpack_require__(2); /** * Transform the data for a request or a response * * @param {Object|String} data The data to be transformed * @param {Array} headers The headers for the request or response * @param {Array|Function} fns A single function or Array of functions * @returns {*} The resulting transformed data */ module.exports = function transformData(data, headers, fns) { /*eslint no-param-reassign:0*/ utils.forEach(fns, function transform(fn) { data = fn(data, headers); }); return data; }; /***/ }), /* 10 */ /***/ (function(module, exports) { 'use strict'; module.exports = function isCancel(value) { return !!(value && value.__CANCEL__); }; /***/ }), /* 11 */ /***/ (function(module, exports, __webpack_require__) { 'use strict'; var utils = __webpack_require__(2); var normalizeHeaderName = __webpack_require__(12); var DEFAULT_CONTENT_TYPE = { 'Content-Type': 'application/x-www-form-urlencoded' }; function setContentTypeIfUnset(headers, value) { if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) { headers['Content-Type'] = value; } } function getDefaultAdapter() { var adapter; // Only Node.JS has a process variable that is of [[Class]] process if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') { // For node use HTTP adapter adapter = __webpack_require__(13); } else if (typeof XMLHttpRequest !== 'undefined') { // For browsers use XHR adapter adapter = __webpack_require__(13); } return adapter; } var defaults = { adapter: getDefaultAdapter(), transformRequest: [function transformRequest(data, headers) { normalizeHeaderName(headers, 'Accept'); normalizeHeaderName(headers, 'Content-Type'); if (utils.isFormData(data) || utils.isArrayBuffer(data) || utils.isBuffer(data) || utils.isStream(data) || utils.isFile(data) || utils.isBlob(data) ) { return data; } if (utils.isArrayBufferView(data)) { return data.buffer; } if (utils.isURLSearchParams(data)) { setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8'); return data.toString(); } if (utils.isObject(data)) { setContentTypeIfUnset(headers, 'application/json;charset=utf-8'); return JSON.stringify(data); } return data; }], transformResponse: [function transformResponse(data) { /*eslint no-param-reassign:0*/ if (typeof data === 'string') { try { data = JSON.parse(data); } catch (e) { /* Ignore */ } } return data; }], /** * A timeout in milliseconds to abort a request. If set to 0 (default) a * timeout is not created. */ timeout: 0, xsrfCookieName: 'XSRF-TOKEN', xsrfHeaderName: 'X-XSRF-TOKEN', maxContentLength: -1, validateStatus: function validateStatus(status) { return status >= 200 && status < 300; } }; defaults.headers = { common: { 'Accept': 'application/json, text/plain, */*' } }; utils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) { defaults.headers[method] = {}; }); utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE); }); module.exports = defaults; /***/ }), /* 12 */ /***/ (function(module, exports, __webpack_require__) { 'use strict'; var utils = __webpack_require__(2); module.exports = function normalizeHeaderName(headers, normalizedName) { utils.forEach(headers, function processHeader(value, name) { if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) { headers[normalizedName] = value; delete headers[name]; } }); }; /***/ }), /* 13 */ /***/ (function(module, exports, __webpack_require__) { 'use strict'; var utils = __webpack_require__(2); var settle = __webpack_require__(14); var buildURL = __webpack_require__(6); var parseHeaders = __webpack_require__(17); var isURLSameOrigin = __webpack_require__(18); var createError = __webpack_require__(15); module.exports = function xhrAdapter(config) { return new Promise(function dispatchXhrRequest(resolve, reject) { var requestData = config.data; var requestHeaders = config.headers; if (utils.isFormData(requestData)) { delete requestHeaders['Content-Type']; // Let the browser set it } var request = new XMLHttpRequest(); // HTTP basic authentication if (config.auth) { var username = config.auth.username || ''; var password = config.auth.password || ''; requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password); } request.open(config.method.toUpperCase(), buildURL(config.url, config.params, config.paramsSerializer), true); // Set the request timeout in MS request.timeout = config.timeout; // Listen for ready state request.onreadystatechange = function handleLoad() { if (!request || request.readyState !== 4) { return; } // The request errored out and we didn't get a response, this will be // handled by onerror instead // With one exception: request that using file: protocol, most browsers // will return status as 0 even though it's a successful request if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) { return; } // Prepare the response var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null; var responseData = !config.responseType || config.responseType === 'text' ? request.responseText : request.response; var response = { data: responseData, status: request.status, statusText: request.statusText, headers: responseHeaders, config: config, request: request }; settle(resolve, reject, response); // Clean up request request = null; }; // Handle browser request cancellation (as opposed to a manual cancellation) request.onabort = function handleAbort() { if (!request) { return; } reject(createError('Request aborted', config, 'ECONNABORTED', request)); // Clean up request request = null; }; // Handle low level network errors request.onerror = function handleError() { // Real errors are hidden from us by the browser // onerror should only fire if it's a network error reject(createError('Network Error', config, null, request)); // Clean up request request = null; }; // Handle timeout request.ontimeout = function handleTimeout() { reject(createError('timeout of ' + config.timeout + 'ms exceeded', config, 'ECONNABORTED', request)); // Clean up request request = null; }; // Add xsrf header // This is only done if running in a standard browser environment. // Specifically not if we're in a web worker, or react-native. if (utils.isStandardBrowserEnv()) { var cookies = __webpack_require__(19); // Add xsrf header var xsrfValue = (config.withCredentials || isURLSameOrigin(config.url)) && config.xsrfCookieName ? cookies.read(config.xsrfCookieName) : undefined; if (xsrfValue) { requestHeaders[config.xsrfHeaderName] = xsrfValue; } } // Add headers to the request if ('setRequestHeader' in request) { utils.forEach(requestHeaders, function setRequestHeader(val, key) { if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') { // Remove Content-Type if data is undefined delete requestHeaders[key]; } else { // Otherwise add header to the request request.setRequestHeader(key, val); } }); } // Add withCredentials to request if needed if (config.withCredentials) { request.withCredentials = true; } // Add responseType to request if needed if (config.responseType) { try { request.responseType = config.responseType; } catch (e) { // Expected DOMException thrown by browsers not compatible XMLHttpRequest Level 2. // But, this can be suppressed for 'json' type as it can be parsed by default 'transformResponse' function. if (config.responseType !== 'json') { throw e; } } } // Handle progress if needed if (typeof config.onDownloadProgress === 'function') { request.addEventListener('progress', config.onDownloadProgress); } // Not all browsers support upload events if (typeof config.onUploadProgress === 'function' && request.upload) { request.upload.addEventListener('progress', config.onUploadProgress); } if (config.cancelToken) { // Handle cancellation config.cancelToken.promise.then(function onCanceled(cancel) { if (!request) { return; } request.abort(); reject(cancel); // Clean up request request = null; }); } if (requestData === undefined) { requestData = null; } // Send the request request.send(requestData); }); }; /***/ }), /* 14 */ /***/ (function(module, exports, __webpack_require__) { 'use strict'; var createError = __webpack_require__(15); /** * Resolve or reject a Promise based on response status. * * @param {Function} resolve A function that resolves the promise. * @param {Function} reject A function that rejects the promise. * @param {object} response The response. */ module.exports = function settle(resolve, reject, response) { var validateStatus = response.config.validateStatus; if (!validateStatus || validateStatus(response.status)) { resolve(response); } else { reject(createError( 'Request failed with status code ' + response.status, response.config, null, response.request, response )); } }; /***/ }), /* 15 */ /***/ (function(module, exports, __webpack_require__) { 'use strict'; var enhanceError = __webpack_require__(16); /** * Create an Error with the specified message, config, error code, request and response. * * @param {string} message The error message. * @param {Object} config The config. * @param {string} [code] The error code (for example, 'ECONNABORTED'). * @param {Object} [request] The request. * @param {Object} [response] The response. * @returns {Error} The created error. */ module.exports = function createError(message, config, code, request, response) { var error = new Error(message); return enhanceError(error, config, code, request, response); }; /***/ }), /* 16 */ /***/ (function(module, exports) { 'use strict'; /** * Update an Error with the specified config, error code, and response. * * @param {Error} error The error to update. * @param {Object} config The config. * @param {string} [code] The error code (for example, 'ECONNABORTED'). * @param {Object} [request] The request. * @param {Object} [response] The response. * @returns {Error} The error. */ module.exports = function enhanceError(error, config, code, request, response) { error.config = config; if (code) { error.code = code; } error.request = request; error.response = response; error.toJSON = function() { return { // Standard message: this.message, name: this.name, // Microsoft description: this.description, number: this.number, // Mozilla fileName: this.fileName, lineNumber: this.lineNumber, columnNumber: this.columnNumber, stack: this.stack, // Axios config: this.config, code: this.code }; }; return error; }; /***/ }), /* 17 */ /***/ (function(module, exports, __webpack_require__) { 'use strict'; var utils = __webpack_require__(2); // Headers whose duplicates are ignored by node // c.f. https://nodejs.org/api/http.html#http_message_headers var ignoreDuplicateOf = [ 'age', 'authorization', 'content-length', 'content-type', 'etag', 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since', 'last-modified', 'location', 'max-forwards', 'proxy-authorization', 'referer', 'retry-after', 'user-agent' ]; /** * Parse headers into an object * * ``` * Date: Wed, 27 Aug 2014 08:58:49 GMT * Content-Type: application/json * Connection: keep-alive * Transfer-Encoding: chunked * ``` * * @param {String} headers Headers needing to be parsed * @returns {Object} Headers parsed into an object */ module.exports = function parseHeaders(headers) { var parsed = {}; var key; var val; var i; if (!headers) { return parsed; } utils.forEach(headers.split('\n'), function parser(line) { i = line.indexOf(':'); key = utils.trim(line.substr(0, i)).toLowerCase(); val = utils.trim(line.substr(i + 1)); if (key) { if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) { return; } if (key === 'set-cookie') { parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]); } else { parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val; } } }); return parsed; }; /***/ }), /* 18 */ /***/ (function(module, exports, __webpack_require__) { 'use strict'; var utils = __webpack_require__(2); module.exports = ( utils.isStandardBrowserEnv() ? // Standard browser envs have full support of the APIs needed to test // whether the request URL is of the same origin as current location. (function standardBrowserEnv() { var msie = /(msie|trident)/i.test(navigator.userAgent); var urlParsingNode = document.createElement('a'); var originURL; /** * Parse a URL to discover it's components * * @param {String} url The URL to be parsed * @returns {Object} */ function resolveURL(url) { var href = url; if (msie) { // IE needs attribute set twice to normalize properties urlParsingNode.setAttribute('href', href); href = urlParsingNode.href; } urlParsingNode.setAttribute('href', href); // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils return { href: urlParsingNode.href, protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '', host: urlParsingNode.host, search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '', hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '', hostname: urlParsingNode.hostname, port: urlParsingNode.port, pathname: (urlParsingNode.pathname.charAt(0) === '/') ? urlParsingNode.pathname : '/' + urlParsingNode.pathname }; } originURL = resolveURL(window.location.href); /** * Determine if a URL shares the same origin as the current location * * @param {String} requestURL The URL to test * @returns {boolean} True if URL shares the same origin, otherwise false */ return function isURLSameOrigin(requestURL) { var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL; return (parsed.protocol === originURL.protocol && parsed.host === originURL.host); }; })() : // Non standard browser envs (web workers, react-native) lack needed support. (function nonStandardBrowserEnv() { return function isURLSameOrigin() { return true; }; })() ); /***/ }), /* 19 */ /***/ (function(module, exports, __webpack_require__) { 'use strict'; var utils = __webpack_require__(2); module.exports = ( utils.isStandardBrowserEnv() ? // Standard browser envs support document.cookie (function standardBrowserEnv() { return { write: function write(name, value, expires, path, domain, secure) { var cookie = []; cookie.push(name + '=' + encodeURIComponent(value)); if (utils.isNumber(expires)) { cookie.push('expires=' + new Date(expires).toGMTString()); } if (utils.isString(path)) { cookie.push('path=' + path); } if (utils.isString(domain)) { cookie.push('domain=' + domain); } if (secure === true) { cookie.push('secure'); } document.cookie = cookie.join('; '); }, read: function read(name) { var match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)')); return (match ? decodeURIComponent(match[3]) : null); }, remove: function remove(name) { this.write(name, '', Date.now() - 86400000); } }; })() : // Non standard browser env (web workers, react-native) lack needed support. (function nonStandardBrowserEnv() { return { write: function write() {}, read: function read() { return null; }, remove: function remove() {} }; })() ); /***/ }), /* 20 */ /***/ (function(module, exports) { 'use strict'; /** * Determines whether the specified URL is absolute * * @param {string} url The URL to test * @returns {boolean} True if the specified URL is absolute, otherwise false */ module.exports = function isAbsoluteURL(url) { // A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL). // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed // by any combination of letters, digits, plus, period, or hyphen. return /^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(url); }; /***/ }), /* 21 */ /***/ (function(module, exports) { 'use strict'; /** * Creates a new URL by combining the specified URLs * * @param {string} baseURL The base URL * @param {string} relativeURL The relative URL * @returns {string} The combined URL */ module.exports = function combineURLs(baseURL, relativeURL) { return relativeURL ? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '') : baseURL; }; /***/ }), /* 22 */ /***/ (function(module, exports, __webpack_require__) { 'use strict'; var utils = __webpack_require__(2); /** * Config-specific merge-function which creates a new config-object * by merging two configuration objects together. * * @param {Object} config1 * @param {Object} config2 * @returns {Object} New object resulting from merging config2 to config1 */ module.exports = function mergeConfig(config1, config2) { // eslint-disable-next-line no-param-reassign config2 = config2 || {}; var config = {}; utils.forEach(['url', 'method', 'params', 'data'], function valueFromConfig2(prop) { if (typeof config2[prop] !== 'undefined') { config[prop] = config2[prop]; } }); utils.forEach(['headers', 'auth', 'proxy'], function mergeDeepProperties(prop) { if (utils.isObject(config2[prop])) { config[prop] = utils.deepMerge(config1[prop], config2[prop]); } else if (typeof config2[prop] !== 'undefined') { config[prop] = config2[prop]; } else if (utils.isObject(config1[prop])) { config[prop] = utils.deepMerge(config1[prop]); } else if (typeof config1[prop] !== 'undefined') { config[prop] = config1[prop]; } }); utils.forEach([ 'baseURL', 'transformRequest', 'transformResponse', 'paramsSerializer', 'timeout', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName', 'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress', 'maxContentLength', 'validateStatus', 'maxRedirects', 'httpAgent', 'httpsAgent', 'cancelToken', 'socketPath' ], function defaultToConfig2(prop) { if (typeof config2[prop] !== 'undefined') { config[prop] = config2[prop]; } else if (typeof config1[prop] !== 'undefined') { config[prop] = config1[prop]; } }); return config; }; /***/ }), /* 23 */ /***/ (function(module, exports) { 'use strict'; /** * A `Cancel` is an object that is thrown when an operation is canceled. * * @class * @param {string=} message The message. */ function Cancel(message) { this.message = message; } Cancel.prototype.toString = function toString() { return 'Cancel' + (this.message ? ': ' + this.message : ''); }; Cancel.prototype.__CANCEL__ = true; module.exports = Cancel; /***/ }), /* 24 */ /***/ (function(module, exports, __webpack_require__) { 'use strict'; var Cancel = __webpack_require__(23); /** * A `CancelToken` is an object that can be used to request cancellation of an operation. * * @class * @param {Function} executor The executor function. */ function CancelToken(executor) { if (typeof executor !== 'function') { throw new TypeError('executor must be a function.'); } var resolvePromise; this.promise = new Promise(function promiseExecutor(resolve) { resolvePromise = resolve; }); var token = this; executor(function cancel(message) { if (token.reason) { // Cancellation has already been requested return; } token.reason = new Cancel(message); resolvePromise(token.reason); }); } /** * Throws a `Cancel` if cancellation has been requested. */ CancelToken.prototype.throwIfRequested = function throwIfRequested() { if (this.reason) { throw this.reason; } }; /** * Returns an object that contains a new `CancelToken` and a function that, when called, * cancels the `CancelToken`. */ CancelToken.source = function source() { var cancel; var token = new CancelToken(function executor(c) { cancel = c; }); return { token: token, cancel: cancel }; }; module.exports = CancelToken; /***/ }), /* 25 */ /***/ (function(module, exports) { 'use strict'; /** * Syntactic sugar for invoking a function and expanding an array for arguments. * * Common use case would be to use `Function.prototype.apply`. * * ```js * function f(x, y, z) {} * var args = [1, 2, 3]; * f.apply(null, args); * ``` * * With `spread` this example can be re-written. * * ```js * spread(function(x, y, z) {})([1, 2, 3]); * ``` * * @param {Function} callback * @returns {Function} */ module.exports = function spread(callback) { return function wrap(arr) { return callback.apply(null, arr); }; }; /***/ }) /******/ ]) }); ; //# sourceMappingURL=axios.map
var classtime__series_1_1TimeSeries = [ [ "TimeSeries", "classtime__series_1_1TimeSeries.html#abd15b59569dc3dca7d1b848a0867a117", null ], [ "read_indexes", "classtime__series_1_1TimeSeries.html#acbd2aa3299e5c62811df429896791767", null ], [ "write_indexes", "classtime__series_1_1TimeSeries.html#a0fdedf27b55bbf78eed4d35f82cf3ace", null ] ];
import React from "react" import { View, Image, ImageBackground, TouchableOpacity, Text, Button, Switch, TextInput, StyleSheet, ScrollView } from "react-native" import Icon from "react-native-vector-icons/FontAwesome" import { CheckBox } from "react-native-elements" import { connect } from "react-redux" import { widthPercentageToDP as wp, heightPercentageToDP as hp } from "react-native-responsive-screen" import { getNavigationScreen } from "@screens" export class Blank extends React.Component { constructor(props) { super(props) this.state = {} } render = () => ( <ScrollView contentContainerStyle={{ flexGrow: 1 }} style={styles.ScrollView_1} > <View style={styles.View_2} /> <ImageBackground source={{ uri: "https://s3-us-west-2.amazonaws.com/figma-alpha-api/img/f512/0c74/1f94cf0cbba47a3e2e0ced4b1762a341" }} style={styles.ImageBackground_103_3} /> <ImageBackground source={{ uri: "https://s3-us-west-2.amazonaws.com/figma-alpha-api/img/bb4f/586a/de1c180f3648ae3ea47d13629a22b142" }} style={styles.ImageBackground_103_29} /> <View style={styles.View_103_31}> <Text style={styles.Text_103_31}>Schedule</Text> </View> <View style={styles.View_105_22}> <Text style={styles.Text_105_22}>Time</Text> </View> <View style={styles.View_103_32}> <Text style={styles.Text_103_32}>January 2022</Text> </View> <View style={styles.View_105_5}> <View style={styles.View_105_2} /> <View style={styles.View_105_3}> <Text style={styles.Text_105_3}>22</Text> </View> <View style={styles.View_105_4}> <Text style={styles.Text_105_4}>Wed</Text> </View> </View> <View style={styles.View_105_6}> <View style={styles.View_105_7} /> <View style={styles.View_105_8}> <Text style={styles.Text_105_8}>23</Text> </View> <View style={styles.View_105_9}> <Text style={styles.Text_105_9}>Thur</Text> </View> </View> <View style={styles.View_105_10}> <View style={styles.View_105_11} /> <View style={styles.View_105_12}> <Text style={styles.Text_105_12}>24</Text> </View> <View style={styles.View_105_13}> <Text style={styles.Text_105_13}>Fri</Text> </View> </View> <View style={styles.View_105_14}> <View style={styles.View_105_15} /> <View style={styles.View_105_16}> <Text style={styles.Text_105_16}>25</Text> </View> <View style={styles.View_105_17}> <Text style={styles.Text_105_17}>Sat</Text> </View> </View> <View style={styles.View_105_18}> <View style={styles.View_105_19} /> <View style={styles.View_105_20}> <Text style={styles.Text_105_20}>22</Text> </View> <View style={styles.View_105_21}> <Text style={styles.Text_105_21}>Wed</Text> </View> </View> <View style={styles.View_105_39}> <View style={styles.View_105_23} /> <View style={styles.View_105_24}> <Text style={styles.Text_105_24}>8:00</Text> </View> </View> <View style={styles.View_105_46}> <View style={styles.View_105_28} /> <View style={styles.View_105_35}> <Text style={styles.Text_105_35}>8:00</Text> </View> </View> <View style={styles.View_105_45}> <View style={styles.View_105_29} /> <View style={styles.View_105_36}> <Text style={styles.Text_105_36}>8:00</Text> </View> </View> <View style={styles.View_105_44}> <View style={styles.View_105_30} /> <View style={styles.View_105_37}> <Text style={styles.Text_105_37}>8:00</Text> </View> </View> <View style={styles.View_105_43}> <View style={styles.View_105_31} /> <View style={styles.View_105_38}> <Text style={styles.Text_105_38}>8:00</Text> </View> </View> <View style={styles.View_105_40}> <View style={styles.View_105_25} /> <View style={styles.View_105_32}> <Text style={styles.Text_105_32}>8:00</Text> </View> </View> <View style={styles.View_105_41}> <View style={styles.View_105_26} /> <View style={styles.View_105_33}> <Text style={styles.Text_105_33}>8:00</Text> </View> </View> <View style={styles.View_105_42}> <View style={styles.View_105_27} /> <View style={styles.View_105_34}> <Text style={styles.Text_105_34}>8:00</Text> </View> </View> <View style={styles.View_105_47}> <View style={styles.View_105_48}> <Text style={styles.Text_105_48}>Appointment</Text> </View> </View> <ImageBackground source={{ uri: "https://s3-us-west-2.amazonaws.com/figma-alpha-api/img/9da7/24fb/f30e8d0cbed5e34c79ee56d93dfeb008" }} style={styles.ImageBackground_105_49} /> <View style={styles.View_199_94}> <View style={styles.View_199_95} /> <View style={styles.View_199_96}> <ImageBackground source={{ uri: "https://s3-us-west-2.amazonaws.com/figma-alpha-api/img/3852/5c12/f4e3399824eb1f2c66cdfd2286b03ff6" }} style={styles.ImageBackground_199_97} /> <ImageBackground source={{ uri: "https://s3-us-west-2.amazonaws.com/figma-alpha-api/img/4ba2/fcd7/090f903dfe3c62a05021cd4473f07a95" }} style={styles.ImageBackground_199_98} /> <ImageBackground source={{ uri: "https://s3-us-west-2.amazonaws.com/figma-alpha-api/img/efd8/83ea/2558350c6acbd3b52d51fa2b8f9aa266" }} style={styles.ImageBackground_199_102} /> <ImageBackground source={{ uri: "https://s3-us-west-2.amazonaws.com/figma-alpha-api/img/4d11/da03/597a7a8251a9f1b237b09ed132dc1a72" }} style={styles.ImageBackground_199_103} /> </View> </View> </ScrollView> ) } const styles = StyleSheet.create({ ScrollView_1: { backgroundColor: "rgba(252, 252, 252, 1)" }, View_2: { height: hp("111%") }, ImageBackground_103_3: { width: wp("6%"), height: hp("3%"), top: hp("5%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("7%") }, ImageBackground_103_29: { width: wp("72%"), minWidth: wp("72%"), height: hp("41%"), minHeight: hp("41%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("14%"), top: hp("9%"), resizeMode: "cover" }, View_103_31: { width: wp("26%"), minWidth: wp("26%"), minHeight: hp("4%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("7%"), top: hp("52%"), justifyContent: "flex-start" }, Text_103_31: { color: "rgba(0, 0, 0, 1)", fontSize: 16, fontWeight: "700", textAlign: "left", fontStyle: "normal", letterSpacing: 0, textTransform: "none" }, View_105_22: { width: wp("14%"), minWidth: wp("14%"), minHeight: hp("4%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("7%"), top: hp("73%"), justifyContent: "flex-start" }, Text_105_22: { color: "rgba(0, 0, 0, 1)", fontSize: 16, fontWeight: "700", textAlign: "left", fontStyle: "normal", letterSpacing: 0, textTransform: "none" }, View_103_32: { width: wp("27%"), minWidth: wp("27%"), minHeight: hp("3%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("62%"), top: hp("53%"), justifyContent: "flex-start" }, Text_103_32: { color: "rgba(0, 0, 0, 1)", fontSize: 12, fontWeight: "500", textAlign: "left", fontStyle: "normal", letterSpacing: 0, textTransform: "none" }, View_105_5: { width: wp("16%"), minWidth: wp("16%"), height: hp("13%"), minHeight: hp("13%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("8%"), top: hp("58%") }, View_105_2: { width: wp("16%"), minWidth: wp("16%"), height: hp("13%"), minHeight: hp("13%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("0%"), top: hp("0%"), backgroundColor: "rgba(255, 197, 35, 1)", opacity: 0.20000000298023224, borderColor: "rgba(48, 157, 143, 1)", borderWidth: 1 }, View_105_3: { width: wp("8%"), minWidth: wp("8%"), minHeight: hp("5%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("4%"), top: hp("2%"), justifyContent: "flex-start" }, Text_105_3: { color: "rgba(0, 0, 0, 1)", fontSize: 20, fontWeight: "500", textAlign: "left", fontStyle: "normal", letterSpacing: 0, textTransform: "none" }, View_105_4: { width: wp("9%"), minWidth: wp("9%"), minHeight: hp("3%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("3%"), top: hp("7%"), justifyContent: "flex-start" }, Text_105_4: { color: "rgba(0, 0, 0, 1)", fontSize: 12, fontWeight: "500", textAlign: "left", fontStyle: "normal", letterSpacing: 0, textTransform: "none" }, View_105_6: { width: wp("16%"), minWidth: wp("16%"), height: hp("13%"), minHeight: hp("13%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("29%"), top: hp("58%") }, View_105_7: { width: wp("16%"), minWidth: wp("16%"), height: hp("13%"), minHeight: hp("13%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("0%"), top: hp("0%"), backgroundColor: "rgba(255, 197, 35, 1)", opacity: 0.20000000298023224, borderColor: "rgba(48, 157, 143, 1)", borderWidth: 1 }, View_105_8: { width: wp("8%"), minWidth: wp("8%"), minHeight: hp("5%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("4%"), top: hp("2%"), justifyContent: "flex-start" }, Text_105_8: { color: "rgba(0, 0, 0, 1)", fontSize: 20, fontWeight: "500", textAlign: "left", fontStyle: "normal", letterSpacing: 0, textTransform: "none" }, View_105_9: { width: wp("9%"), minWidth: wp("9%"), minHeight: hp("3%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("3%"), top: hp("7%"), justifyContent: "flex-start" }, Text_105_9: { color: "rgba(0, 0, 0, 1)", fontSize: 12, fontWeight: "500", textAlign: "left", fontStyle: "normal", letterSpacing: 0, textTransform: "none" }, View_105_10: { width: wp("16%"), minWidth: wp("16%"), height: hp("13%"), minHeight: hp("13%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("51%"), top: hp("58%") }, View_105_11: { width: wp("16%"), minWidth: wp("16%"), height: hp("13%"), minHeight: hp("13%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("0%"), top: hp("0%"), borderColor: "rgba(48, 157, 143, 1)", borderWidth: 1 }, View_105_12: { width: wp("8%"), minWidth: wp("8%"), minHeight: hp("5%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("4%"), top: hp("2%"), justifyContent: "flex-start" }, Text_105_12: { color: "rgba(0, 0, 0, 1)", fontSize: 20, fontWeight: "500", textAlign: "left", fontStyle: "normal", letterSpacing: 0, textTransform: "none" }, View_105_13: { width: wp("5%"), minWidth: wp("5%"), minHeight: hp("3%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("6%"), top: hp("7%"), justifyContent: "flex-start" }, Text_105_13: { color: "rgba(0, 0, 0, 1)", fontSize: 12, fontWeight: "500", textAlign: "left", fontStyle: "normal", letterSpacing: 0, textTransform: "none" }, View_105_14: { width: wp("16%"), minWidth: wp("16%"), height: hp("13%"), minHeight: hp("13%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("72%"), top: hp("58%") }, View_105_15: { width: wp("16%"), minWidth: wp("16%"), height: hp("13%"), minHeight: hp("13%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("0%"), top: hp("0%"), backgroundColor: "rgba(48, 157, 143, 1)", borderColor: "rgba(48, 157, 143, 1)", borderWidth: 1 }, View_105_16: { width: wp("8%"), minWidth: wp("8%"), minHeight: hp("5%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("4%"), top: hp("2%"), justifyContent: "flex-start" }, Text_105_16: { color: "rgba(255, 255, 255, 1)", fontSize: 20, fontWeight: "500", textAlign: "left", fontStyle: "normal", letterSpacing: 0, textTransform: "none" }, View_105_17: { width: wp("7%"), minWidth: wp("7%"), minHeight: hp("3%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("5%"), top: hp("7%"), justifyContent: "flex-start" }, Text_105_17: { color: "rgba(255, 255, 255, 1)", fontSize: 12, fontWeight: "500", textAlign: "left", fontStyle: "normal", letterSpacing: 0, textTransform: "none" }, View_105_18: { width: wp("16%"), minWidth: wp("16%"), height: hp("13%"), minHeight: hp("13%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("93%"), top: hp("58%") }, View_105_19: { width: wp("16%"), minWidth: wp("16%"), height: hp("13%"), minHeight: hp("13%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("0%"), top: hp("0%"), borderColor: "rgba(48, 157, 143, 1)", borderWidth: 1 }, View_105_20: { width: wp("8%"), minWidth: wp("8%"), minHeight: hp("5%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("4%"), top: hp("2%"), justifyContent: "flex-start" }, Text_105_20: { color: "rgba(0, 0, 0, 1)", fontSize: 20, fontWeight: "500", textAlign: "left", fontStyle: "normal", letterSpacing: 0, textTransform: "none" }, View_105_21: { width: wp("9%"), minWidth: wp("9%"), minHeight: hp("3%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("3%"), top: hp("7%"), justifyContent: "flex-start" }, Text_105_21: { color: "rgba(0, 0, 0, 1)", fontSize: 12, fontWeight: "500", textAlign: "left", fontStyle: "normal", letterSpacing: 0, textTransform: "none" }, View_105_39: { width: wp("18%"), minWidth: wp("18%"), height: hp("4%"), minHeight: hp("4%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("8%"), top: hp("78%") }, View_105_23: { width: wp("18%"), minWidth: wp("18%"), height: hp("4%"), minHeight: hp("4%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("0%"), top: hp("0%"), backgroundColor: "rgba(255, 197, 35, 1)", opacity: 0.20000000298023224, borderColor: "rgba(48, 157, 143, 1)", borderWidth: 1 }, View_105_24: { width: wp("9%"), minWidth: wp("9%"), minHeight: hp("3%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("4%"), top: hp("0%"), justifyContent: "flex-start" }, Text_105_24: { color: "rgba(0, 0, 0, 1)", fontSize: 12, fontWeight: "600", textAlign: "left", fontStyle: "normal", letterSpacing: 0, textTransform: "none" }, View_105_46: { width: wp("18%"), minWidth: wp("18%"), height: hp("4%"), minHeight: hp("4%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("8%"), top: hp("85%") }, View_105_28: { width: wp("18%"), minWidth: wp("18%"), height: hp("4%"), minHeight: hp("4%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("0%"), top: hp("0%"), backgroundColor: "rgba(255, 197, 35, 1)", opacity: 0.20000000298023224, borderColor: "rgba(48, 157, 143, 1)", borderWidth: 1 }, View_105_35: { width: wp("9%"), minWidth: wp("9%"), minHeight: hp("3%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("4%"), top: hp("0%"), justifyContent: "flex-start" }, Text_105_35: { color: "rgba(0, 0, 0, 1)", fontSize: 12, fontWeight: "600", textAlign: "left", fontStyle: "normal", letterSpacing: 0, textTransform: "none" }, View_105_45: { width: wp("18%"), minWidth: wp("18%"), height: hp("4%"), minHeight: hp("4%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("30%"), top: hp("85%") }, View_105_29: { width: wp("18%"), minWidth: wp("18%"), height: hp("4%"), minHeight: hp("4%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("0%"), top: hp("0%"), backgroundColor: "rgba(255, 197, 35, 1)", opacity: 0.20000000298023224, borderColor: "rgba(48, 157, 143, 1)", borderWidth: 1 }, View_105_36: { width: wp("9%"), minWidth: wp("9%"), minHeight: hp("3%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("4%"), top: hp("0%"), justifyContent: "flex-start" }, Text_105_36: { color: "rgba(0, 0, 0, 1)", fontSize: 12, fontWeight: "600", textAlign: "left", fontStyle: "normal", letterSpacing: 0, textTransform: "none" }, View_105_44: { width: wp("18%"), minWidth: wp("18%"), height: hp("4%"), minHeight: hp("4%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("52%"), top: hp("85%") }, View_105_30: { width: wp("18%"), minWidth: wp("18%"), height: hp("4%"), minHeight: hp("4%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("0%"), top: hp("0%"), borderColor: "rgba(48, 157, 143, 1)", borderWidth: 1 }, View_105_37: { width: wp("9%"), minWidth: wp("9%"), minHeight: hp("3%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("4%"), top: hp("0%"), justifyContent: "flex-start" }, Text_105_37: { color: "rgba(0, 0, 0, 1)", fontSize: 12, fontWeight: "600", textAlign: "left", fontStyle: "normal", letterSpacing: 0, textTransform: "none" }, View_105_43: { width: wp("18%"), minWidth: wp("18%"), height: hp("4%"), minHeight: hp("4%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("74%"), top: hp("85%") }, View_105_31: { width: wp("18%"), minWidth: wp("18%"), height: hp("4%"), minHeight: hp("4%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("0%"), top: hp("0%"), backgroundColor: "rgba(255, 197, 35, 1)", opacity: 0.20000000298023224, borderColor: "rgba(48, 157, 143, 1)", borderWidth: 1 }, View_105_38: { width: wp("9%"), minWidth: wp("9%"), minHeight: hp("3%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("4%"), top: hp("0%"), justifyContent: "flex-start" }, Text_105_38: { color: "rgba(0, 0, 0, 1)", fontSize: 12, fontWeight: "600", textAlign: "left", fontStyle: "normal", letterSpacing: 0, textTransform: "none" }, View_105_40: { width: wp("18%"), minWidth: wp("18%"), height: hp("4%"), minHeight: hp("4%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("30%"), top: hp("78%") }, View_105_25: { width: wp("18%"), minWidth: wp("18%"), height: hp("4%"), minHeight: hp("4%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("0%"), top: hp("0%"), backgroundColor: "rgba(48, 157, 143, 1)", borderColor: "rgba(48, 157, 143, 1)", borderWidth: 1 }, View_105_32: { width: wp("9%"), minWidth: wp("9%"), minHeight: hp("3%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("5%"), top: hp("0%"), justifyContent: "flex-start" }, Text_105_32: { color: "rgba(255, 255, 255, 1)", fontSize: 12, fontWeight: "600", textAlign: "left", fontStyle: "normal", letterSpacing: 0, textTransform: "none" }, View_105_41: { width: wp("18%"), minWidth: wp("18%"), height: hp("4%"), minHeight: hp("4%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("52%"), top: hp("78%") }, View_105_26: { width: wp("18%"), minWidth: wp("18%"), height: hp("4%"), minHeight: hp("4%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("0%"), top: hp("0%"), borderColor: "rgba(48, 157, 143, 1)", borderWidth: 1 }, View_105_33: { width: wp("9%"), minWidth: wp("9%"), minHeight: hp("3%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("5%"), top: hp("0%"), justifyContent: "flex-start" }, Text_105_33: { color: "rgba(0, 0, 0, 1)", fontSize: 12, fontWeight: "600", textAlign: "left", fontStyle: "normal", letterSpacing: 0, textTransform: "none" }, View_105_42: { width: wp("18%"), minWidth: wp("18%"), height: hp("4%"), minHeight: hp("4%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("74%"), top: hp("78%") }, View_105_27: { width: wp("18%"), minWidth: wp("18%"), height: hp("4%"), minHeight: hp("4%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("0%"), top: hp("0%"), borderColor: "rgba(48, 157, 143, 1)", borderWidth: 1 }, View_105_34: { width: wp("9%"), minWidth: wp("9%"), minHeight: hp("3%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("5%"), top: hp("0%"), justifyContent: "flex-start" }, Text_105_34: { color: "rgba(0, 0, 0, 1)", fontSize: 12, fontWeight: "600", textAlign: "left", fontStyle: "normal", letterSpacing: 0, textTransform: "none" }, View_105_47: { width: wp("85%"), height: hp("8%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("7%"), top: hp("92%"), backgroundColor: "rgba(34, 150, 135, 1)" }, View_105_48: { width: wp("37%"), minWidth: wp("37%"), minHeight: hp("4%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("24%"), top: hp("2%"), justifyContent: "flex-start" }, Text_105_48: { color: "rgba(255, 255, 255, 1)", fontSize: 16, fontWeight: "700", textAlign: "left", fontStyle: "normal", letterSpacing: 0, textTransform: "none" }, ImageBackground_105_49: { width: wp("8%"), height: hp("4%"), top: hp("52%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("88%") }, View_199_94: { width: wp("100%"), minWidth: wp("100%"), height: hp("8%"), minHeight: hp("8%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("0%"), top: hp("103%") }, View_199_95: { width: wp("100%"), minWidth: wp("100%"), height: hp("8%"), minHeight: hp("8%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("0%"), top: hp("0%"), backgroundColor: "rgba(255, 255, 255, 1)" }, View_199_96: { width: wp("83%"), minWidth: wp("83%"), height: hp("3%"), minHeight: hp("3%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("8%"), top: hp("3%"), backgroundColor: "rgba(0, 0, 0, 0)" }, ImageBackground_199_97: { width: wp("5%"), height: hp("3%"), top: hp("0%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("0%") }, ImageBackground_199_98: { width: wp("5%"), height: hp("3%"), top: hp("0%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("26%") }, ImageBackground_199_102: { width: wp("5%"), height: hp("3%"), top: hp("0%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("52%") }, ImageBackground_199_103: { width: wp("5%"), height: hp("3%"), top: hp("0%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("78%") } }) const mapStateToProps = state => { return {} } const mapDispatchToProps = () => { return {} } export default connect(mapStateToProps, mapDispatchToProps)(Blank)
import styled from 'styled-components'; const P = styled.p` font-size: 1em; margin: auto; text-align: center; width: 80%; `; export default P;
/* Copyright (c) 2010, Nicolas Garcia Belmonte All rights reserved > Redistribution and use in source and binary forms, with or without > modification, are permitted provided that the following conditions are met: > * Redistributions of source code must retain the above copyright > notice, this list of conditions and the following disclaimer. > * Redistributions in binary form must reproduce the above copyright > notice, this list of conditions and the following disclaimer in the > documentation and/or other materials provided with the distribution. > * Neither the name of the organization nor the > names of its contributors may be used to endorse or promote products > derived from this software without specific prior written permission. > > THIS SOFTWARE IS PROVIDED BY NICOLAS GARCIA BELMONTE ``AS IS'' AND ANY > EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED > WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE > DISCLAIMED. IN NO EVENT SHALL NICOLAS GARCIA BELMONTE BE LIABLE FOR ANY > DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES > (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; > LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND > ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT > (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS > SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** Lam Huynh on 10/10/2010 added funnel,guage charts **/ /** Lam Huynh on 02/27/2011 added image exporting **/ /** Lam Huynh on 02/23/2011 added line charts **/ (function () { /* File: Core.js */ /* Object: $jit Defines the namespace for all library Classes and Objects. This variable is the *only* global variable defined in the Toolkit. There are also other interesting properties attached to this variable described below. */ window.$jit = function(w) { w = w || window; for(var k in $jit) { if($jit[k].$extend) { w[k] = $jit[k]; } } }; $jit.version = '2.0.0b'; /* Object: $jit.id Works just like *document.getElementById* Example: (start code js) var element = $jit.id('elementId'); (end code) */ /* Object: $jit.util Contains utility functions. Some of the utility functions and the Class system were based in the MooTools Framework <http://mootools.net>. Copyright (c) 2006-2010 Valerio Proietti, <http://mad4milk.net/>. MIT license <http://mootools.net/license.txt>. These methods are generally also implemented in DOM manipulation frameworks like JQuery, MooTools and Prototype. I'd suggest you to use the functions from those libraries instead of using these, since their functions are widely used and tested in many different platforms/browsers. Use these functions only if you have to. */ var $ = function(d) { return document.getElementById(d); }; $.empty = function() { }; function pad(number, length) { var str = '' + number; while (str.length < length) { str = str + '0'; } return str; }; var Url = { // public method for url encoding encode : function (string) { return escape(this._utf8_encode(string)); }, // public method for url decoding decode : function (string) { return this._utf8_decode(unescape(string)); }, // private method for UTF-8 encoding _utf8_encode : function (string) { string = string.replace(/\r\n/g,"\n"); var utftext = ""; for (var n = 0; n < string.length; n++) { var c = string.charCodeAt(n); if (c < 128) { utftext += String.fromCharCode(c); } else if((c > 127) && (c < 2048)) { utftext += String.fromCharCode((c >> 6) | 192); utftext += String.fromCharCode((c & 63) | 128); } else { utftext += String.fromCharCode((c >> 12) | 224); utftext += String.fromCharCode(((c >> 6) & 63) | 128); utftext += String.fromCharCode((c & 63) | 128); } } return utftext; }, // private method for UTF-8 decoding _utf8_decode : function (utftext) { var string = ""; var i = 0; var c = c1 = c2 = 0; while ( i < utftext.length ) { c = utftext.charCodeAt(i); if (c < 128) { string += String.fromCharCode(c); i++; } else if((c > 191) && (c < 224)) { c2 = utftext.charCodeAt(i+1); string += String.fromCharCode(((c & 31) << 6) | (c2 & 63)); i += 2; } else { c2 = utftext.charCodeAt(i+1); c3 = utftext.charCodeAt(i+2); string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63)); i += 3; } } return string; } }; Array.prototype.sum = function() { return (! this.length) ? 0 : this.slice(1).sum() + ((typeof this[0] == 'number') ? this[0] : 0); }; function array_match(needle, haystack) { var length = haystack.length; var indexValue = new Array(); for(var i = 0, count = 0; i < length; i++) { if(haystack[i] == needle) { indexValue[count] = i; count++; } } return new Array(count,indexValue); }; $.roundedRect = function (ctx,x,y,width,height,radius,fillType){ ctx.beginPath(); ctx.moveTo(x,y+radius); ctx.lineTo(x,y+height-radius); ctx.quadraticCurveTo(x,y+height,x+radius,y+height); ctx.lineTo(x+width-radius,y+height); ctx.quadraticCurveTo(x+width,y+height,x+width,y+height-radius); ctx.lineTo(x+width,y+radius); ctx.quadraticCurveTo(x+width,y,x+width-radius,y); ctx.lineTo(x+radius,y); ctx.quadraticCurveTo(x,y,x,y+radius); if(fillType=="fill") { ctx.fill(); } else { ctx.stroke(); } }; $.saveImageFile = function (id,jsonfilename,imageExt) { var parts = jsonfilename.split("/"); var filename = parts[2].replace(".js","."+imageExt); var oCanvas = document.getElementById(id+"-canvas"); if(oCanvas) { if(imageExt == "jpg") { var strDataURI = oCanvas.toDataURL("image/jpeg"); } else { var strDataURI = oCanvas.toDataURL("image/png"); } var handleFailure = function(o){ //alert('failed to write image' + filename); //remove alert since chrome triggers this function when user navigates away from page before image gets written. } var handleSuccess = function(o){ } var callback = { success:handleSuccess, failure:handleFailure, argument: { foo:'foo', bar:''} }; var path = "index.php?action=DynamicAction&DynamicAction=saveImage&module=Charts&to_pdf=1"; var postData = "imageStr=" + strDataURI + "&filename=" + filename; var request = YAHOO.util.Connect.asyncRequest('POST', path, callback, postData); } }; $.saveImageTest = function (id,jsonfilename,imageExt) { if(typeof FlashCanvas != "undefined") { setTimeout(function(){$.saveImageFile(id,jsonfilename,imageExt)},10000); } else { $.saveImageFile(id,jsonfilename,imageExt); } }; /* Method: extend Augment an object by appending another object's properties. Parameters: original - (object) The object to be extended. extended - (object) An object which properties are going to be appended to the original object. Example: (start code js) $jit.util.extend({ 'a': 1, 'b': 2 }, { 'b': 3, 'c': 4 }); //{ 'a':1, 'b': 3, 'c': 4 } (end code) */ $.extend = function(original, extended) { for ( var key in (extended || {})) original[key] = extended[key]; return original; }; $.lambda = function(value) { return (typeof value == 'function') ? value : function() { return value; }; }; $.time = Date.now || function() { return +new Date; }; /* Method: splat Returns an array wrapping *obj* if *obj* is not an array. Returns *obj* otherwise. Parameters: obj - (mixed) The object to be wrapped in an array. Example: (start code js) $jit.util.splat(3); //[3] $jit.util.splat([3]); //[3] (end code) */ $.splat = function(obj) { var type = $.type(obj); return type ? ((type != 'array') ? [ obj ] : obj) : []; }; $.type = function(elem) { var type = $.type.s.call(elem).match(/^\[object\s(.*)\]$/)[1].toLowerCase(); if(type != 'object') return type; if(elem && elem.$$family) return elem.$$family; return (elem && elem.nodeName && elem.nodeType == 1)? 'element' : type; }; $.type.s = Object.prototype.toString; /* Method: each Iterates through an iterable applying *f*. Parameters: iterable - (array) The original array. fn - (function) The function to apply to the array elements. Example: (start code js) $jit.util.each([3, 4, 5], function(n) { alert('number ' + n); }); (end code) */ $.each = function(iterable, fn) { var type = $.type(iterable); if (type == 'object') { for ( var key in iterable) fn(iterable[key], key); } else { for ( var i = 0, l = iterable.length; i < l; i++) fn(iterable[i], i); } }; $.indexOf = function(array, item) { if(Array.indexOf) return array.indexOf(item); for(var i=0,l=array.length; i<l; i++) { if(array[i] === item) return i; } return -1; }; /* Method: map Maps or collects an array by applying *f*. Parameters: array - (array) The original array. f - (function) The function to apply to the array elements. Example: (start code js) $jit.util.map([3, 4, 5], function(n) { return n*n; }); //[9, 16, 25] (end code) */ $.map = function(array, f) { var ans = []; $.each(array, function(elem, i) { ans.push(f(elem, i)); }); return ans; }; /* Method: reduce Iteratively applies the binary function *f* storing the result in an accumulator. Parameters: array - (array) The original array. f - (function) The function to apply to the array elements. opt - (optional|mixed) The starting value for the acumulator. Example: (start code js) $jit.util.reduce([3, 4, 5], function(x, y) { return x + y; }, 0); //12 (end code) */ $.reduce = function(array, f, opt) { var l = array.length; if(l==0) return opt; var acum = arguments.length == 3? opt : array[--l]; while(l--) { acum = f(acum, array[l]); } return acum; }; /* Method: merge Merges n-objects and their sub-objects creating a new, fresh object. Parameters: An arbitrary number of objects. Example: (start code js) $jit.util.merge({ 'a': 1, 'b': 2 }, { 'b': 3, 'c': 4 }); //{ 'a':1, 'b': 3, 'c': 4 } (end code) */ $.merge = function() { var mix = {}; for ( var i = 0, l = arguments.length; i < l; i++) { var object = arguments[i]; if ($.type(object) != 'object') continue; for ( var key in object) { var op = object[key], mp = mix[key]; mix[key] = (mp && $.type(op) == 'object' && $.type(mp) == 'object') ? $ .merge(mp, op) : $.unlink(op); } } return mix; }; $.unlink = function(object) { var unlinked; switch ($.type(object)) { case 'object': unlinked = {}; for ( var p in object) unlinked[p] = $.unlink(object[p]); break; case 'array': unlinked = []; for ( var i = 0, l = object.length; i < l; i++) unlinked[i] = $.unlink(object[i]); break; default: return object; } return unlinked; }; $.zip = function() { if(arguments.length === 0) return []; for(var j=0, ans=[], l=arguments.length, ml=arguments[0].length; j<ml; j++) { for(var i=0, row=[]; i<l; i++) { row.push(arguments[i][j]); } ans.push(row); } return ans; }; /* Method: rgbToHex Converts an RGB array into a Hex string. Parameters: srcArray - (array) An array with R, G and B values Example: (start code js) $jit.util.rgbToHex([255, 255, 255]); //'#ffffff' (end code) */ $.rgbToHex = function(srcArray, array) { if (srcArray.length < 3) return null; if (srcArray.length == 4 && srcArray[3] == 0 && !array) return 'transparent'; var hex = []; for ( var i = 0; i < 3; i++) { var bit = (srcArray[i] - 0).toString(16); hex.push(bit.length == 1 ? '0' + bit : bit); } return array ? hex : '#' + hex.join(''); }; /* Method: hexToRgb Converts an Hex color string into an RGB array. Parameters: hex - (string) A color hex string. Example: (start code js) $jit.util.hexToRgb('#fff'); //[255, 255, 255] (end code) */ $.hexToRgb = function(hex) { if (hex.length != 7) { hex = hex.match(/^#?(\w{1,2})(\w{1,2})(\w{1,2})$/); hex.shift(); if (hex.length != 3) return null; var rgb = []; for ( var i = 0; i < 3; i++) { var value = hex[i]; if (value.length == 1) value += value; rgb.push(parseInt(value, 16)); } return rgb; } else { hex = parseInt(hex.slice(1), 16); return [ hex >> 16, hex >> 8 & 0xff, hex & 0xff ]; } }; $.destroy = function(elem) { $.clean(elem); if (elem.parentNode) elem.parentNode.removeChild(elem); if (elem.clearAttributes) elem.clearAttributes(); }; $.clean = function(elem) { for (var ch = elem.childNodes, i = 0, l = ch.length; i < l; i++) { $.destroy(ch[i]); } }; /* Method: addEvent Cross-browser add event listener. Parameters: obj - (obj) The Element to attach the listener to. type - (string) The listener type. For example 'click', or 'mousemove'. fn - (function) The callback function to be used when the event is fired. Example: (start code js) $jit.util.addEvent(elem, 'click', function(){ alert('hello'); }); (end code) */ $.addEvent = function(obj, type, fn) { if (obj.addEventListener) obj.addEventListener(type, fn, false); else obj.attachEvent('on' + type, fn); }; $.addEvents = function(obj, typeObj) { for(var type in typeObj) { $.addEvent(obj, type, typeObj[type]); } }; $.hasClass = function(obj, klass) { return (' ' + obj.className + ' ').indexOf(' ' + klass + ' ') > -1; }; $.addClass = function(obj, klass) { if (!$.hasClass(obj, klass)) obj.className = (obj.className + " " + klass); }; $.removeClass = function(obj, klass) { obj.className = obj.className.replace(new RegExp( '(^|\\s)' + klass + '(?:\\s|$)'), '$1'); }; $.getPos = function(elem) { var offset = getOffsets(elem); var scroll = getScrolls(elem); return { x: offset.x - scroll.x, y: offset.y - scroll.y }; function getOffsets(elem) { var position = { x: 0, y: 0 }; while (elem && !isBody(elem)) { position.x += elem.offsetLeft; position.y += elem.offsetTop; try{elem=elem.offsetParent;}catch(e){elem=document.body;} } return position; } function getScrolls(elem) { var position = { x: 0, y: 0 }; while (elem && !isBody(elem)) { position.x += elem.scrollLeft; position.y += elem.scrollTop; elem = elem.parentNode; } return position; } function isBody(element) { return (/^(?:body|html)$/i).test(element.tagName); } }; $.event = { get: function(e, win) { win = win || window; return e || win.event; }, getWheel: function(e) { return e.wheelDelta? e.wheelDelta / 120 : -(e.detail || 0) / 3; }, isRightClick: function(e) { return (e.which == 3 || e.button == 2); }, getPos: function(e, win) { // get mouse position win = win || window; e = e || win.event; var doc = win.document; doc = doc.documentElement || doc.body; //TODO(nico): make touch event handling better if(e.touches && e.touches.length) { e = e.touches[0]; } var page = { x: e.pageX || (e.clientX + doc.scrollLeft), y: e.pageY || (e.clientY + doc.scrollTop) }; return page; }, stop: function(e) { if (e.stopPropagation) e.stopPropagation(); e.cancelBubble = true; if (e.preventDefault) e.preventDefault(); else e.returnValue = false; } }; $jit.util = $jit.id = $; var Class = function(properties) { properties = properties || {}; var klass = function() { for ( var key in this) { if (typeof this[key] != 'function') this[key] = $.unlink(this[key]); } this.constructor = klass; if (Class.prototyping) return this; var instance = this.initialize ? this.initialize.apply(this, arguments) : this; //typize this.$$family = 'class'; return instance; }; for ( var mutator in Class.Mutators) { if (!properties[mutator]) continue; properties = Class.Mutators[mutator](properties, properties[mutator]); delete properties[mutator]; } $.extend(klass, this); klass.constructor = Class; klass.prototype = properties; return klass; }; Class.Mutators = { Implements: function(self, klasses) { $.each($.splat(klasses), function(klass) { Class.prototyping = klass; var instance = (typeof klass == 'function') ? new klass : klass; for ( var prop in instance) { if (!(prop in self)) { self[prop] = instance[prop]; } } delete Class.prototyping; }); return self; } }; $.extend(Class, { inherit: function(object, properties) { for ( var key in properties) { var override = properties[key]; var previous = object[key]; var type = $.type(override); if (previous && type == 'function') { if (override != previous) { Class.override(object, key, override); } } else if (type == 'object') { object[key] = $.merge(previous, override); } else { object[key] = override; } } return object; }, override: function(object, name, method) { var parent = Class.prototyping; if (parent && object[name] != parent[name]) parent = null; var override = function() { var previous = this.parent; this.parent = parent ? parent[name] : object[name]; var value = method.apply(this, arguments); this.parent = previous; return value; }; object[name] = override; } }); Class.prototype.implement = function() { var proto = this.prototype; $.each(Array.prototype.slice.call(arguments || []), function(properties) { Class.inherit(proto, properties); }); return this; }; $jit.Class = Class; /* Object: $jit.json Provides JSON utility functions. Most of these functions are JSON-tree traversal and manipulation functions. */ $jit.json = { /* Method: prune Clears all tree nodes having depth greater than maxLevel. Parameters: tree - (object) A JSON tree object. For more information please see <Loader.loadJSON>. maxLevel - (number) An integer specifying the maximum level allowed for this tree. All nodes having depth greater than max level will be deleted. */ prune: function(tree, maxLevel) { this.each(tree, function(elem, i) { if (i == maxLevel && elem.children) { delete elem.children; elem.children = []; } }); }, /* Method: getParent Returns the parent node of the node having _id_ as id. Parameters: tree - (object) A JSON tree object. See also <Loader.loadJSON>. id - (string) The _id_ of the child node whose parent will be returned. Returns: A tree JSON node if any, or false otherwise. */ getParent: function(tree, id) { if (tree.id == id) return false; var ch = tree.children; if (ch && ch.length > 0) { for ( var i = 0; i < ch.length; i++) { if (ch[i].id == id) return tree; else { var ans = this.getParent(ch[i], id); if (ans) return ans; } } } return false; }, /* Method: getSubtree Returns the subtree that matches the given id. Parameters: tree - (object) A JSON tree object. See also <Loader.loadJSON>. id - (string) A node *unique* identifier. Returns: A subtree having a root node matching the given id. Returns null if no subtree matching the id is found. */ getSubtree: function(tree, id) { if (tree.id == id) return tree; for ( var i = 0, ch = tree.children; i < ch.length; i++) { var t = this.getSubtree(ch[i], id); if (t != null) return t; } return null; }, /* Method: eachLevel Iterates on tree nodes with relative depth less or equal than a specified level. Parameters: tree - (object) A JSON tree or subtree. See also <Loader.loadJSON>. initLevel - (number) An integer specifying the initial relative level. Usually zero. toLevel - (number) An integer specifying a top level. This method will iterate only through nodes with depth less than or equal this number. action - (function) A function that receives a node and an integer specifying the actual level of the node. Example: (start code js) $jit.json.eachLevel(tree, 0, 3, function(node, depth) { alert(node.name + ' ' + depth); }); (end code) */ eachLevel: function(tree, initLevel, toLevel, action) { if (initLevel <= toLevel) { action(tree, initLevel); if(!tree.children) return; for ( var i = 0, ch = tree.children; i < ch.length; i++) { this.eachLevel(ch[i], initLevel + 1, toLevel, action); } } }, /* Method: each A JSON tree iterator. Parameters: tree - (object) A JSON tree or subtree. See also <Loader.loadJSON>. action - (function) A function that receives a node. Example: (start code js) $jit.json.each(tree, function(node) { alert(node.name); }); (end code) */ each: function(tree, action) { this.eachLevel(tree, 0, Number.MAX_VALUE, action); } }; /* An object containing multiple type of transformations. */ $jit.Trans = { $extend: true, linear: function(p){ return p; } }; var Trans = $jit.Trans; (function(){ var makeTrans = function(transition, params){ params = $.splat(params); return $.extend(transition, { easeIn: function(pos){ return transition(pos, params); }, easeOut: function(pos){ return 1 - transition(1 - pos, params); }, easeInOut: function(pos){ return (pos <= 0.5)? transition(2 * pos, params) / 2 : (2 - transition( 2 * (1 - pos), params)) / 2; } }); }; var transitions = { Pow: function(p, x){ return Math.pow(p, x[0] || 6); }, Expo: function(p){ return Math.pow(2, 8 * (p - 1)); }, Circ: function(p){ return 1 - Math.sin(Math.acos(p)); }, Sine: function(p){ return 1 - Math.sin((1 - p) * Math.PI / 2); }, Back: function(p, x){ x = x[0] || 1.618; return Math.pow(p, 2) * ((x + 1) * p - x); }, Bounce: function(p){ var value; for ( var a = 0, b = 1; 1; a += b, b /= 2) { if (p >= (7 - 4 * a) / 11) { value = b * b - Math.pow((11 - 6 * a - 11 * p) / 4, 2); break; } } return value; }, Elastic: function(p, x){ return Math.pow(2, 10 * --p) * Math.cos(20 * p * Math.PI * (x[0] || 1) / 3); } }; $.each(transitions, function(val, key){ Trans[key] = makeTrans(val); }); $.each( [ 'Quad', 'Cubic', 'Quart', 'Quint' ], function(elem, i){ Trans[elem] = makeTrans(function(p){ return Math.pow(p, [ i + 2 ]); }); }); })(); /* A Class that can perform animations for generic objects. If you are looking for animation transitions please take a look at the <Trans> object. Used by: <Graph.Plot> Based on: The Animation class is based in the MooTools Framework <http://mootools.net>. Copyright (c) 2006-2009 Valerio Proietti, <http://mad4milk.net/>. MIT license <http://mootools.net/license.txt>. */ var Animation = new Class( { initialize: function(options){ this.setOptions(options); }, setOptions: function(options){ var opt = { duration: 2500, fps: 40, transition: Trans.Quart.easeInOut, compute: $.empty, complete: $.empty, link: 'ignore' }; this.opt = $.merge(opt, options || {}); return this; }, step: function(){ var time = $.time(), opt = this.opt; if (time < this.time + opt.duration) { var delta = opt.transition((time - this.time) / opt.duration); opt.compute(delta); } else { this.timer = clearInterval(this.timer); opt.compute(1); opt.complete(); } }, start: function(){ if (!this.check()) return this; this.time = 0; this.startTimer(); return this; }, startTimer: function(){ var that = this, fps = this.opt.fps; if (this.timer) return false; this.time = $.time() - this.time; this.timer = setInterval((function(){ that.step(); }), Math.round(1000 / fps)); return true; }, pause: function(){ this.stopTimer(); return this; }, resume: function(){ this.startTimer(); return this; }, stopTimer: function(){ if (!this.timer) return false; this.time = $.time() - this.time; this.timer = clearInterval(this.timer); return true; }, check: function(){ if (!this.timer) return true; if (this.opt.link == 'cancel') { this.stopTimer(); return true; } return false; } }); var Options = function() { var args = arguments; for(var i=0, l=args.length, ans={}; i<l; i++) { var opt = Options[args[i]]; if(opt.$extend) { $.extend(ans, opt); } else { ans[args[i]] = opt; } } return ans; }; /* * File: Options.AreaChart.js * */ /* Object: Options.AreaChart <AreaChart> options. Other options included in the AreaChart are <Options.Canvas>, <Options.Label>, <Options.Margin>, <Options.Tips> and <Options.Events>. Syntax: (start code js) Options.AreaChart = { animate: true, labelOffset: 3, type: 'stacked', selectOnHover: true, showAggregates: true, showLabels: true, filterOnClick: false, restoreOnRightClick: false }; (end code) Example: (start code js) var areaChart = new $jit.AreaChart({ animate: true, type: 'stacked:gradient', selectOnHover: true, filterOnClick: true, restoreOnRightClick: true }); (end code) Parameters: animate - (boolean) Default's *true*. Whether to add animated transitions when filtering/restoring stacks. labelOffset - (number) Default's *3*. Adds margin between the label and the default place where it should be drawn. type - (string) Default's *'stacked'*. Stack style. Posible values are 'stacked', 'stacked:gradient' to add gradients. selectOnHover - (boolean) Default's *true*. If true, it will add a mark to the hovered stack. showAggregates - (boolean) Default's *true*. Display the sum of the values of the different stacks. showLabels - (boolean) Default's *true*. Display the name of the slots. filterOnClick - (boolean) Default's *true*. Select the clicked stack by hiding all other stacks. restoreOnRightClick - (boolean) Default's *true*. Show all stacks by right clicking. */ Options.AreaChart = { $extend: true, animate: true, labelOffset: 3, // label offset type: 'stacked', // gradient Tips: { enable: false, onShow: $.empty, onHide: $.empty }, Events: { enable: false, onClick: $.empty }, selectOnHover: true, showAggregates: true, showLabels: true, filterOnClick: false, restoreOnRightClick: false }; /* * File: Options.Margin.js * */ /* Object: Options.Margin Canvas drawing margins. Syntax: (start code js) Options.Margin = { top: 0, left: 0, right: 0, bottom: 0 }; (end code) Example: (start code js) var viz = new $jit.Viz({ Margin: { right: 10, bottom: 20 } }); (end code) Parameters: top - (number) Default's *0*. Top margin. left - (number) Default's *0*. Left margin. right - (number) Default's *0*. Right margin. bottom - (number) Default's *0*. Bottom margin. */ Options.Margin = { $extend: false, top: 0, left: 0, right: 0, bottom: 0 }; /* * File: Options.Canvas.js * */ /* Object: Options.Canvas These are Canvas general options, like where to append it in the DOM, its dimensions, background, and other more advanced options. Syntax: (start code js) Options.Canvas = { injectInto: 'id', width: false, height: false, useCanvas: false, withLabels: true, background: false }; (end code) Example: (start code js) var viz = new $jit.Viz({ injectInto: 'someContainerId', width: 500, height: 700 }); (end code) Parameters: injectInto - *required* (string|element) The id of the DOM container for the visualization. It can also be an Element provided that it has an id. width - (number) Default's to the *container's offsetWidth*. The width of the canvas. height - (number) Default's to the *container's offsetHeight*. The height of the canvas. useCanvas - (boolean|object) Default's *false*. You can pass another <Canvas> instance to be used by the visualization. withLabels - (boolean) Default's *true*. Whether to use a label container for the visualization. background - (boolean|object) Default's *false*. An object containing information about the rendering of a background canvas. */ Options.Canvas = { $extend: true, injectInto: 'id', width: false, height: false, useCanvas: false, withLabels: true, background: false, colorStop1: 'rgba(255,255,255,1)', colorStop2: 'rgba(255,255,255,0)' }; /* * File: Options.Tree.js * */ /* Object: Options.Tree Options related to (strict) Tree layout algorithms. These options are used by the <ST> visualization. Syntax: (start code js) Options.Tree = { orientation: "left", subtreeOffset: 8, siblingOffset: 5, indent:10, multitree: false, align:"center" }; (end code) Example: (start code js) var st = new $jit.ST({ orientation: 'left', subtreeOffset: 1, siblingOFfset: 5, multitree: true }); (end code) Parameters: subtreeOffset - (number) Default's 8. Separation offset between subtrees. siblingOffset - (number) Default's 5. Separation offset between siblings. orientation - (string) Default's 'left'. Tree orientation layout. Possible values are 'left', 'top', 'right', 'bottom'. align - (string) Default's *center*. Whether the tree alignment is 'left', 'center' or 'right'. indent - (number) Default's 10. Used when *align* is left or right and shows an indentation between parent and children. multitree - (boolean) Default's *false*. Used with the node $orn data property for creating multitrees. */ Options.Tree = { $extend: true, orientation: "left", subtreeOffset: 8, siblingOffset: 5, indent:10, multitree: false, align:"center" }; /* * File: Options.Node.js * */ /* Object: Options.Node Provides Node rendering options for Tree and Graph based visualizations. Syntax: (start code js) Options.Node = { overridable: false, type: 'circle', color: '#ccb', alpha: 1, dim: 3, height: 20, width: 90, autoHeight: false, autoWidth: false, lineWidth: 1, transform: true, align: "center", angularWidth:1, span:1, CanvasStyles: {} }; (end code) Example: (start code js) var viz = new $jit.Viz({ Node: { overridable: true, width: 30, autoHeight: true, type: 'rectangle' } }); (end code) Parameters: overridable - (boolean) Default's *false*. Determine whether or not general node properties can be overridden by a particular <Graph.Node>. type - (string) Default's *circle*. Node's shape. Node built-in types include 'circle', 'rectangle', 'square', 'ellipse', 'triangle', 'star'. The default Node type might vary in each visualization. You can also implement (non built-in) custom Node types into your visualizations. color - (string) Default's *#ccb*. Node color. alpha - (number) Default's *1*. The Node's alpha value. *1* is for full opacity. dim - (number) Default's *3*. An extra parameter used by other node shapes such as circle or square, to determine the shape's diameter. height - (number) Default's *20*. Used by 'rectangle' and 'ellipse' node types. The height of the node shape. width - (number) Default's *90*. Used by 'rectangle' and 'ellipse' node types. The width of the node shape. autoHeight - (boolean) Default's *false*. Whether to set an auto height for the node depending on the content of the Node's label. autoWidth - (boolean) Default's *false*. Whether to set an auto width for the node depending on the content of the Node's label. lineWidth - (number) Default's *1*. Used only by some Node shapes. The line width of the strokes of a node. transform - (boolean) Default's *true*. Only used by the <Hypertree> visualization. Whether to scale the nodes according to the moebius transformation. align - (string) Default's *center*. Possible values are 'center', 'left' or 'right'. Used only by the <ST> visualization, these parameters are used for aligning nodes when some of they dimensions vary. angularWidth - (number) Default's *1*. Used in radial layouts (like <RGraph> or <Sunburst> visualizations). The amount of relative 'space' set for a node. span - (number) Default's *1*. Used in radial layouts (like <RGraph> or <Sunburst> visualizations). The angle span amount set for a node. CanvasStyles - (object) Default's an empty object (i.e. {}). Attach any other canvas specific property that you'd set to the canvas context before plotting a Node. */ Options.Node = { $extend: false, overridable: false, type: 'circle', color: '#ccb', alpha: 1, dim: 3, height: 20, width: 90, autoHeight: false, autoWidth: false, lineWidth: 1, transform: true, align: "center", angularWidth:1, span:1, //Raw canvas styles to be //applied to the context instance //before plotting a node CanvasStyles: {} }; /* * File: Options.Edge.js * */ /* Object: Options.Edge Provides Edge rendering options for Tree and Graph based visualizations. Syntax: (start code js) Options.Edge = { overridable: false, type: 'line', color: '#ccb', lineWidth: 1, dim:15, alpha: 1, CanvasStyles: {} }; (end code) Example: (start code js) var viz = new $jit.Viz({ Edge: { overridable: true, type: 'line', color: '#fff', CanvasStyles: { shadowColor: '#ccc', shadowBlur: 10 } } }); (end code) Parameters: overridable - (boolean) Default's *false*. Determine whether or not general edges properties can be overridden by a particular <Graph.Adjacence>. type - (string) Default's 'line'. Edge styles include 'line', 'hyperline', 'arrow'. The default Edge type might vary in each visualization. You can also implement custom Edge types. color - (string) Default's '#ccb'. Edge color. lineWidth - (number) Default's *1*. Line/Edge width. alpha - (number) Default's *1*. The Edge's alpha value. *1* is for full opacity. dim - (number) Default's *15*. An extra parameter used by other complex shapes such as quadratic, bezier or arrow, to determine the shape's diameter. epsilon - (number) Default's *7*. Only used when using *enableForEdges* in <Options.Events>. This dimension is used to create an area for the line where the contains method for the edge returns *true*. CanvasStyles - (object) Default's an empty object (i.e. {}). Attach any other canvas specific property that you'd set to the canvas context before plotting an Edge. See also: If you want to know more about how to customize Node/Edge data per element, in the JSON or programmatically, take a look at this article. */ Options.Edge = { $extend: false, overridable: false, type: 'line', color: '#ccb', lineWidth: 1, dim:15, alpha: 1, epsilon: 7, //Raw canvas styles to be //applied to the context instance //before plotting an edge CanvasStyles: {} }; /* * File: Options.Fx.js * */ /* Object: Options.Fx Provides animation options like duration of the animations, frames per second and animation transitions. Syntax: (start code js) Options.Fx = { fps:40, duration: 2500, transition: $jit.Trans.Quart.easeInOut, clearCanvas: true }; (end code) Example: (start code js) var viz = new $jit.Viz({ duration: 1000, fps: 35, transition: $jit.Trans.linear }); (end code) Parameters: clearCanvas - (boolean) Default's *true*. Whether to clear the frame/canvas when the viz is plotted or animated. duration - (number) Default's *2500*. Duration of the animation in milliseconds. fps - (number) Default's *40*. Frames per second. transition - (object) Default's *$jit.Trans.Quart.easeInOut*. The transition used for the animations. See below for a more detailed explanation. Object: $jit.Trans This object is used for specifying different animation transitions in all visualizations. There are many different type of animation transitions. linear: Displays a linear transition >Trans.linear (see Linear.png) Quad: Displays a Quadratic transition. >Trans.Quad.easeIn >Trans.Quad.easeOut >Trans.Quad.easeInOut (see Quad.png) Cubic: Displays a Cubic transition. >Trans.Cubic.easeIn >Trans.Cubic.easeOut >Trans.Cubic.easeInOut (see Cubic.png) Quart: Displays a Quartetic transition. >Trans.Quart.easeIn >Trans.Quart.easeOut >Trans.Quart.easeInOut (see Quart.png) Quint: Displays a Quintic transition. >Trans.Quint.easeIn >Trans.Quint.easeOut >Trans.Quint.easeInOut (see Quint.png) Expo: Displays an Exponential transition. >Trans.Expo.easeIn >Trans.Expo.easeOut >Trans.Expo.easeInOut (see Expo.png) Circ: Displays a Circular transition. >Trans.Circ.easeIn >Trans.Circ.easeOut >Trans.Circ.easeInOut (see Circ.png) Sine: Displays a Sineousidal transition. >Trans.Sine.easeIn >Trans.Sine.easeOut >Trans.Sine.easeInOut (see Sine.png) Back: >Trans.Back.easeIn >Trans.Back.easeOut >Trans.Back.easeInOut (see Back.png) Bounce: Bouncy transition. >Trans.Bounce.easeIn >Trans.Bounce.easeOut >Trans.Bounce.easeInOut (see Bounce.png) Elastic: Elastic curve. >Trans.Elastic.easeIn >Trans.Elastic.easeOut >Trans.Elastic.easeInOut (see Elastic.png) Based on: Easing and Transition animation methods are based in the MooTools Framework <http://mootools.net>. Copyright (c) 2006-2010 Valerio Proietti, <http://mad4milk.net/>. MIT license <http://mootools.net/license.txt>. */ Options.Fx = { $extend: true, fps:40, duration: 2500, transition: $jit.Trans.Quart.easeInOut, clearCanvas: true }; /* * File: Options.Label.js * */ /* Object: Options.Label Provides styling for Labels such as font size, family, etc. Also sets Node labels as HTML, SVG or Native canvas elements. Syntax: (start code js) Options.Label = { overridable: false, type: 'HTML', //'SVG', 'Native' style: ' ', size: 10, family: 'sans-serif', textAlign: 'center', textBaseline: 'alphabetic', color: '#fff' }; (end code) Example: (start code js) var viz = new $jit.Viz({ Label: { type: 'Native', size: 11, color: '#ccc' } }); (end code) Parameters: overridable - (boolean) Default's *false*. Determine whether or not general label properties can be overridden by a particular <Graph.Node>. type - (string) Default's *HTML*. The type for the labels. Can be 'HTML', 'SVG' or 'Native' canvas labels. style - (string) Default's *empty string*. Can be 'italic' or 'bold'. This parameter is only taken into account when using 'Native' canvas labels. For DOM based labels the className *node* is added to the DOM element for styling via CSS. You can also use <Options.Controller> methods to style individual labels. size - (number) Default's *10*. The font's size. This parameter is only taken into account when using 'Native' canvas labels. For DOM based labels the className *node* is added to the DOM element for styling via CSS. You can also use <Options.Controller> methods to style individual labels. family - (string) Default's *sans-serif*. The font's family. This parameter is only taken into account when using 'Native' canvas labels. For DOM based labels the className *node* is added to the DOM element for styling via CSS. You can also use <Options.Controller> methods to style individual labels. color - (string) Default's *#fff*. The font's color. This parameter is only taken into account when using 'Native' canvas labels. For DOM based labels the className *node* is added to the DOM element for styling via CSS. You can also use <Options.Controller> methods to style individual labels. */ Options.Label = { $extend: false, overridable: false, type: 'HTML', //'SVG', 'Native' style: ' ', size: 10, family: 'sans-serif', textAlign: 'center', textBaseline: 'alphabetic', color: '#fff' }; /* * File: Options.Tips.js * */ /* Object: Options.Tips Tips options Syntax: (start code js) Options.Tips = { enable: false, type: 'auto', offsetX: 20, offsetY: 20, onShow: $.empty, onHide: $.empty }; (end code) Example: (start code js) var viz = new $jit.Viz({ Tips: { enable: true, type: 'Native', offsetX: 10, offsetY: 10, onShow: function(tip, node) { tip.innerHTML = node.name; } } }); (end code) Parameters: enable - (boolean) Default's *false*. If *true*, a tooltip will be shown when a node is hovered. The tooltip is a div DOM element having "tip" as CSS class. type - (string) Default's *auto*. Defines where to attach the MouseEnter/Leave tooltip events. Possible values are 'Native' to attach them to the canvas or 'HTML' to attach them to DOM label elements (if defined). 'auto' sets this property to the value of <Options.Label>'s *type* property. offsetX - (number) Default's *20*. An offset added to the current tooltip x-position (which is the same as the current mouse position). Default's 20. offsetY - (number) Default's *20*. An offset added to the current tooltip y-position (which is the same as the current mouse position). Default's 20. onShow(tip, node) - This callack is used right before displaying a tooltip. The first formal parameter is the tip itself (which is a DivElement). The second parameter may be a <Graph.Node> for graph based visualizations or an object with label, value properties for charts. onHide() - This callack is used when hiding a tooltip. */ Options.Tips = { $extend: false, enable: false, type: 'auto', offsetX: 20, offsetY: 20, force: false, onShow: $.empty, onHide: $.empty }; /* * File: Options.NodeStyles.js * */ /* Object: Options.NodeStyles Apply different styles when a node is hovered or selected. Syntax: (start code js) Options.NodeStyles = { enable: false, type: 'auto', stylesHover: false, stylesClick: false }; (end code) Example: (start code js) var viz = new $jit.Viz({ NodeStyles: { enable: true, type: 'Native', stylesHover: { dim: 30, color: '#fcc' }, duration: 600 } }); (end code) Parameters: enable - (boolean) Default's *false*. Whether to enable this option. type - (string) Default's *auto*. Use this to attach the hover/click events in the nodes or the nodes labels (if they have been defined as DOM elements: 'HTML' or 'SVG', see <Options.Label> for more details). The default 'auto' value will set NodeStyles to the same type defined for <Options.Label>. stylesHover - (boolean|object) Default's *false*. An object with node styles just like the ones defined for <Options.Node> or *false* otherwise. stylesClick - (boolean|object) Default's *false*. An object with node styles just like the ones defined for <Options.Node> or *false* otherwise. */ Options.NodeStyles = { $extend: false, enable: false, type: 'auto', stylesHover: false, stylesClick: false }; /* * File: Options.Events.js * */ /* Object: Options.Events Configuration for adding mouse/touch event handlers to Nodes. Syntax: (start code js) Options.Events = { enable: false, enableForEdges: false, type: 'auto', onClick: $.empty, onRightClick: $.empty, onMouseMove: $.empty, onMouseEnter: $.empty, onMouseLeave: $.empty, onDragStart: $.empty, onDragMove: $.empty, onDragCancel: $.empty, onDragEnd: $.empty, onTouchStart: $.empty, onTouchMove: $.empty, onTouchEnd: $.empty, onTouchCancel: $.empty, onMouseWheel: $.empty }; (end code) Example: (start code js) var viz = new $jit.Viz({ Events: { enable: true, onClick: function(node, eventInfo, e) { viz.doSomething(); }, onMouseEnter: function(node, eventInfo, e) { viz.canvas.getElement().style.cursor = 'pointer'; }, onMouseLeave: function(node, eventInfo, e) { viz.canvas.getElement().style.cursor = ''; } } }); (end code) Parameters: enable - (boolean) Default's *false*. Whether to enable the Event system. enableForEdges - (boolean) Default's *false*. Whether to track events also in arcs. If *true* the same callbacks -described below- are used for nodes *and* edges. A simple duck type check for edges is to check for *node.nodeFrom*. type - (string) Default's 'auto'. Whether to attach the events onto the HTML labels (via event delegation) or to use the custom 'Native' canvas Event System of the library. 'auto' is set when you let the <Options.Label> *type* parameter decide this. onClick(node, eventInfo, e) - Triggered when a user performs a click in the canvas. *node* is the <Graph.Node> clicked or false if no node has been clicked. *e* is the grabbed event (should return the native event in a cross-browser manner). *eventInfo* is an object containing useful methods like *getPos* to get the mouse position relative to the canvas. onRightClick(node, eventInfo, e) - Triggered when a user performs a right click in the canvas. *node* is the <Graph.Node> right clicked or false if no node has been clicked. *e* is the grabbed event (should return the native event in a cross-browser manner). *eventInfo* is an object containing useful methods like *getPos* to get the mouse position relative to the canvas. onMouseMove(node, eventInfo, e) - Triggered when the user moves the mouse. *node* is the <Graph.Node> under the cursor as it's moving over the canvas or false if no node has been clicked. *e* is the grabbed event (should return the native event in a cross-browser manner). *eventInfo* is an object containing useful methods like *getPos* to get the mouse position relative to the canvas. onMouseEnter(node, eventInfo, e) - Triggered when a user moves the mouse over a node. *node* is the <Graph.Node> that the mouse just entered. *e* is the grabbed event (should return the native event in a cross-browser manner). *eventInfo* is an object containing useful methods like *getPos* to get the mouse position relative to the canvas. onMouseLeave(node, eventInfo, e) - Triggered when the user mouse-outs a node. *node* is the <Graph.Node> 'mouse-outed'. *e* is the grabbed event (should return the native event in a cross-browser manner). *eventInfo* is an object containing useful methods like *getPos* to get the mouse position relative to the canvas. onDragStart(node, eventInfo, e) - Triggered when the user mouse-downs over a node. *node* is the <Graph.Node> being pressed. *e* is the grabbed event (should return the native event in a cross-browser manner). *eventInfo* is an object containing useful methods like *getPos* to get the mouse position relative to the canvas. onDragMove(node, eventInfo, e) - Triggered when a user, after pressing the mouse button over a node, moves the mouse around. *node* is the <Graph.Node> being dragged. *e* is the grabbed event (should return the native event in a cross-browser manner). *eventInfo* is an object containing useful methods like *getPos* to get the mouse position relative to the canvas. onDragEnd(node, eventInfo, e) - Triggered when a user finished dragging a node. *node* is the <Graph.Node> being dragged. *e* is the grabbed event (should return the native event in a cross-browser manner). *eventInfo* is an object containing useful methods like *getPos* to get the mouse position relative to the canvas. onDragCancel(node, eventInfo, e) - Triggered when the user releases the mouse button over a <Graph.Node> that wasn't dragged (i.e. the user didn't perform any mouse movement after pressing the mouse button). *node* is the <Graph.Node> being dragged. *e* is the grabbed event (should return the native event in a cross-browser manner). *eventInfo* is an object containing useful methods like *getPos* to get the mouse position relative to the canvas. onTouchStart(node, eventInfo, e) - Behaves just like onDragStart. onTouchMove(node, eventInfo, e) - Behaves just like onDragMove. onTouchEnd(node, eventInfo, e) - Behaves just like onDragEnd. onTouchCancel(node, eventInfo, e) - Behaves just like onDragCancel. onMouseWheel(delta, e) - Triggered when the user uses the mouse scroll over the canvas. *delta* is 1 or -1 depending on the sense of the mouse scroll. */ Options.Events = { $extend: false, enable: false, enableForEdges: false, type: 'auto', onClick: $.empty, onRightClick: $.empty, onMouseMove: $.empty, onMouseEnter: $.empty, onMouseLeave: $.empty, onDragStart: $.empty, onDragMove: $.empty, onDragCancel: $.empty, onDragEnd: $.empty, onTouchStart: $.empty, onTouchMove: $.empty, onTouchEnd: $.empty, onMouseWheel: $.empty }; /* * File: Options.Navigation.js * */ /* Object: Options.Navigation Panning and zooming options for Graph/Tree based visualizations. These options are implemented by all visualizations except charts (<AreaChart>, <BarChart> and <PieChart>). Syntax: (start code js) Options.Navigation = { enable: false, type: 'auto', panning: false, //true, 'avoid nodes' zooming: false }; (end code) Example: (start code js) var viz = new $jit.Viz({ Navigation: { enable: true, panning: 'avoid nodes', zooming: 20 } }); (end code) Parameters: enable - (boolean) Default's *false*. Whether to enable Navigation capabilities. panning - (boolean|string) Default's *false*. Set this property to *true* if you want to add Drag and Drop panning support to the visualization. You can also set this parameter to 'avoid nodes' to enable DnD panning but disable it if the DnD is taking place over a node. This is useful when some other events like Drag & Drop for nodes are added to <Graph.Nodes>. zooming - (boolean|number) Default's *false*. Set this property to a numeric value to turn mouse-scroll zooming on. The number will be proportional to the mouse-scroll sensitivity. */ Options.Navigation = { $extend: false, enable: false, type: 'auto', panning: false, //true | 'avoid nodes' zooming: false }; /* * File: Options.Controller.js * */ /* Object: Options.Controller Provides controller methods. Controller methods are callback functions that get called at different stages of the animation, computing or plotting of the visualization. Implemented by: All visualizations except charts (<AreaChart>, <BarChart> and <PieChart>). Syntax: (start code js) Options.Controller = { onBeforeCompute: $.empty, onAfterCompute: $.empty, onCreateLabel: $.empty, onPlaceLabel: $.empty, onComplete: $.empty, onBeforePlotLine:$.empty, onAfterPlotLine: $.empty, onBeforePlotNode:$.empty, onAfterPlotNode: $.empty, request: false }; (end code) Example: (start code js) var viz = new $jit.Viz({ onBeforePlotNode: function(node) { if(node.selected) { node.setData('color', '#ffc'); } else { node.removeData('color'); } }, onBeforePlotLine: function(adj) { if(adj.nodeFrom.selected && adj.nodeTo.selected) { adj.setData('color', '#ffc'); } else { adj.removeData('color'); } }, onAfterCompute: function() { alert("computed!"); } }); (end code) Parameters: onBeforeCompute(node) - This method is called right before performing all computations and animations. The selected <Graph.Node> is passed as parameter. onAfterCompute() - This method is triggered after all animations or computations ended. onCreateLabel(domElement, node) - This method receives a new label DIV element as first parameter, and the corresponding <Graph.Node> as second parameter. This method will only be called once for each label. This method is useful when adding events or styles to the labels used by the JIT. onPlaceLabel(domElement, node) - This method receives a label DIV element as first parameter and the corresponding <Graph.Node> as second parameter. This method is called each time a label has been placed in the visualization, for example at each step of an animation, and thus it allows you to update the labels properties, such as size or position. Note that onPlaceLabel will be triggered after updating the labels positions. That means that, for example, the left and top css properties are already updated to match the nodes positions. Width and height properties are not set however. onBeforePlotNode(node) - This method is triggered right before plotting each <Graph.Node>. This method is useful for changing a node style right before plotting it. onAfterPlotNode(node) - This method is triggered right after plotting each <Graph.Node>. onBeforePlotLine(adj) - This method is triggered right before plotting a <Graph.Adjacence>. This method is useful for adding some styles to a particular edge before being plotted. onAfterPlotLine(adj) - This method is triggered right after plotting a <Graph.Adjacence>. *Used in <ST>, <TM.Base> and <Icicle> visualizations* request(nodeId, level, onComplete) - This method is used for buffering information into the visualization. When clicking on an empty node, the visualization will make a request for this node's subtrees, specifying a given level for this subtree (defined by _levelsToShow_). Once the request is completed, the onComplete callback should be called with the given result. This is useful to provide on-demand information into the visualizations withought having to load the entire information from start. The parameters used by this method are _nodeId_, which is the id of the root of the subtree to request, _level_ which is the depth of the subtree to be requested (0 would mean just the root node). _onComplete_ is an object having the callback method _onComplete.onComplete(json)_ that should be called once the json has been retrieved. */ Options.Controller = { $extend: true, onBeforeCompute: $.empty, onAfterCompute: $.empty, onCreateLabel: $.empty, onPlaceLabel: $.empty, onComplete: $.empty, onBeforePlotLine:$.empty, onAfterPlotLine: $.empty, onBeforePlotNode:$.empty, onAfterPlotNode: $.empty, request: false }; /* * File: Extras.js * * Provides Extras such as Tips and Style Effects. * * Description: * * Provides the <Tips> and <NodeStyles> classes and functions. * */ /* * Manager for mouse events (clicking and mouse moving). * * This class is used for registering objects implementing onClick * and onMousemove methods. These methods are called when clicking or * moving the mouse around the Canvas. * For now, <Tips> and <NodeStyles> are classes implementing these methods. * */ var ExtrasInitializer = { initialize: function(className, viz) { this.viz = viz; this.canvas = viz.canvas; this.config = viz.config[className]; this.nodeTypes = viz.fx.nodeTypes; var type = this.config.type; this.dom = type == 'auto'? (viz.config.Label.type != 'Native') : (type != 'Native'); this.labelContainer = this.dom && viz.labels.getLabelContainer(); this.isEnabled() && this.initializePost(); }, initializePost: $.empty, setAsProperty: $.lambda(false), isEnabled: function() { return this.config.enable; }, isLabel: function(e, win) { e = $.event.get(e, win); var labelContainer = this.labelContainer, target = e.target || e.srcElement; if(target && target.parentNode == labelContainer) return target; return false; } }; var EventsInterface = { onMouseUp: $.empty, onMouseDown: $.empty, onMouseMove: $.empty, onMouseOver: $.empty, onMouseOut: $.empty, onMouseWheel: $.empty, onTouchStart: $.empty, onTouchMove: $.empty, onTouchEnd: $.empty, onTouchCancel: $.empty }; var MouseEventsManager = new Class({ initialize: function(viz) { this.viz = viz; this.canvas = viz.canvas; this.node = false; this.edge = false; this.registeredObjects = []; this.attachEvents(); }, attachEvents: function() { var htmlCanvas = this.canvas.getElement(), that = this; htmlCanvas.oncontextmenu = $.lambda(false); $.addEvents(htmlCanvas, { 'mouseup': function(e, win) { var event = $.event.get(e, win); that.handleEvent('MouseUp', e, win, that.makeEventObject(e, win), $.event.isRightClick(event)); }, 'mousedown': function(e, win) { var event = $.event.get(e, win); that.handleEvent('MouseDown', e, win, that.makeEventObject(e, win), $.event.isRightClick(event)); }, 'mousemove': function(e, win) { that.handleEvent('MouseMove', e, win, that.makeEventObject(e, win)); }, 'mouseover': function(e, win) { that.handleEvent('MouseOver', e, win, that.makeEventObject(e, win)); }, 'mouseout': function(e, win) { that.handleEvent('MouseOut', e, win, that.makeEventObject(e, win)); }, 'touchstart': function(e, win) { that.handleEvent('TouchStart', e, win, that.makeEventObject(e, win)); }, 'touchmove': function(e, win) { that.handleEvent('TouchMove', e, win, that.makeEventObject(e, win)); }, 'touchend': function(e, win) { that.handleEvent('TouchEnd', e, win, that.makeEventObject(e, win)); } }); //attach mousewheel event var handleMouseWheel = function(e, win) { var event = $.event.get(e, win); var wheel = $.event.getWheel(event); that.handleEvent('MouseWheel', e, win, wheel); }; //TODO(nico): this is a horrible check for non-gecko browsers! if(!document.getBoxObjectFor && window.mozInnerScreenX == null) { $.addEvent(htmlCanvas, 'mousewheel', handleMouseWheel); } else { htmlCanvas.addEventListener('DOMMouseScroll', handleMouseWheel, false); } }, register: function(obj) { this.registeredObjects.push(obj); }, handleEvent: function() { var args = Array.prototype.slice.call(arguments), type = args.shift(); for(var i=0, regs=this.registeredObjects, l=regs.length; i<l; i++) { regs[i]['on' + type].apply(regs[i], args); } }, makeEventObject: function(e, win) { var that = this, graph = this.viz.graph, fx = this.viz.fx, ntypes = fx.nodeTypes, etypes = fx.edgeTypes; return { pos: false, node: false, edge: false, contains: false, getNodeCalled: false, getEdgeCalled: false, getPos: function() { //TODO(nico): check why this can't be cache anymore when using edge detection //if(this.pos) return this.pos; var canvas = that.viz.canvas, s = canvas.getSize(), p = canvas.getPos(), ox = canvas.translateOffsetX, oy = canvas.translateOffsetY, sx = canvas.scaleOffsetX, sy = canvas.scaleOffsetY, pos = $.event.getPos(e, win); this.pos = { x: (pos.x - p.x - s.width/2 - ox) * 1/sx, y: (pos.y - p.y - s.height/2 - oy) * 1/sy }; return this.pos; }, getNode: function() { if(this.getNodeCalled) return this.node; this.getNodeCalled = true; for(var id in graph.nodes) { var n = graph.nodes[id], geom = n && ntypes[n.getData('type')], contains = geom && geom.contains && geom.contains.call(fx, n, this.getPos()); if(contains) { this.contains = contains; return that.node = this.node = n; } } return that.node = this.node = false; }, getEdge: function() { if(this.getEdgeCalled) return this.edge; this.getEdgeCalled = true; var hashset = {}; for(var id in graph.edges) { var edgeFrom = graph.edges[id]; hashset[id] = true; for(var edgeId in edgeFrom) { if(edgeId in hashset) continue; var e = edgeFrom[edgeId], geom = e && etypes[e.getData('type')], contains = geom && geom.contains && geom.contains.call(fx, e, this.getPos()); if(contains) { this.contains = contains; return that.edge = this.edge = e; } } } return that.edge = this.edge = false; }, getContains: function() { if(this.getNodeCalled) return this.contains; this.getNode(); return this.contains; } }; } }); /* * Provides the initialization function for <NodeStyles> and <Tips> implemented * by all main visualizations. * */ var Extras = { initializeExtras: function() { var mem = new MouseEventsManager(this), that = this; $.each(['NodeStyles', 'Tips', 'Navigation', 'Events'], function(k) { var obj = new Extras.Classes[k](k, that); if(obj.isEnabled()) { mem.register(obj); } if(obj.setAsProperty()) { that[k.toLowerCase()] = obj; } }); } }; Extras.Classes = {}; /* Class: Events This class defines an Event API to be accessed by the user. The methods implemented are the ones defined in the <Options.Events> object. */ Extras.Classes.Events = new Class({ Implements: [ExtrasInitializer, EventsInterface], initializePost: function() { this.fx = this.viz.fx; this.ntypes = this.viz.fx.nodeTypes; this.etypes = this.viz.fx.edgeTypes; this.hovered = false; this.pressed = false; this.touched = false; this.touchMoved = false; this.moved = false; }, setAsProperty: $.lambda(true), onMouseUp: function(e, win, event, isRightClick) { var evt = $.event.get(e, win); if(!this.moved) { if(isRightClick) { this.config.onRightClick(this.hovered, event, evt); } else { this.config.onClick(this.pressed, event, evt); } } if(this.pressed) { if(this.moved) { this.config.onDragEnd(this.pressed, event, evt); } else { this.config.onDragCancel(this.pressed, event, evt); } this.pressed = this.moved = false; } }, onMouseOut: function(e, win, event) { //mouseout a label var evt = $.event.get(e, win), label; if(this.dom && (label = this.isLabel(e, win))) { this.config.onMouseLeave(this.viz.graph.getNode(label.id), event, evt); this.hovered = false; return; } //mouseout canvas var rt = evt.relatedTarget, canvasWidget = this.canvas.getElement(); while(rt && rt.parentNode) { if(canvasWidget == rt.parentNode) return; rt = rt.parentNode; } if(this.hovered) { this.config.onMouseLeave(this.hovered, event, evt); this.hovered = false; } }, onMouseOver: function(e, win, event) { //mouseover a label var evt = $.event.get(e, win), label; if(this.dom && (label = this.isLabel(e, win))) { this.hovered = this.viz.graph.getNode(label.id); this.config.onMouseEnter(this.hovered, event, evt); } }, onMouseMove: function(e, win, event) { var label, evt = $.event.get(e, win); if(this.pressed) { this.moved = true; this.config.onDragMove(this.pressed, event, evt); return; } if(this.dom) { this.config.onMouseMove(this.hovered, event, evt); } else { if(this.hovered) { var hn = this.hovered; var geom = hn.nodeFrom? this.etypes[hn.getData('type')] : this.ntypes[hn.getData('type')]; var contains = geom && geom.contains && geom.contains.call(this.fx, hn, event.getPos()); if(contains) { this.config.onMouseMove(hn, event, evt); return; } else { this.config.onMouseLeave(hn, event, evt); this.hovered = false; } } if(this.hovered = (event.getNode() || (this.config.enableForEdges && event.getEdge()))) { this.config.onMouseEnter(this.hovered, event, evt); } else { this.config.onMouseMove(false, event, evt); } } }, onMouseWheel: function(e, win, delta) { this.config.onMouseWheel(delta, $.event.get(e, win)); }, onMouseDown: function(e, win, event) { var evt = $.event.get(e, win); this.pressed = event.getNode() || (this.config.enableForEdges && event.getEdge()); this.config.onDragStart(this.pressed, event, evt); }, onTouchStart: function(e, win, event) { var evt = $.event.get(e, win); this.touched = event.getNode() || (this.config.enableForEdges && event.getEdge()); this.config.onTouchStart(this.touched, event, evt); }, onTouchMove: function(e, win, event) { var evt = $.event.get(e, win); if(this.touched) { this.touchMoved = true; this.config.onTouchMove(this.touched, event, evt); } }, onTouchEnd: function(e, win, event) { var evt = $.event.get(e, win); if(this.touched) { if(this.touchMoved) { this.config.onTouchEnd(this.touched, event, evt); } else { this.config.onTouchCancel(this.touched, event, evt); } this.touched = this.touchMoved = false; } } }); /* Class: Tips A class containing tip related functions. This class is used internally. Used by: <ST>, <Sunburst>, <Hypertree>, <RGraph>, <TM>, <ForceDirected>, <Icicle> See also: <Options.Tips> */ Extras.Classes.Tips = new Class({ Implements: [ExtrasInitializer, EventsInterface], initializePost: function() { //add DOM tooltip if(document.body) { var tip = $('_tooltip') || document.createElement('div'); tip.id = '_tooltip'; tip.className = 'tip'; $.extend(tip.style, { position: 'absolute', display: 'none', zIndex: 13000 }); document.body.appendChild(tip); this.tip = tip; this.node = false; } }, setAsProperty: $.lambda(true), onMouseOut: function(e, win) { //mouseout a label if(this.dom && this.isLabel(e, win)) { this.hide(true); return; } //mouseout canvas var rt = e.relatedTarget, canvasWidget = this.canvas.getElement(); while(rt && rt.parentNode) { if(canvasWidget == rt.parentNode) return; rt = rt.parentNode; } this.hide(false); }, onMouseOver: function(e, win) { //mouseover a label var label; if(this.dom && (label = this.isLabel(e, win))) { this.node = this.viz.graph.getNode(label.id); this.config.onShow(this.tip, this.node, label); } }, onMouseMove: function(e, win, opt) { if(this.dom && this.isLabel(e, win)) { this.setTooltipPosition($.event.getPos(e, win)); } if(!this.dom) { var node = opt.getNode(); if(!node) { this.hide(true); return; } if(this.config.force || !this.node || this.node.id != node.id) { this.node = node; this.config.onShow(this.tip, node, opt.getContains()); } this.setTooltipPosition($.event.getPos(e, win)); } }, setTooltipPosition: function(pos) { var tip = this.tip, style = tip.style, cont = this.config; style.display = ''; //get window dimensions var win = { 'height': document.body.clientHeight, 'width': document.body.clientWidth }; //get tooltip dimensions var obj = { 'width': tip.offsetWidth, 'height': tip.offsetHeight }; //set tooltip position var x = cont.offsetX, y = cont.offsetY; style.top = ((pos.y + y + obj.height > win.height)? (pos.y - obj.height - y) : pos.y + y) + 'px'; style.left = ((pos.x + obj.width + x > win.width)? (pos.x - obj.width - x) : pos.x + x) + 'px'; }, hide: function(triggerCallback) { if(!SUGAR.util.isTouchScreen()) { this.tip.style.display = 'none'; } triggerCallback && this.config.onHide(); } }); /* Class: NodeStyles Change node styles when clicking or hovering a node. This class is used internally. Used by: <ST>, <Sunburst>, <Hypertree>, <RGraph>, <TM>, <ForceDirected>, <Icicle> See also: <Options.NodeStyles> */ Extras.Classes.NodeStyles = new Class({ Implements: [ExtrasInitializer, EventsInterface], initializePost: function() { this.fx = this.viz.fx; this.types = this.viz.fx.nodeTypes; this.nStyles = this.config; this.nodeStylesOnHover = this.nStyles.stylesHover; this.nodeStylesOnClick = this.nStyles.stylesClick; this.hoveredNode = false; this.fx.nodeFxAnimation = new Animation(); this.down = false; this.move = false; }, onMouseOut: function(e, win) { this.down = this.move = false; if(!this.hoveredNode) return; //mouseout a label if(this.dom && this.isLabel(e, win)) { this.toggleStylesOnHover(this.hoveredNode, false); } //mouseout canvas var rt = e.relatedTarget, canvasWidget = this.canvas.getElement(); while(rt && rt.parentNode) { if(canvasWidget == rt.parentNode) return; rt = rt.parentNode; } this.toggleStylesOnHover(this.hoveredNode, false); this.hoveredNode = false; }, onMouseOver: function(e, win) { //mouseover a label var label; if(this.dom && (label = this.isLabel(e, win))) { var node = this.viz.graph.getNode(label.id); if(node.selected) return; this.hoveredNode = node; this.toggleStylesOnHover(this.hoveredNode, true); } }, onMouseDown: function(e, win, event, isRightClick) { if(isRightClick) return; var label; if(this.dom && (label = this.isLabel(e, win))) { this.down = this.viz.graph.getNode(label.id); } else if(!this.dom) { this.down = event.getNode(); } this.move = false; }, onMouseUp: function(e, win, event, isRightClick) { if(isRightClick) return; if(!this.move) { this.onClick(event.getNode()); } this.down = this.move = false; }, getRestoredStyles: function(node, type) { var restoredStyles = {}, nStyles = this['nodeStylesOn' + type]; for(var prop in nStyles) { restoredStyles[prop] = node.styles['$' + prop]; } return restoredStyles; }, toggleStylesOnHover: function(node, set) { if(this.nodeStylesOnHover) { this.toggleStylesOn('Hover', node, set); } }, toggleStylesOnClick: function(node, set) { if(this.nodeStylesOnClick) { this.toggleStylesOn('Click', node, set); } }, toggleStylesOn: function(type, node, set) { var viz = this.viz; var nStyles = this.nStyles; if(set) { var that = this; if(!node.styles) { node.styles = $.merge(node.data, {}); } for(var s in this['nodeStylesOn' + type]) { var $s = '$' + s; if(!($s in node.styles)) { node.styles[$s] = node.getData(s); } } viz.fx.nodeFx($.extend({ 'elements': { 'id': node.id, 'properties': that['nodeStylesOn' + type] }, transition: Trans.Quart.easeOut, duration:300, fps:40 }, this.config)); } else { var restoredStyles = this.getRestoredStyles(node, type); viz.fx.nodeFx($.extend({ 'elements': { 'id': node.id, 'properties': restoredStyles }, transition: Trans.Quart.easeOut, duration:300, fps:40 }, this.config)); } }, onClick: function(node) { if(!node) return; var nStyles = this.nodeStylesOnClick; if(!nStyles) return; //if the node is selected then unselect it if(node.selected) { this.toggleStylesOnClick(node, false); delete node.selected; } else { //unselect all selected nodes... this.viz.graph.eachNode(function(n) { if(n.selected) { for(var s in nStyles) { n.setData(s, n.styles['$' + s], 'end'); } delete n.selected; } }); //select clicked node this.toggleStylesOnClick(node, true); node.selected = true; delete node.hovered; this.hoveredNode = false; } }, onMouseMove: function(e, win, event) { //if mouse button is down and moving set move=true if(this.down) this.move = true; //already handled by mouseover/out if(this.dom && this.isLabel(e, win)) return; var nStyles = this.nodeStylesOnHover; if(!nStyles) return; if(!this.dom) { if(this.hoveredNode) { var geom = this.types[this.hoveredNode.getData('type')]; var contains = geom && geom.contains && geom.contains.call(this.fx, this.hoveredNode, event.getPos()); if(contains) return; } var node = event.getNode(); //if no node is being hovered then just exit if(!this.hoveredNode && !node) return; //if the node is hovered then exit if(node.hovered) return; //select hovered node if(node && !node.selected) { //check if an animation is running and exit it this.fx.nodeFxAnimation.stopTimer(); //unselect all hovered nodes... this.viz.graph.eachNode(function(n) { if(n.hovered && !n.selected) { for(var s in nStyles) { n.setData(s, n.styles['$' + s], 'end'); } delete n.hovered; } }); //select hovered node node.hovered = true; this.hoveredNode = node; this.toggleStylesOnHover(node, true); } else if(this.hoveredNode && !this.hoveredNode.selected) { //check if an animation is running and exit it this.fx.nodeFxAnimation.stopTimer(); //unselect hovered node this.toggleStylesOnHover(this.hoveredNode, false); delete this.hoveredNode.hovered; this.hoveredNode = false; } } } }); Extras.Classes.Navigation = new Class({ Implements: [ExtrasInitializer, EventsInterface], initializePost: function() { this.pos = false; this.pressed = false; }, onMouseWheel: function(e, win, scroll) { if(!this.config.zooming) return; $.event.stop($.event.get(e, win)); var val = this.config.zooming / 1000, ans = 1 + scroll * val; this.canvas.scale(ans, ans); }, onMouseDown: function(e, win, eventInfo) { if(!this.config.panning) return; if(this.config.panning == 'avoid nodes' && eventInfo.getNode()) return; this.pressed = true; this.pos = eventInfo.getPos(); var canvas = this.canvas, ox = canvas.translateOffsetX, oy = canvas.translateOffsetY, sx = canvas.scaleOffsetX, sy = canvas.scaleOffsetY; this.pos.x *= sx; this.pos.x += ox; this.pos.y *= sy; this.pos.y += oy; }, onMouseMove: function(e, win, eventInfo) { if(!this.config.panning) return; if(!this.pressed) return; if(this.config.panning == 'avoid nodes' && eventInfo.getNode()) return; var thispos = this.pos, currentPos = eventInfo.getPos(), canvas = this.canvas, ox = canvas.translateOffsetX, oy = canvas.translateOffsetY, sx = canvas.scaleOffsetX, sy = canvas.scaleOffsetY; currentPos.x *= sx; currentPos.y *= sy; currentPos.x += ox; currentPos.y += oy; var x = currentPos.x - thispos.x, y = currentPos.y - thispos.y; this.pos = currentPos; this.canvas.translate(x * 1/sx, y * 1/sy); }, onMouseUp: function(e, win, eventInfo, isRightClick) { if(!this.config.panning) return; this.pressed = false; } }); /* * File: Canvas.js * */ /* Class: Canvas A canvas widget used by all visualizations. The canvas object can be accessed by doing *viz.canvas*. If you want to know more about <Canvas> options take a look at <Options.Canvas>. A canvas widget is a set of DOM elements that wrap the native canvas DOM Element providing a consistent API and behavior across all browsers. It can also include Elements to add DOM (SVG or HTML) label support to all visualizations. Example: Suppose we have this HTML (start code xml) <div id="infovis"></div> (end code) Now we create a new Visualization (start code js) var viz = new $jit.Viz({ //Where to inject the canvas. Any div container will do. 'injectInto':'infovis', //width and height for canvas. //Default's to the container offsetWidth and Height. 'width': 900, 'height':500 }); (end code) The generated HTML will look like this (start code xml) <div id="infovis"> <div id="infovis-canvaswidget" style="position:relative;"> <canvas id="infovis-canvas" width=900 height=500 style="position:absolute; top:0; left:0; width:900px; height:500px;" /> <div id="infovis-label" style="overflow:visible; position:absolute; top:0; left:0; width:900px; height:0px"> </div> </div> </div> (end code) As you can see, the generated HTML consists of a canvas DOM Element of id *infovis-canvas* and a div label container of id *infovis-label*, wrapped in a main div container of id *infovis-canvaswidget*. */ var Canvas; (function() { //check for native canvas support var canvasType = typeof HTMLCanvasElement, supportsCanvas = (canvasType == 'object' || canvasType == 'function'); //create element function function $E(tag, props) { var elem = document.createElement(tag); for(var p in props) { if(typeof props[p] == "object") { $.extend(elem[p], props[p]); } else { elem[p] = props[p]; } } if (tag == "canvas" && !supportsCanvas && G_vmlCanvasManager) { elem = G_vmlCanvasManager.initElement(elem); } return elem; } //canvas widget which we will call just Canvas $jit.Canvas = Canvas = new Class({ canvases: [], pos: false, element: false, labelContainer: false, translateOffsetX: 0, translateOffsetY: 0, scaleOffsetX: 1, scaleOffsetY: 1, initialize: function(viz, opt) { this.viz = viz; this.opt = opt; var id = $.type(opt.injectInto) == 'string'? opt.injectInto:opt.injectInto.id, idLabel = id + "-label", wrapper = $(id), width = opt.width || wrapper.offsetWidth, height = opt.height || wrapper.offsetHeight; this.id = id; //canvas options var canvasOptions = { injectInto: id, width: width, height: height }; //create main wrapper this.element = $E('div', { 'id': id + '-canvaswidget', 'style': { 'position': 'relative', 'width': width + 'px', 'height': height + 'px' } }); //create label container this.labelContainer = this.createLabelContainer(opt.Label.type, idLabel, canvasOptions); //create primary canvas this.canvases.push(new Canvas.Base({ config: $.extend({idSuffix: '-canvas'}, canvasOptions), plot: function(base) { viz.fx.plot(); }, resize: function() { viz.refresh(); } })); //create secondary canvas var back = opt.background; if(back) { var backCanvas = new Canvas.Background[back.type](viz, $.extend(back, canvasOptions)); this.canvases.push(new Canvas.Base(backCanvas)); } //insert canvases var len = this.canvases.length; while(len--) { this.element.appendChild(this.canvases[len].canvas); if(len > 0) { this.canvases[len].plot(); } } this.element.appendChild(this.labelContainer); wrapper.appendChild(this.element); //Update canvas position when the page is scrolled. var timer = null, that = this; $.addEvent(window, 'scroll', function() { clearTimeout(timer); timer = setTimeout(function() { that.getPos(true); //update canvas position }, 500); }); $.addEvent(window, 'click', function() { clearTimeout(timer); timer = setTimeout(function() { that.getPos(true); //update canvas position }, 500); }); sb = document.getElementById('sb'+id); $.addEvent(sb, 'scroll', function() { clearTimeout(timer); timer = setTimeout(function() { that.getPos(true); //update canvas position }, 500); }); }, /* Method: getCtx Returns the main canvas context object Example: (start code js) var ctx = canvas.getCtx(); //Now I can use the native canvas context //and for example change some canvas styles ctx.globalAlpha = 1; (end code) */ getCtx: function(i) { return this.canvases[i || 0].getCtx(); }, /* Method: getConfig Returns the current Configuration for this Canvas Widget. Example: (start code js) var config = canvas.getConfig(); (end code) */ getConfig: function() { return this.opt; }, /* Method: getElement Returns the main Canvas DOM wrapper Example: (start code js) var wrapper = canvas.getElement(); //Returns <div id="infovis-canvaswidget" ... >...</div> as element (end code) */ getElement: function() { return this.element; }, /* Method: getSize Returns canvas dimensions. Returns: An object with *width* and *height* properties. Example: (start code js) canvas.getSize(); //returns { width: 900, height: 500 } (end code) */ getSize: function(i) { return this.canvases[i || 0].getSize(); }, /* Method: resize Resizes the canvas. Parameters: width - New canvas width. height - New canvas height. Example: (start code js) canvas.resize(width, height); (end code) */ resize: function(width, height) { this.getPos(true); this.translateOffsetX = this.translateOffsetY = 0; this.scaleOffsetX = this.scaleOffsetY = 1; for(var i=0, l=this.canvases.length; i<l; i++) { this.canvases[i].resize(width, height); } var style = this.element.style; style.width = width + 'px'; style.height = height + 'px'; if(this.labelContainer) this.labelContainer.style.width = width + 'px'; }, /* Method: translate Applies a translation to the canvas. Parameters: x - (number) x offset. y - (number) y offset. disablePlot - (boolean) Default's *false*. Set this to *true* if you don't want to refresh the visualization. Example: (start code js) canvas.translate(30, 30); (end code) */ translate: function(x, y, disablePlot) { this.translateOffsetX += x*this.scaleOffsetX; this.translateOffsetY += y*this.scaleOffsetY; for(var i=0, l=this.canvases.length; i<l; i++) { this.canvases[i].translate(x, y, disablePlot); } }, /* Method: scale Scales the canvas. Parameters: x - (number) scale value. y - (number) scale value. disablePlot - (boolean) Default's *false*. Set this to *true* if you don't want to refresh the visualization. Example: (start code js) canvas.scale(0.5, 0.5); (end code) */ scale: function(x, y, disablePlot) { if(!disablePlot) { disablePlot = false; } var px = this.scaleOffsetX * x, py = this.scaleOffsetY * y; var dx = this.translateOffsetX * (x -1) / px, dy = this.translateOffsetY * (y -1) / py; this.scaleOffsetX = px; this.scaleOffsetY = py; for(var i=0, l=this.canvases.length; i<l; i++) { this.canvases[i].scale(x, y, true); } this.translate(dx, dy, disablePlot); }, /* Method: getPos Returns the canvas position as an *x, y* object. Parameters: force - (boolean) Default's *false*. Set this to *true* if you want to recalculate the position without using any cache information. Returns: An object with *x* and *y* properties. Example: (start code js) canvas.getPos(true); //returns { x: 900, y: 500 } (end code) */ getPos: function(force){ if(force || !this.pos) { return this.pos = $.getPos(this.getElement()); } return this.pos; }, /* Method: clear Clears the canvas. */ clear: function(i){ this.canvases[i||0].clear(); }, path: function(type, action){ var ctx = this.canvases[0].getCtx(); ctx.beginPath(); action(ctx); ctx[type](); ctx.closePath(); }, createLabelContainer: function(type, idLabel, dim) { var NS = 'http://www.w3.org/2000/svg'; if(type == 'HTML' || type == 'Native') { return $E('div', { 'id': idLabel, 'style': { 'overflow': 'visible', 'position': 'absolute', 'top': 0, 'left': 0, 'width': dim.width + 'px', 'height': 0 } }); } else if(type == 'SVG') { var svgContainer = document.createElementNS(NS, 'svg:svg'); svgContainer.setAttribute("width", dim.width); svgContainer.setAttribute('height', dim.height); var style = svgContainer.style; style.position = 'absolute'; style.left = style.top = '0px'; var labelContainer = document.createElementNS(NS, 'svg:g'); labelContainer.setAttribute('width', dim.width); labelContainer.setAttribute('height', dim.height); labelContainer.setAttribute('x', 0); labelContainer.setAttribute('y', 0); labelContainer.setAttribute('id', idLabel); svgContainer.appendChild(labelContainer); return svgContainer; } } }); //base canvas wrapper Canvas.Base = new Class({ translateOffsetX: 0, translateOffsetY: 0, scaleOffsetX: 1, scaleOffsetY: 1, initialize: function(viz) { this.viz = viz; this.opt = viz.config; this.size = false; this.createCanvas(); this.translateToCenter(); }, createCanvas: function() { var opt = this.opt, width = opt.width, height = opt.height; this.canvas = $E('canvas', { 'id': opt.injectInto + opt.idSuffix, 'width': width, 'height': height, 'style': { 'position': 'absolute', 'top': 0, 'left': 0, 'width': width + 'px', 'height': height + 'px' } }); }, getCtx: function() { if(!this.ctx) return this.ctx = this.canvas.getContext('2d'); return this.ctx; }, getSize: function() { if(this.size) return this.size; var canvas = this.canvas; return this.size = { width: canvas.width, height: canvas.height }; }, translateToCenter: function(ps) { var size = this.getSize(), width = ps? (size.width - ps.width - this.translateOffsetX*2) : size.width; height = ps? (size.height - ps.height - this.translateOffsetY*2) : size.height; var ctx = this.getCtx(); ps && ctx.scale(1/this.scaleOffsetX, 1/this.scaleOffsetY); ctx.translate(width/2, height/2); }, resize: function(width, height) { var size = this.getSize(), canvas = this.canvas, styles = canvas.style; this.size = false; canvas.width = width; canvas.height = height; styles.width = width + "px"; styles.height = height + "px"; //small ExCanvas fix if (!supportsCanvas) { // for some unknown reason _resize() method is not being called in some // IE browser instances, so call it manually // in obfuscated version of flashcanvas.js the method is renamed to I() this.getCtx().I(width, height); } this.translateToCenter(); this.translateOffsetX = this.translateOffsetY = 0; this.scaleOffsetX = this.scaleOffsetY = 1; this.clear(); this.viz.resize(width, height, this); }, translate: function(x, y, disablePlot) { var sx = this.scaleOffsetX, sy = this.scaleOffsetY; this.translateOffsetX += x*sx; this.translateOffsetY += y*sy; this.getCtx().translate(x, y); !disablePlot && this.plot(); }, scale: function(x, y, disablePlot) { this.scaleOffsetX *= x; this.scaleOffsetY *= y; this.getCtx().scale(x, y); !disablePlot && this.plot(); }, clear: function(){ var size = this.getSize(), ox = this.translateOffsetX, oy = this.translateOffsetY, sx = this.scaleOffsetX, sy = this.scaleOffsetY; this.getCtx().clearRect((-size.width / 2 - ox) * 1/sx, (-size.height / 2 - oy) * 1/sy, size.width * 1/sx, size.height * 1/sy); }, plot: function() { this.clear(); this.viz.plot(this); } }); //background canvases //TODO(nico): document this! Canvas.Background = {}; Canvas.Background.Circles = new Class({ initialize: function(viz, options) { this.viz = viz; this.config = $.merge({ idSuffix: '-bkcanvas', levelDistance: 100, numberOfCircles: 6, CanvasStyles: {}, offset: 0 }, options); }, resize: function(width, height, base) { this.plot(base); }, plot: function(base) { var canvas = base.canvas, ctx = base.getCtx(), conf = this.config, styles = conf.CanvasStyles; //set canvas styles for(var s in styles) ctx[s] = styles[s]; var n = conf.numberOfCircles, rho = conf.levelDistance; for(var i=1; i<=n; i++) { ctx.beginPath(); ctx.arc(0, 0, rho * i, 0, 2 * Math.PI, false); ctx.stroke(); ctx.closePath(); } //TODO(nico): print labels too! } }); Canvas.Background.Fade = new Class({ initialize: function(viz, options) { this.viz = viz; this.config = $.merge({ idSuffix: '-bkcanvas', CanvasStyles: {}, offset: 0 }, options); }, resize: function(width, height, base) { this.plot(base); }, plot: function(base) { var canvas = base.canvas, ctx = base.getCtx(), conf = this.config, styles = conf.CanvasStyles, size = base.getSize(); ctx.fillStyle = 'rgb(255,255,255)'; ctx.fillRect(-size.width/2,-size.height/2,size.width,size.height); //TODO(nico): print labels too! } }); })(); /* * File: Polar.js * * Defines the <Polar> class. * * Description: * * The <Polar> class, just like the <Complex> class, is used by the <Hypertree>, <ST> and <RGraph> as a 2D point representation. * * See also: * * <http://en.wikipedia.org/wiki/Polar_coordinates> * */ /* Class: Polar A multi purpose polar representation. Description: The <Polar> class, just like the <Complex> class, is used by the <Hypertree>, <ST> and <RGraph> as a 2D point representation. See also: <http://en.wikipedia.org/wiki/Polar_coordinates> Parameters: theta - An angle. rho - The norm. */ var Polar = function(theta, rho) { this.theta = theta; this.rho = rho; }; $jit.Polar = Polar; Polar.prototype = { /* Method: getc Returns a complex number. Parameters: simple - _optional_ If *true*, this method will return only an object holding x and y properties and not a <Complex> instance. Default's *false*. Returns: A complex number. */ getc: function(simple) { return this.toComplex(simple); }, /* Method: getp Returns a <Polar> representation. Returns: A variable in polar coordinates. */ getp: function() { return this; }, /* Method: set Sets a number. Parameters: v - A <Complex> or <Polar> instance. */ set: function(v) { v = v.getp(); this.theta = v.theta; this.rho = v.rho; }, /* Method: setc Sets a <Complex> number. Parameters: x - A <Complex> number real part. y - A <Complex> number imaginary part. */ setc: function(x, y) { this.rho = Math.sqrt(x * x + y * y); this.theta = Math.atan2(y, x); if(this.theta < 0) this.theta += Math.PI * 2; }, /* Method: setp Sets a polar number. Parameters: theta - A <Polar> number angle property. rho - A <Polar> number rho property. */ setp: function(theta, rho) { this.theta = theta; this.rho = rho; }, /* Method: clone Returns a copy of the current object. Returns: A copy of the real object. */ clone: function() { return new Polar(this.theta, this.rho); }, /* Method: toComplex Translates from polar to cartesian coordinates and returns a new <Complex> instance. Parameters: simple - _optional_ If *true* this method will only return an object with x and y properties (and not the whole <Complex> instance). Default's *false*. Returns: A new <Complex> instance. */ toComplex: function(simple) { var x = Math.cos(this.theta) * this.rho; var y = Math.sin(this.theta) * this.rho; if(simple) return { 'x': x, 'y': y}; return new Complex(x, y); }, /* Method: add Adds two <Polar> instances. Parameters: polar - A <Polar> number. Returns: A new Polar instance. */ add: function(polar) { return new Polar(this.theta + polar.theta, this.rho + polar.rho); }, /* Method: scale Scales a polar norm. Parameters: number - A scale factor. Returns: A new Polar instance. */ scale: function(number) { return new Polar(this.theta, this.rho * number); }, /* Method: equals Comparison method. Returns *true* if the theta and rho properties are equal. Parameters: c - A <Polar> number. Returns: *true* if the theta and rho parameters for these objects are equal. *false* otherwise. */ equals: function(c) { return this.theta == c.theta && this.rho == c.rho; }, /* Method: $add Adds two <Polar> instances affecting the current object. Paramters: polar - A <Polar> instance. Returns: The changed object. */ $add: function(polar) { this.theta = this.theta + polar.theta; this.rho += polar.rho; return this; }, /* Method: $madd Adds two <Polar> instances affecting the current object. The resulting theta angle is modulo 2pi. Parameters: polar - A <Polar> instance. Returns: The changed object. */ $madd: function(polar) { this.theta = (this.theta + polar.theta) % (Math.PI * 2); this.rho += polar.rho; return this; }, /* Method: $scale Scales a polar instance affecting the object. Parameters: number - A scaling factor. Returns: The changed object. */ $scale: function(number) { this.rho *= number; return this; }, /* Method: interpolate Calculates a polar interpolation between two points at a given delta moment. Parameters: elem - A <Polar> instance. delta - A delta factor ranging [0, 1]. Returns: A new <Polar> instance representing an interpolation between _this_ and _elem_ */ interpolate: function(elem, delta) { var pi = Math.PI, pi2 = pi * 2; var ch = function(t) { var a = (t < 0)? (t % pi2) + pi2 : t % pi2; return a; }; var tt = this.theta, et = elem.theta; var sum, diff = Math.abs(tt - et); if(diff == pi) { if(tt > et) { sum = ch((et + ((tt - pi2) - et) * delta)) ; } else { sum = ch((et - pi2 + (tt - (et)) * delta)); } } else if(diff >= pi) { if(tt > et) { sum = ch((et + ((tt - pi2) - et) * delta)) ; } else { sum = ch((et - pi2 + (tt - (et - pi2)) * delta)); } } else { sum = ch((et + (tt - et) * delta)) ; } var r = (this.rho - elem.rho) * delta + elem.rho; return { 'theta': sum, 'rho': r }; } }; var $P = function(a, b) { return new Polar(a, b); }; Polar.KER = $P(0, 0); /* * File: Complex.js * * Defines the <Complex> class. * * Description: * * The <Complex> class, just like the <Polar> class, is used by the <Hypertree>, <ST> and <RGraph> as a 2D point representation. * * See also: * * <http://en.wikipedia.org/wiki/Complex_number> * */ /* Class: Complex A multi-purpose Complex Class with common methods. Description: The <Complex> class, just like the <Polar> class, is used by the <Hypertree>, <ST> and <RGraph> as a 2D point representation. See also: <http://en.wikipedia.org/wiki/Complex_number> Parameters: x - _optional_ A Complex number real part. y - _optional_ A Complex number imaginary part. */ var Complex = function(x, y) { this.x = x; this.y = y; }; $jit.Complex = Complex; Complex.prototype = { /* Method: getc Returns a complex number. Returns: A complex number. */ getc: function() { return this; }, /* Method: getp Returns a <Polar> representation of this number. Parameters: simple - _optional_ If *true*, this method will return only an object holding theta and rho properties and not a <Polar> instance. Default's *false*. Returns: A variable in <Polar> coordinates. */ getp: function(simple) { return this.toPolar(simple); }, /* Method: set Sets a number. Parameters: c - A <Complex> or <Polar> instance. */ set: function(c) { c = c.getc(true); this.x = c.x; this.y = c.y; }, /* Method: setc Sets a complex number. Parameters: x - A <Complex> number Real part. y - A <Complex> number Imaginary part. */ setc: function(x, y) { this.x = x; this.y = y; }, /* Method: setp Sets a polar number. Parameters: theta - A <Polar> number theta property. rho - A <Polar> number rho property. */ setp: function(theta, rho) { this.x = Math.cos(theta) * rho; this.y = Math.sin(theta) * rho; }, /* Method: clone Returns a copy of the current object. Returns: A copy of the real object. */ clone: function() { return new Complex(this.x, this.y); }, /* Method: toPolar Transforms cartesian to polar coordinates. Parameters: simple - _optional_ If *true* this method will only return an object with theta and rho properties (and not the whole <Polar> instance). Default's *false*. Returns: A new <Polar> instance. */ toPolar: function(simple) { var rho = this.norm(); var atan = Math.atan2(this.y, this.x); if(atan < 0) atan += Math.PI * 2; if(simple) return { 'theta': atan, 'rho': rho }; return new Polar(atan, rho); }, /* Method: norm Calculates a <Complex> number norm. Returns: A real number representing the complex norm. */ norm: function () { return Math.sqrt(this.squaredNorm()); }, /* Method: squaredNorm Calculates a <Complex> number squared norm. Returns: A real number representing the complex squared norm. */ squaredNorm: function () { return this.x*this.x + this.y*this.y; }, /* Method: add Returns the result of adding two complex numbers. Does not alter the original object. Parameters: pos - A <Complex> instance. Returns: The result of adding two complex numbers. */ add: function(pos) { return new Complex(this.x + pos.x, this.y + pos.y); }, /* Method: prod Returns the result of multiplying two <Complex> numbers. Does not alter the original object. Parameters: pos - A <Complex> instance. Returns: The result of multiplying two complex numbers. */ prod: function(pos) { return new Complex(this.x*pos.x - this.y*pos.y, this.y*pos.x + this.x*pos.y); }, /* Method: conjugate Returns the conjugate of this <Complex> number. Does not alter the original object. Returns: The conjugate of this <Complex> number. */ conjugate: function() { return new Complex(this.x, -this.y); }, /* Method: scale Returns the result of scaling a <Complex> instance. Does not alter the original object. Parameters: factor - A scale factor. Returns: The result of scaling this complex to a factor. */ scale: function(factor) { return new Complex(this.x * factor, this.y * factor); }, /* Method: equals Comparison method. Returns *true* if both real and imaginary parts are equal. Parameters: c - A <Complex> instance. Returns: A boolean instance indicating if both <Complex> numbers are equal. */ equals: function(c) { return this.x == c.x && this.y == c.y; }, /* Method: $add Returns the result of adding two <Complex> numbers. Alters the original object. Parameters: pos - A <Complex> instance. Returns: The result of adding two complex numbers. */ $add: function(pos) { this.x += pos.x; this.y += pos.y; return this; }, /* Method: $prod Returns the result of multiplying two <Complex> numbers. Alters the original object. Parameters: pos - A <Complex> instance. Returns: The result of multiplying two complex numbers. */ $prod:function(pos) { var x = this.x, y = this.y; this.x = x*pos.x - y*pos.y; this.y = y*pos.x + x*pos.y; return this; }, /* Method: $conjugate Returns the conjugate for this <Complex>. Alters the original object. Returns: The conjugate for this complex. */ $conjugate: function() { this.y = -this.y; return this; }, /* Method: $scale Returns the result of scaling a <Complex> instance. Alters the original object. Parameters: factor - A scale factor. Returns: The result of scaling this complex to a factor. */ $scale: function(factor) { this.x *= factor; this.y *= factor; return this; }, /* Method: $div Returns the division of two <Complex> numbers. Alters the original object. Parameters: pos - A <Complex> number. Returns: The result of scaling this complex to a factor. */ $div: function(pos) { var x = this.x, y = this.y; var sq = pos.squaredNorm(); this.x = x * pos.x + y * pos.y; this.y = y * pos.x - x * pos.y; return this.$scale(1 / sq); } }; var $C = function(a, b) { return new Complex(a, b); }; Complex.KER = $C(0, 0); /* * File: Graph.js * */ /* Class: Graph A Graph Class that provides useful manipulation functions. You can find more manipulation methods in the <Graph.Util> object. An instance of this class can be accessed by using the *graph* parameter of any tree or graph visualization. Example: (start code js) //create new visualization var viz = new $jit.Viz(options); //load JSON data viz.loadJSON(json); //access model viz.graph; //<Graph> instance (end code) Implements: The following <Graph.Util> methods are implemented in <Graph> - <Graph.Util.getNode> - <Graph.Util.eachNode> - <Graph.Util.computeLevels> - <Graph.Util.eachBFS> - <Graph.Util.clean> - <Graph.Util.getClosestNodeToPos> - <Graph.Util.getClosestNodeToOrigin> */ $jit.Graph = new Class({ initialize: function(opt, Node, Edge, Label) { var innerOptions = { 'complex': false, 'Node': {} }; this.Node = Node; this.Edge = Edge; this.Label = Label; this.opt = $.merge(innerOptions, opt || {}); this.nodes = {}; this.edges = {}; //add nodeList methods var that = this; this.nodeList = {}; for(var p in Accessors) { that.nodeList[p] = (function(p) { return function() { var args = Array.prototype.slice.call(arguments); that.eachNode(function(n) { n[p].apply(n, args); }); }; })(p); } }, /* Method: getNode Returns a <Graph.Node> by *id*. Parameters: id - (string) A <Graph.Node> id. Example: (start code js) var node = graph.getNode('nodeId'); (end code) */ getNode: function(id) { if(this.hasNode(id)) return this.nodes[id]; return false; }, /* Method: getByName Returns a <Graph.Node> by *name*. Parameters: name - (string) A <Graph.Node> name. Example: (start code js) var node = graph.getByName('someName'); (end code) */ getByName: function(name) { for(var id in this.nodes) { var n = this.nodes[id]; if(n.name == name) return n; } return false; }, /* Method: getAdjacence Returns a <Graph.Adjacence> object connecting nodes with ids *id* and *id2*. Parameters: id - (string) A <Graph.Node> id. id2 - (string) A <Graph.Node> id. */ getAdjacence: function (id, id2) { if(id in this.edges) { return this.edges[id][id2]; } return false; }, /* Method: addNode Adds a node. Parameters: obj - An object with the properties described below id - (string) A node id name - (string) A node's name data - (object) A node's data hash See also: <Graph.Node> */ addNode: function(obj) { if(!this.nodes[obj.id]) { var edges = this.edges[obj.id] = {}; this.nodes[obj.id] = new Graph.Node($.extend({ 'id': obj.id, 'name': obj.name, 'data': $.merge(obj.data || {}, {}), 'adjacencies': edges }, this.opt.Node), this.opt.complex, this.Node, this.Edge, this.Label); } return this.nodes[obj.id]; }, /* Method: addAdjacence Connects nodes specified by *obj* and *obj2*. If not found, nodes are created. Parameters: obj - (object) A <Graph.Node> object. obj2 - (object) Another <Graph.Node> object. data - (object) A data object. Used to store some extra information in the <Graph.Adjacence> object created. See also: <Graph.Node>, <Graph.Adjacence> */ addAdjacence: function (obj, obj2, data) { if(!this.hasNode(obj.id)) { this.addNode(obj); } if(!this.hasNode(obj2.id)) { this.addNode(obj2); } obj = this.nodes[obj.id]; obj2 = this.nodes[obj2.id]; if(!obj.adjacentTo(obj2)) { var adjsObj = this.edges[obj.id] = this.edges[obj.id] || {}; var adjsObj2 = this.edges[obj2.id] = this.edges[obj2.id] || {}; adjsObj[obj2.id] = adjsObj2[obj.id] = new Graph.Adjacence(obj, obj2, data, this.Edge, this.Label); return adjsObj[obj2.id]; } return this.edges[obj.id][obj2.id]; }, /* Method: removeNode Removes a <Graph.Node> matching the specified *id*. Parameters: id - (string) A node's id. */ removeNode: function(id) { if(this.hasNode(id)) { delete this.nodes[id]; var adjs = this.edges[id]; for(var to in adjs) { delete this.edges[to][id]; } delete this.edges[id]; } }, /* Method: removeAdjacence Removes a <Graph.Adjacence> matching *id1* and *id2*. Parameters: id1 - (string) A <Graph.Node> id. id2 - (string) A <Graph.Node> id. */ removeAdjacence: function(id1, id2) { delete this.edges[id1][id2]; delete this.edges[id2][id1]; }, /* Method: hasNode Returns a boolean indicating if the node belongs to the <Graph> or not. Parameters: id - (string) Node id. */ hasNode: function(id) { return id in this.nodes; }, /* Method: empty Empties the Graph */ empty: function() { this.nodes = {}; this.edges = {};} }); var Graph = $jit.Graph; /* Object: Accessors Defines a set of methods for data, canvas and label styles manipulation implemented by <Graph.Node> and <Graph.Adjacence> instances. */ var Accessors; (function () { var getDataInternal = function(prefix, prop, type, force, prefixConfig) { var data; type = type || 'current'; prefix = "$" + (prefix ? prefix + "-" : ""); if(type == 'current') { data = this.data; } else if(type == 'start') { data = this.startData; } else if(type == 'end') { data = this.endData; } var dollar = prefix + prop; if(force) { return data[dollar]; } if(!this.Config.overridable) return prefixConfig[prop] || 0; return (dollar in data) ? data[dollar] : ((dollar in this.data) ? this.data[dollar] : (prefixConfig[prop] || 0)); } var setDataInternal = function(prefix, prop, value, type) { type = type || 'current'; prefix = '$' + (prefix ? prefix + '-' : ''); var data; if(type == 'current') { data = this.data; } else if(type == 'start') { data = this.startData; } else if(type == 'end') { data = this.endData; } data[prefix + prop] = value; } var removeDataInternal = function(prefix, properties) { prefix = '$' + (prefix ? prefix + '-' : ''); var that = this; $.each(properties, function(prop) { var pref = prefix + prop; delete that.data[pref]; delete that.endData[pref]; delete that.startData[pref]; }); } Accessors = { /* Method: getData Returns the specified data value property. This is useful for querying special/reserved <Graph.Node> data properties (i.e dollar prefixed properties). Parameters: prop - (string) The name of the property. The dollar sign is not needed. For example *getData(width)* will return *data.$width*. type - (string) The type of the data property queried. Default's "current". You can access *start* and *end* data properties also. These properties are used when making animations. force - (boolean) Whether to obtain the true value of the property (equivalent to *data.$prop*) or to check for *node.overridable = true* first. Returns: The value of the dollar prefixed property or the global Node/Edge property value if *overridable=false* Example: (start code js) node.getData('width'); //will return node.data.$width if Node.overridable=true; (end code) */ getData: function(prop, type, force) { return getDataInternal.call(this, "", prop, type, force, this.Config); }, /* Method: setData Sets the current data property with some specific value. This method is only useful for reserved (dollar prefixed) properties. Parameters: prop - (string) The name of the property. The dollar sign is not necessary. For example *setData(width)* will set *data.$width*. value - (mixed) The value to store. type - (string) The type of the data property to store. Default's "current" but can also be "start" or "end". Example: (start code js) node.setData('width', 30); (end code) If we were to make an animation of a node/edge width then we could do (start code js) var node = viz.getNode('nodeId'); //set start and end values node.setData('width', 10, 'start'); node.setData('width', 30, 'end'); //will animate nodes width property viz.fx.animate({ modes: ['node-property:width'], duration: 1000 }); (end code) */ setData: function(prop, value, type) { setDataInternal.call(this, "", prop, value, type); }, /* Method: setDataset Convenience method to set multiple data values at once. Parameters: types - (array|string) A set of 'current', 'end' or 'start' values. obj - (object) A hash containing the names and values of the properties to be altered. Example: (start code js) node.setDataset(['current', 'end'], { 'width': [100, 5], 'color': ['#fff', '#ccc'] }); //...or also node.setDataset('end', { 'width': 5, 'color': '#ccc' }); (end code) See also: <Accessors.setData> */ setDataset: function(types, obj) { types = $.splat(types); for(var attr in obj) { for(var i=0, val = $.splat(obj[attr]), l=types.length; i<l; i++) { this.setData(attr, val[i], types[i]); } } }, /* Method: removeData Remove data properties. Parameters: One or more property names as arguments. The dollar sign is not needed. Example: (start code js) node.removeData('width'); //now the default width value is returned (end code) */ removeData: function() { removeDataInternal.call(this, "", Array.prototype.slice.call(arguments)); }, /* Method: getCanvasStyle Returns the specified canvas style data value property. This is useful for querying special/reserved <Graph.Node> canvas style data properties (i.e. dollar prefixed properties that match with $canvas-<name of canvas style>). Parameters: prop - (string) The name of the property. The dollar sign is not needed. For example *getCanvasStyle(shadowBlur)* will return *data[$canvas-shadowBlur]*. type - (string) The type of the data property queried. Default's *current*. You can access *start* and *end* data properties also. Example: (start code js) node.getCanvasStyle('shadowBlur'); (end code) See also: <Accessors.getData> */ getCanvasStyle: function(prop, type, force) { return getDataInternal.call( this, 'canvas', prop, type, force, this.Config.CanvasStyles); }, /* Method: setCanvasStyle Sets the canvas style data property with some specific value. This method is only useful for reserved (dollar prefixed) properties. Parameters: prop - (string) Name of the property. Can be any canvas property like 'shadowBlur', 'shadowColor', 'strokeStyle', etc. value - (mixed) The value to set to the property. type - (string) Default's *current*. Whether to set *start*, *current* or *end* type properties. Example: (start code js) node.setCanvasStyle('shadowBlur', 30); (end code) If we were to make an animation of a node/edge shadowBlur canvas style then we could do (start code js) var node = viz.getNode('nodeId'); //set start and end values node.setCanvasStyle('shadowBlur', 10, 'start'); node.setCanvasStyle('shadowBlur', 30, 'end'); //will animate nodes canvas style property for nodes viz.fx.animate({ modes: ['node-style:shadowBlur'], duration: 1000 }); (end code) See also: <Accessors.setData>. */ setCanvasStyle: function(prop, value, type) { setDataInternal.call(this, 'canvas', prop, value, type); }, /* Method: setCanvasStyles Convenience method to set multiple styles at once. Parameters: types - (array|string) A set of 'current', 'end' or 'start' values. obj - (object) A hash containing the names and values of the properties to be altered. See also: <Accessors.setDataset>. */ setCanvasStyles: function(types, obj) { types = $.splat(types); for(var attr in obj) { for(var i=0, val = $.splat(obj[attr]), l=types.length; i<l; i++) { this.setCanvasStyle(attr, val[i], types[i]); } } }, /* Method: removeCanvasStyle Remove canvas style properties from data. Parameters: A variable number of canvas style strings. See also: <Accessors.removeData>. */ removeCanvasStyle: function() { removeDataInternal.call(this, 'canvas', Array.prototype.slice.call(arguments)); }, /* Method: getLabelData Returns the specified label data value property. This is useful for querying special/reserved <Graph.Node> label options (i.e. dollar prefixed properties that match with $label-<name of label style>). Parameters: prop - (string) The name of the property. The dollar sign prefix is not needed. For example *getLabelData(size)* will return *data[$label-size]*. type - (string) The type of the data property queried. Default's *current*. You can access *start* and *end* data properties also. See also: <Accessors.getData>. */ getLabelData: function(prop, type, force) { return getDataInternal.call( this, 'label', prop, type, force, this.Label); }, /* Method: setLabelData Sets the current label data with some specific value. This method is only useful for reserved (dollar prefixed) properties. Parameters: prop - (string) Name of the property. Can be any canvas property like 'shadowBlur', 'shadowColor', 'strokeStyle', etc. value - (mixed) The value to set to the property. type - (string) Default's *current*. Whether to set *start*, *current* or *end* type properties. Example: (start code js) node.setLabelData('size', 30); (end code) If we were to make an animation of a node label size then we could do (start code js) var node = viz.getNode('nodeId'); //set start and end values node.setLabelData('size', 10, 'start'); node.setLabelData('size', 30, 'end'); //will animate nodes label size viz.fx.animate({ modes: ['label-property:size'], duration: 1000 }); (end code) See also: <Accessors.setData>. */ setLabelData: function(prop, value, type) { setDataInternal.call(this, 'label', prop, value, type); }, /* Method: setLabelDataset Convenience function to set multiple label data at once. Parameters: types - (array|string) A set of 'current', 'end' or 'start' values. obj - (object) A hash containing the names and values of the properties to be altered. See also: <Accessors.setDataset>. */ setLabelDataset: function(types, obj) { types = $.splat(types); for(var attr in obj) { for(var i=0, val = $.splat(obj[attr]), l=types.length; i<l; i++) { this.setLabelData(attr, val[i], types[i]); } } }, /* Method: removeLabelData Remove label properties from data. Parameters: A variable number of label property strings. See also: <Accessors.removeData>. */ removeLabelData: function() { removeDataInternal.call(this, 'label', Array.prototype.slice.call(arguments)); } }; })(); /* Class: Graph.Node A <Graph> node. Implements: <Accessors> methods. The following <Graph.Util> methods are implemented by <Graph.Node> - <Graph.Util.eachAdjacency> - <Graph.Util.eachLevel> - <Graph.Util.eachSubgraph> - <Graph.Util.eachSubnode> - <Graph.Util.anySubnode> - <Graph.Util.getSubnodes> - <Graph.Util.getParents> - <Graph.Util.isDescendantOf> */ Graph.Node = new Class({ initialize: function(opt, complex, Node, Edge, Label) { var innerOptions = { 'id': '', 'name': '', 'data': {}, 'startData': {}, 'endData': {}, 'adjacencies': {}, 'selected': false, 'drawn': false, 'exist': false, 'angleSpan': { 'begin': 0, 'end' : 0 }, 'pos': (complex && $C(0, 0)) || $P(0, 0), 'startPos': (complex && $C(0, 0)) || $P(0, 0), 'endPos': (complex && $C(0, 0)) || $P(0, 0) }; $.extend(this, $.extend(innerOptions, opt)); this.Config = this.Node = Node; this.Edge = Edge; this.Label = Label; }, /* Method: adjacentTo Indicates if the node is adjacent to the node specified by id Parameters: id - (string) A node id. Example: (start code js) node.adjacentTo('nodeId') == true; (end code) */ adjacentTo: function(node) { return node.id in this.adjacencies; }, /* Method: getAdjacency Returns a <Graph.Adjacence> object connecting the current <Graph.Node> and the node having *id* as id. Parameters: id - (string) A node id. */ getAdjacency: function(id) { return this.adjacencies[id]; }, /* Method: getPos Returns the position of the node. Parameters: type - (string) Default's *current*. Possible values are "start", "end" or "current". Returns: A <Complex> or <Polar> instance. Example: (start code js) var pos = node.getPos('end'); (end code) */ getPos: function(type) { type = type || "current"; if(type == "current") { return this.pos; } else if(type == "end") { return this.endPos; } else if(type == "start") { return this.startPos; } }, /* Method: setPos Sets the node's position. Parameters: value - (object) A <Complex> or <Polar> instance. type - (string) Default's *current*. Possible values are "start", "end" or "current". Example: (start code js) node.setPos(new $jit.Complex(0, 0), 'end'); (end code) */ setPos: function(value, type) { type = type || "current"; var pos; if(type == "current") { pos = this.pos; } else if(type == "end") { pos = this.endPos; } else if(type == "start") { pos = this.startPos; } pos.set(value); } }); Graph.Node.implement(Accessors); /* Class: Graph.Adjacence A <Graph> adjacence (or edge) connecting two <Graph.Nodes>. Implements: <Accessors> methods. See also: <Graph>, <Graph.Node> Properties: nodeFrom - A <Graph.Node> connected by this edge. nodeTo - Another <Graph.Node> connected by this edge. data - Node data property containing a hash (i.e {}) with custom options. */ Graph.Adjacence = new Class({ initialize: function(nodeFrom, nodeTo, data, Edge, Label) { this.nodeFrom = nodeFrom; this.nodeTo = nodeTo; this.data = data || {}; this.startData = {}; this.endData = {}; this.Config = this.Edge = Edge; this.Label = Label; } }); Graph.Adjacence.implement(Accessors); /* Object: Graph.Util <Graph> traversal and processing utility object. Note: For your convenience some of these methods have also been appended to <Graph> and <Graph.Node> classes. */ Graph.Util = { /* filter For internal use only. Provides a filtering function based on flags. */ filter: function(param) { if(!param || !($.type(param) == 'string')) return function() { return true; }; var props = param.split(" "); return function(elem) { for(var i=0; i<props.length; i++) { if(elem[props[i]]) { return false; } } return true; }; }, /* Method: getNode Returns a <Graph.Node> by *id*. Also implemented by: <Graph> Parameters: graph - (object) A <Graph> instance. id - (string) A <Graph.Node> id. Example: (start code js) $jit.Graph.Util.getNode(graph, 'nodeid'); //or... graph.getNode('nodeid'); (end code) */ getNode: function(graph, id) { return graph.nodes[id]; }, /* Method: eachNode Iterates over <Graph> nodes performing an *action*. Also implemented by: <Graph>. Parameters: graph - (object) A <Graph> instance. action - (function) A callback function having a <Graph.Node> as first formal parameter. Example: (start code js) $jit.Graph.Util.eachNode(graph, function(node) { alert(node.name); }); //or... graph.eachNode(function(node) { alert(node.name); }); (end code) */ eachNode: function(graph, action, flags) { var filter = this.filter(flags); for(var i in graph.nodes) { if(filter(graph.nodes[i])) action(graph.nodes[i]); } }, /* Method: eachAdjacency Iterates over <Graph.Node> adjacencies applying the *action* function. Also implemented by: <Graph.Node>. Parameters: node - (object) A <Graph.Node>. action - (function) A callback function having <Graph.Adjacence> as first formal parameter. Example: (start code js) $jit.Graph.Util.eachAdjacency(node, function(adj) { alert(adj.nodeTo.name); }); //or... node.eachAdjacency(function(adj) { alert(adj.nodeTo.name); }); (end code) */ eachAdjacency: function(node, action, flags) { var adj = node.adjacencies, filter = this.filter(flags); for(var id in adj) { var a = adj[id]; if(filter(a)) { if(a.nodeFrom != node) { var tmp = a.nodeFrom; a.nodeFrom = a.nodeTo; a.nodeTo = tmp; } action(a, id); } } }, /* Method: computeLevels Performs a BFS traversal setting the correct depth for each node. Also implemented by: <Graph>. Note: The depth of each node can then be accessed by >node._depth Parameters: graph - (object) A <Graph>. id - (string) A starting node id for the BFS traversal. startDepth - (optional|number) A minimum depth value. Default's 0. */ computeLevels: function(graph, id, startDepth, flags) { startDepth = startDepth || 0; var filter = this.filter(flags); this.eachNode(graph, function(elem) { elem._flag = false; elem._depth = -1; }, flags); var root = graph.getNode(id); root._depth = startDepth; var queue = [root]; while(queue.length != 0) { var node = queue.pop(); node._flag = true; this.eachAdjacency(node, function(adj) { var n = adj.nodeTo; if(n._flag == false && filter(n)) { if(n._depth < 0) n._depth = node._depth + 1 + startDepth; queue.unshift(n); } }, flags); } }, /* Method: eachBFS Performs a BFS traversal applying *action* to each <Graph.Node>. Also implemented by: <Graph>. Parameters: graph - (object) A <Graph>. id - (string) A starting node id for the BFS traversal. action - (function) A callback function having a <Graph.Node> as first formal parameter. Example: (start code js) $jit.Graph.Util.eachBFS(graph, 'mynodeid', function(node) { alert(node.name); }); //or... graph.eachBFS('mynodeid', function(node) { alert(node.name); }); (end code) */ eachBFS: function(graph, id, action, flags) { var filter = this.filter(flags); this.clean(graph); var queue = [graph.getNode(id)]; while(queue.length != 0) { var node = queue.pop(); node._flag = true; action(node, node._depth); this.eachAdjacency(node, function(adj) { var n = adj.nodeTo; if(n._flag == false && filter(n)) { n._flag = true; queue.unshift(n); } }, flags); } }, /* Method: eachLevel Iterates over a node's subgraph applying *action* to the nodes of relative depth between *levelBegin* and *levelEnd*. Also implemented by: <Graph.Node>. Parameters: node - (object) A <Graph.Node>. levelBegin - (number) A relative level value. levelEnd - (number) A relative level value. action - (function) A callback function having a <Graph.Node> as first formal parameter. */ eachLevel: function(node, levelBegin, levelEnd, action, flags) { var d = node._depth, filter = this.filter(flags), that = this; levelEnd = levelEnd === false? Number.MAX_VALUE -d : levelEnd; (function loopLevel(node, levelBegin, levelEnd) { var d = node._depth; if(d >= levelBegin && d <= levelEnd && filter(node)) action(node, d); if(d < levelEnd) { that.eachAdjacency(node, function(adj) { var n = adj.nodeTo; if(n._depth > d) loopLevel(n, levelBegin, levelEnd); }); } })(node, levelBegin + d, levelEnd + d); }, /* Method: eachSubgraph Iterates over a node's children recursively. Also implemented by: <Graph.Node>. Parameters: node - (object) A <Graph.Node>. action - (function) A callback function having a <Graph.Node> as first formal parameter. Example: (start code js) $jit.Graph.Util.eachSubgraph(node, function(node) { alert(node.name); }); //or... node.eachSubgraph(function(node) { alert(node.name); }); (end code) */ eachSubgraph: function(node, action, flags) { this.eachLevel(node, 0, false, action, flags); }, /* Method: eachSubnode Iterates over a node's children (without deeper recursion). Also implemented by: <Graph.Node>. Parameters: node - (object) A <Graph.Node>. action - (function) A callback function having a <Graph.Node> as first formal parameter. Example: (start code js) $jit.Graph.Util.eachSubnode(node, function(node) { alert(node.name); }); //or... node.eachSubnode(function(node) { alert(node.name); }); (end code) */ eachSubnode: function(node, action, flags) { this.eachLevel(node, 1, 1, action, flags); }, /* Method: anySubnode Returns *true* if any subnode matches the given condition. Also implemented by: <Graph.Node>. Parameters: node - (object) A <Graph.Node>. cond - (function) A callback function returning a Boolean instance. This function has as first formal parameter a <Graph.Node>. Example: (start code js) $jit.Graph.Util.anySubnode(node, function(node) { return node.name == "mynodename"; }); //or... node.anySubnode(function(node) { return node.name == 'mynodename'; }); (end code) */ anySubnode: function(node, cond, flags) { var flag = false; cond = cond || $.lambda(true); var c = $.type(cond) == 'string'? function(n) { return n[cond]; } : cond; this.eachSubnode(node, function(elem) { if(c(elem)) flag = true; }, flags); return flag; }, /* Method: getSubnodes Collects all subnodes for a specified node. The *level* parameter filters nodes having relative depth of *level* from the root node. Also implemented by: <Graph.Node>. Parameters: node - (object) A <Graph.Node>. level - (optional|number) Default's *0*. A starting relative depth for collecting nodes. Returns: An array of nodes. */ getSubnodes: function(node, level, flags) { var ans = [], that = this; level = level || 0; var levelStart, levelEnd; if($.type(level) == 'array') { levelStart = level[0]; levelEnd = level[1]; } else { levelStart = level; levelEnd = Number.MAX_VALUE - node._depth; } this.eachLevel(node, levelStart, levelEnd, function(n) { ans.push(n); }, flags); return ans; }, /* Method: getParents Returns an Array of <Graph.Nodes> which are parents of the given node. Also implemented by: <Graph.Node>. Parameters: node - (object) A <Graph.Node>. Returns: An Array of <Graph.Nodes>. Example: (start code js) var pars = $jit.Graph.Util.getParents(node); //or... var pars = node.getParents(); if(pars.length > 0) { //do stuff with parents } (end code) */ getParents: function(node) { var ans = []; this.eachAdjacency(node, function(adj) { var n = adj.nodeTo; if(n._depth < node._depth) ans.push(n); }); return ans; }, /* Method: isDescendantOf Returns a boolean indicating if some node is descendant of the node with the given id. Also implemented by: <Graph.Node>. Parameters: node - (object) A <Graph.Node>. id - (string) A <Graph.Node> id. Example: (start code js) $jit.Graph.Util.isDescendantOf(node, "nodeid"); //true|false //or... node.isDescendantOf('nodeid');//true|false (end code) */ isDescendantOf: function(node, id) { if(node.id == id) return true; var pars = this.getParents(node), ans = false; for ( var i = 0; !ans && i < pars.length; i++) { ans = ans || this.isDescendantOf(pars[i], id); } return ans; }, /* Method: clean Cleans flags from nodes. Also implemented by: <Graph>. Parameters: graph - A <Graph> instance. */ clean: function(graph) { this.eachNode(graph, function(elem) { elem._flag = false; }); }, /* Method: getClosestNodeToOrigin Returns the closest node to the center of canvas. Also implemented by: <Graph>. Parameters: graph - (object) A <Graph> instance. prop - (optional|string) Default's 'current'. A <Graph.Node> position property. Possible properties are 'start', 'current' or 'end'. */ getClosestNodeToOrigin: function(graph, prop, flags) { return this.getClosestNodeToPos(graph, Polar.KER, prop, flags); }, /* Method: getClosestNodeToPos Returns the closest node to the given position. Also implemented by: <Graph>. Parameters: graph - (object) A <Graph> instance. pos - (object) A <Complex> or <Polar> instance. prop - (optional|string) Default's *current*. A <Graph.Node> position property. Possible properties are 'start', 'current' or 'end'. */ getClosestNodeToPos: function(graph, pos, prop, flags) { var node = null; prop = prop || 'current'; pos = pos && pos.getc(true) || Complex.KER; var distance = function(a, b) { var d1 = a.x - b.x, d2 = a.y - b.y; return d1 * d1 + d2 * d2; }; this.eachNode(graph, function(elem) { node = (node == null || distance(elem.getPos(prop).getc(true), pos) < distance( node.getPos(prop).getc(true), pos)) ? elem : node; }, flags); return node; } }; //Append graph methods to <Graph> $.each(['getNode', 'eachNode', 'computeLevels', 'eachBFS', 'clean', 'getClosestNodeToPos', 'getClosestNodeToOrigin'], function(m) { Graph.prototype[m] = function() { return Graph.Util[m].apply(Graph.Util, [this].concat(Array.prototype.slice.call(arguments))); }; }); //Append node methods to <Graph.Node> $.each(['eachAdjacency', 'eachLevel', 'eachSubgraph', 'eachSubnode', 'anySubnode', 'getSubnodes', 'getParents', 'isDescendantOf'], function(m) { Graph.Node.prototype[m] = function() { return Graph.Util[m].apply(Graph.Util, [this].concat(Array.prototype.slice.call(arguments))); }; }); /* * File: Graph.Op.js * */ /* Object: Graph.Op Perform <Graph> operations like adding/removing <Graph.Nodes> or <Graph.Adjacences>, morphing a <Graph> into another <Graph>, contracting or expanding subtrees, etc. */ Graph.Op = { options: { type: 'nothing', duration: 2000, hideLabels: true, fps:30 }, initialize: function(viz) { this.viz = viz; }, /* Method: removeNode Removes one or more <Graph.Nodes> from the visualization. It can also perform several animations like fading sequentially, fading concurrently, iterating or replotting. Parameters: node - (string|array) The node's id. Can also be an array having many ids. opt - (object) Animation options. It's an object with optional properties described below type - (string) Default's *nothing*. Type of the animation. Can be "nothing", "replot", "fade:seq", "fade:con" or "iter". duration - Described in <Options.Fx>. fps - Described in <Options.Fx>. transition - Described in <Options.Fx>. hideLabels - (boolean) Default's *true*. Hide labels during the animation. Example: (start code js) var viz = new $jit.Viz(options); viz.op.removeNode('nodeId', { type: 'fade:seq', duration: 1000, hideLabels: false, transition: $jit.Trans.Quart.easeOut }); //or also viz.op.removeNode(['someId', 'otherId'], { type: 'fade:con', duration: 1500 }); (end code) */ removeNode: function(node, opt) { var viz = this.viz; var options = $.merge(this.options, viz.controller, opt); var n = $.splat(node); var i, that, nodeObj; switch(options.type) { case 'nothing': for(i=0; i<n.length; i++) viz.graph.removeNode(n[i]); break; case 'replot': this.removeNode(n, { type: 'nothing' }); viz.labels.clearLabels(); viz.refresh(true); break; case 'fade:seq': case 'fade': that = this; //set alpha to 0 for nodes to remove. for(i=0; i<n.length; i++) { nodeObj = viz.graph.getNode(n[i]); nodeObj.setData('alpha', 0, 'end'); } viz.fx.animate($.merge(options, { modes: ['node-property:alpha'], onComplete: function() { that.removeNode(n, { type: 'nothing' }); viz.labels.clearLabels(); viz.reposition(); viz.fx.animate($.merge(options, { modes: ['linear'] })); } })); break; case 'fade:con': that = this; //set alpha to 0 for nodes to remove. Tag them for being ignored on computing positions. for(i=0; i<n.length; i++) { nodeObj = viz.graph.getNode(n[i]); nodeObj.setData('alpha', 0, 'end'); nodeObj.ignore = true; } viz.reposition(); viz.fx.animate($.merge(options, { modes: ['node-property:alpha', 'linear'], onComplete: function() { that.removeNode(n, { type: 'nothing' }); } })); break; case 'iter': that = this; viz.fx.sequence({ condition: function() { return n.length != 0; }, step: function() { that.removeNode(n.shift(), { type: 'nothing' }); viz.labels.clearLabels(); }, onComplete: function() { options.onComplete(); }, duration: Math.ceil(options.duration / n.length) }); break; default: this.doError(); } }, /* Method: removeEdge Removes one or more <Graph.Adjacences> from the visualization. It can also perform several animations like fading sequentially, fading concurrently, iterating or replotting. Parameters: vertex - (array) An array having two strings which are the ids of the nodes connected by this edge (i.e ['id1', 'id2']). Can also be a two dimensional array holding many edges (i.e [['id1', 'id2'], ['id3', 'id4'], ...]). opt - (object) Animation options. It's an object with optional properties described below type - (string) Default's *nothing*. Type of the animation. Can be "nothing", "replot", "fade:seq", "fade:con" or "iter". duration - Described in <Options.Fx>. fps - Described in <Options.Fx>. transition - Described in <Options.Fx>. hideLabels - (boolean) Default's *true*. Hide labels during the animation. Example: (start code js) var viz = new $jit.Viz(options); viz.op.removeEdge(['nodeId', 'otherId'], { type: 'fade:seq', duration: 1000, hideLabels: false, transition: $jit.Trans.Quart.easeOut }); //or also viz.op.removeEdge([['someId', 'otherId'], ['id3', 'id4']], { type: 'fade:con', duration: 1500 }); (end code) */ removeEdge: function(vertex, opt) { var viz = this.viz; var options = $.merge(this.options, viz.controller, opt); var v = ($.type(vertex[0]) == 'string')? [vertex] : vertex; var i, that, adj; switch(options.type) { case 'nothing': for(i=0; i<v.length; i++) viz.graph.removeAdjacence(v[i][0], v[i][1]); break; case 'replot': this.removeEdge(v, { type: 'nothing' }); viz.refresh(true); break; case 'fade:seq': case 'fade': that = this; //set alpha to 0 for edges to remove. for(i=0; i<v.length; i++) { adj = viz.graph.getAdjacence(v[i][0], v[i][1]); if(adj) { adj.setData('alpha', 0,'end'); } } viz.fx.animate($.merge(options, { modes: ['edge-property:alpha'], onComplete: function() { that.removeEdge(v, { type: 'nothing' }); viz.reposition(); viz.fx.animate($.merge(options, { modes: ['linear'] })); } })); break; case 'fade:con': that = this; //set alpha to 0 for nodes to remove. Tag them for being ignored when computing positions. for(i=0; i<v.length; i++) { adj = viz.graph.getAdjacence(v[i][0], v[i][1]); if(adj) { adj.setData('alpha',0 ,'end'); adj.ignore = true; } } viz.reposition(); viz.fx.animate($.merge(options, { modes: ['edge-property:alpha', 'linear'], onComplete: function() { that.removeEdge(v, { type: 'nothing' }); } })); break; case 'iter': that = this; viz.fx.sequence({ condition: function() { return v.length != 0; }, step: function() { that.removeEdge(v.shift(), { type: 'nothing' }); viz.labels.clearLabels(); }, onComplete: function() { options.onComplete(); }, duration: Math.ceil(options.duration / v.length) }); break; default: this.doError(); } }, /* Method: sum Adds a new graph to the visualization. The JSON graph (or tree) must at least have a common node with the current graph plotted by the visualization. The resulting graph can be defined as follows <http://mathworld.wolfram.com/GraphSum.html> Parameters: json - (object) A json tree or graph structure. See also <Loader.loadJSON>. opt - (object) Animation options. It's an object with optional properties described below type - (string) Default's *nothing*. Type of the animation. Can be "nothing", "replot", "fade:seq", "fade:con". duration - Described in <Options.Fx>. fps - Described in <Options.Fx>. transition - Described in <Options.Fx>. hideLabels - (boolean) Default's *true*. Hide labels during the animation. Example: (start code js) //...json contains a tree or graph structure... var viz = new $jit.Viz(options); viz.op.sum(json, { type: 'fade:seq', duration: 1000, hideLabels: false, transition: $jit.Trans.Quart.easeOut }); //or also viz.op.sum(json, { type: 'fade:con', duration: 1500 }); (end code) */ sum: function(json, opt) { var viz = this.viz; var options = $.merge(this.options, viz.controller, opt), root = viz.root; var graph; viz.root = opt.id || viz.root; switch(options.type) { case 'nothing': graph = viz.construct(json); graph.eachNode(function(elem) { elem.eachAdjacency(function(adj) { viz.graph.addAdjacence(adj.nodeFrom, adj.nodeTo, adj.data); }); }); break; case 'replot': viz.refresh(true); this.sum(json, { type: 'nothing' }); viz.refresh(true); break; case 'fade:seq': case 'fade': case 'fade:con': that = this; graph = viz.construct(json); //set alpha to 0 for nodes to add. var fadeEdges = this.preprocessSum(graph); var modes = !fadeEdges? ['node-property:alpha'] : ['node-property:alpha', 'edge-property:alpha']; viz.reposition(); if(options.type != 'fade:con') { viz.fx.animate($.merge(options, { modes: ['linear'], onComplete: function() { viz.fx.animate($.merge(options, { modes: modes, onComplete: function() { options.onComplete(); } })); } })); } else { viz.graph.eachNode(function(elem) { if (elem.id != root && elem.pos.getp().equals(Polar.KER)) { elem.pos.set(elem.endPos); elem.startPos.set(elem.endPos); } }); viz.fx.animate($.merge(options, { modes: ['linear'].concat(modes) })); } break; default: this.doError(); } }, /* Method: morph This method will transform the current visualized graph into the new JSON representation passed in the method. The JSON object must at least have the root node in common with the current visualized graph. Parameters: json - (object) A json tree or graph structure. See also <Loader.loadJSON>. opt - (object) Animation options. It's an object with optional properties described below type - (string) Default's *nothing*. Type of the animation. Can be "nothing", "replot", "fade:con". duration - Described in <Options.Fx>. fps - Described in <Options.Fx>. transition - Described in <Options.Fx>. hideLabels - (boolean) Default's *true*. Hide labels during the animation. id - (string) The shared <Graph.Node> id between both graphs. extraModes - (optional|object) When morphing with an animation, dollar prefixed data parameters are added to *endData* and not *data* itself. This way you can animate dollar prefixed parameters during your morphing operation. For animating these extra-parameters you have to specify an object that has animation groups as keys and animation properties as values, just like specified in <Graph.Plot.animate>. Example: (start code js) //...json contains a tree or graph structure... var viz = new $jit.Viz(options); viz.op.morph(json, { type: 'fade', duration: 1000, hideLabels: false, transition: $jit.Trans.Quart.easeOut }); //or also viz.op.morph(json, { type: 'fade', duration: 1500 }); //if the json data contains dollar prefixed params //like $width or $height these too can be animated viz.op.morph(json, { type: 'fade', duration: 1500 }, { 'node-property': ['width', 'height'] }); (end code) */ morph: function(json, opt, extraModes) { var viz = this.viz; var options = $.merge(this.options, viz.controller, opt), root = viz.root; var graph; //TODO(nico) this hack makes morphing work with the Hypertree. //Need to check if it has been solved and this can be removed. viz.root = opt.id || viz.root; switch(options.type) { case 'nothing': graph = viz.construct(json); graph.eachNode(function(elem) { var nodeExists = viz.graph.hasNode(elem.id); elem.eachAdjacency(function(adj) { var adjExists = !!viz.graph.getAdjacence(adj.nodeFrom.id, adj.nodeTo.id); viz.graph.addAdjacence(adj.nodeFrom, adj.nodeTo, adj.data); //Update data properties if the node existed if(adjExists) { var addedAdj = viz.graph.getAdjacence(adj.nodeFrom.id, adj.nodeTo.id); for(var prop in (adj.data || {})) { addedAdj.data[prop] = adj.data[prop]; } } }); //Update data properties if the node existed if(nodeExists) { var addedNode = viz.graph.getNode(elem.id); for(var prop in (elem.data || {})) { addedNode.data[prop] = elem.data[prop]; } } }); viz.graph.eachNode(function(elem) { elem.eachAdjacency(function(adj) { if(!graph.getAdjacence(adj.nodeFrom.id, adj.nodeTo.id)) { viz.graph.removeAdjacence(adj.nodeFrom.id, adj.nodeTo.id); } }); if(!graph.hasNode(elem.id)) viz.graph.removeNode(elem.id); }); break; case 'replot': viz.labels.clearLabels(true); this.morph(json, { type: 'nothing' }); viz.refresh(true); viz.refresh(true); break; case 'fade:seq': case 'fade': case 'fade:con': that = this; graph = viz.construct(json); //preprocessing for nodes to delete. //get node property modes to interpolate var nodeModes = extraModes && ('node-property' in extraModes) && $.map($.splat(extraModes['node-property']), function(n) { return '$' + n; }); viz.graph.eachNode(function(elem) { var graphNode = graph.getNode(elem.id); if(!graphNode) { elem.setData('alpha', 1); elem.setData('alpha', 1, 'start'); elem.setData('alpha', 0, 'end'); elem.ignore = true; } else { //Update node data information var graphNodeData = graphNode.data; for(var prop in graphNodeData) { if(nodeModes && ($.indexOf(nodeModes, prop) > -1)) { elem.endData[prop] = graphNodeData[prop]; } else { elem.data[prop] = graphNodeData[prop]; } } } }); viz.graph.eachNode(function(elem) { if(elem.ignore) return; elem.eachAdjacency(function(adj) { if(adj.nodeFrom.ignore || adj.nodeTo.ignore) return; var nodeFrom = graph.getNode(adj.nodeFrom.id); var nodeTo = graph.getNode(adj.nodeTo.id); if(!nodeFrom.adjacentTo(nodeTo)) { var adj = viz.graph.getAdjacence(nodeFrom.id, nodeTo.id); fadeEdges = true; adj.setData('alpha', 1); adj.setData('alpha', 1, 'start'); adj.setData('alpha', 0, 'end'); } }); }); //preprocessing for adding nodes. var fadeEdges = this.preprocessSum(graph); var modes = !fadeEdges? ['node-property:alpha'] : ['node-property:alpha', 'edge-property:alpha']; //Append extra node-property animations (if any) modes[0] = modes[0] + ((extraModes && ('node-property' in extraModes))? (':' + $.splat(extraModes['node-property']).join(':')) : ''); //Append extra edge-property animations (if any) modes[1] = (modes[1] || 'edge-property:alpha') + ((extraModes && ('edge-property' in extraModes))? (':' + $.splat(extraModes['edge-property']).join(':')) : ''); //Add label-property animations (if any) if(extraModes && ('label-property' in extraModes)) { modes.push('label-property:' + $.splat(extraModes['label-property']).join(':')) } viz.reposition(); viz.graph.eachNode(function(elem) { if (elem.id != root && elem.pos.getp().equals(Polar.KER)) { elem.pos.set(elem.endPos); elem.startPos.set(elem.endPos); } }); viz.fx.animate($.merge(options, { modes: ['polar'].concat(modes), onComplete: function() { viz.graph.eachNode(function(elem) { if(elem.ignore) viz.graph.removeNode(elem.id); }); viz.graph.eachNode(function(elem) { elem.eachAdjacency(function(adj) { if(adj.ignore) viz.graph.removeAdjacence(adj.nodeFrom.id, adj.nodeTo.id); }); }); options.onComplete(); } })); break; default:; } }, /* Method: contract Collapses the subtree of the given node. The node will have a _collapsed=true_ property. Parameters: node - (object) A <Graph.Node>. opt - (object) An object containing options described below type - (string) Whether to 'replot' or 'animate' the contraction. There are also a number of Animation options. For more information see <Options.Fx>. Example: (start code js) var viz = new $jit.Viz(options); viz.op.contract(node, { type: 'animate', duration: 1000, hideLabels: true, transition: $jit.Trans.Quart.easeOut }); (end code) */ contract: function(node, opt) { var viz = this.viz; if(node.collapsed || !node.anySubnode($.lambda(true))) return; opt = $.merge(this.options, viz.config, opt || {}, { 'modes': ['node-property:alpha:span', 'linear'] }); node.collapsed = true; (function subn(n) { n.eachSubnode(function(ch) { ch.ignore = true; ch.setData('alpha', 0, opt.type == 'animate'? 'end' : 'current'); subn(ch); }); })(node); if(opt.type == 'animate') { viz.compute('end'); if(viz.rotated) { viz.rotate(viz.rotated, 'none', { 'property':'end' }); } (function subn(n) { n.eachSubnode(function(ch) { ch.setPos(node.getPos('end'), 'end'); subn(ch); }); })(node); viz.fx.animate(opt); } else if(opt.type == 'replot'){ viz.refresh(); } }, /* Method: expand Expands the previously contracted subtree. The given node must have the _collapsed=true_ property. Parameters: node - (object) A <Graph.Node>. opt - (object) An object containing options described below type - (string) Whether to 'replot' or 'animate'. There are also a number of Animation options. For more information see <Options.Fx>. Example: (start code js) var viz = new $jit.Viz(options); viz.op.expand(node, { type: 'animate', duration: 1000, hideLabels: true, transition: $jit.Trans.Quart.easeOut }); (end code) */ expand: function(node, opt) { if(!('collapsed' in node)) return; var viz = this.viz; opt = $.merge(this.options, viz.config, opt || {}, { 'modes': ['node-property:alpha:span', 'linear'] }); delete node.collapsed; (function subn(n) { n.eachSubnode(function(ch) { delete ch.ignore; ch.setData('alpha', 1, opt.type == 'animate'? 'end' : 'current'); subn(ch); }); })(node); if(opt.type == 'animate') { viz.compute('end'); if(viz.rotated) { viz.rotate(viz.rotated, 'none', { 'property':'end' }); } viz.fx.animate(opt); } else if(opt.type == 'replot'){ viz.refresh(); } }, preprocessSum: function(graph) { var viz = this.viz; graph.eachNode(function(elem) { if(!viz.graph.hasNode(elem.id)) { viz.graph.addNode(elem); var n = viz.graph.getNode(elem.id); n.setData('alpha', 0); n.setData('alpha', 0, 'start'); n.setData('alpha', 1, 'end'); } }); var fadeEdges = false; graph.eachNode(function(elem) { elem.eachAdjacency(function(adj) { var nodeFrom = viz.graph.getNode(adj.nodeFrom.id); var nodeTo = viz.graph.getNode(adj.nodeTo.id); if(!nodeFrom.adjacentTo(nodeTo)) { var adj = viz.graph.addAdjacence(nodeFrom, nodeTo, adj.data); if(nodeFrom.startAlpha == nodeFrom.endAlpha && nodeTo.startAlpha == nodeTo.endAlpha) { fadeEdges = true; adj.setData('alpha', 0); adj.setData('alpha', 0, 'start'); adj.setData('alpha', 1, 'end'); } } }); }); return fadeEdges; } }; /* File: Helpers.js Helpers are objects that contain rendering primitives (like rectangles, ellipses, etc), for plotting nodes and edges. Helpers also contain implementations of the *contains* method, a method returning a boolean indicating whether the mouse position is over the rendered shape. Helpers are very useful when implementing new NodeTypes, since you can access them through *this.nodeHelper* and *this.edgeHelper* <Graph.Plot> properties, providing you with simple primitives and mouse-position check functions. Example: (start code js) //implement a new node type $jit.Viz.Plot.NodeTypes.implement({ 'customNodeType': { 'render': function(node, canvas) { this.nodeHelper.circle.render ... }, 'contains': function(node, pos) { this.nodeHelper.circle.contains ... } } }); //implement an edge type $jit.Viz.Plot.EdgeTypes.implement({ 'customNodeType': { 'render': function(node, canvas) { this.edgeHelper.circle.render ... }, //optional 'contains': function(node, pos) { this.edgeHelper.circle.contains ... } } }); (end code) */ /* Object: NodeHelper Contains rendering and other type of primitives for simple shapes. */ var NodeHelper = { 'none': { 'render': $.empty, 'contains': $.lambda(false) }, /* Object: NodeHelper.circle */ 'circle': { /* Method: render Renders a circle into the canvas. Parameters: type - (string) Possible options are 'fill' or 'stroke'. pos - (object) An *x*, *y* object with the position of the center of the circle. radius - (number) The radius of the circle to be rendered. canvas - (object) A <Canvas> instance. Example: (start code js) NodeHelper.circle.render('fill', { x: 10, y: 30 }, 30, viz.canvas); (end code) */ 'render': function(type, pos, radius, canvas){ var ctx = canvas.getCtx(); ctx.beginPath(); ctx.arc(pos.x, pos.y, radius, 0, Math.PI * 2, true); ctx.closePath(); ctx[type](); }, /* Method: contains Returns *true* if *pos* is contained in the area of the shape. Returns *false* otherwise. Parameters: npos - (object) An *x*, *y* object with the <Graph.Node> position. pos - (object) An *x*, *y* object with the position to check. radius - (number) The radius of the rendered circle. Example: (start code js) NodeHelper.circle.contains({ x: 10, y: 30 }, { x: 15, y: 35 }, 30); //true (end code) */ 'contains': function(npos, pos, radius){ var diffx = npos.x - pos.x, diffy = npos.y - pos.y, diff = diffx * diffx + diffy * diffy; return diff <= radius * radius; } }, /* Object: NodeHelper.ellipse */ 'ellipse': { /* Method: render Renders an ellipse into the canvas. Parameters: type - (string) Possible options are 'fill' or 'stroke'. pos - (object) An *x*, *y* object with the position of the center of the ellipse. width - (number) The width of the ellipse. height - (number) The height of the ellipse. canvas - (object) A <Canvas> instance. Example: (start code js) NodeHelper.ellipse.render('fill', { x: 10, y: 30 }, 30, 40, viz.canvas); (end code) */ 'render': function(type, pos, width, height, canvas){ var ctx = canvas.getCtx(); height /= 2; width /= 2; ctx.save(); ctx.scale(width / height, height / width); ctx.beginPath(); ctx.arc(pos.x * (height / width), pos.y * (width / height), height, 0, Math.PI * 2, true); ctx.closePath(); ctx[type](); ctx.restore(); }, /* Method: contains Returns *true* if *pos* is contained in the area of the shape. Returns *false* otherwise. Parameters: npos - (object) An *x*, *y* object with the <Graph.Node> position. pos - (object) An *x*, *y* object with the position to check. width - (number) The width of the rendered ellipse. height - (number) The height of the rendered ellipse. Example: (start code js) NodeHelper.ellipse.contains({ x: 10, y: 30 }, { x: 15, y: 35 }, 30, 40); (end code) */ 'contains': function(npos, pos, width, height){ // TODO(nico): be more precise... width /= 2; height /= 2; var dist = (width + height) / 2, diffx = npos.x - pos.x, diffy = npos.y - pos.y, diff = diffx * diffx + diffy * diffy; return diff <= dist * dist; } }, /* Object: NodeHelper.square */ 'square': { /* Method: render Renders a square into the canvas. Parameters: type - (string) Possible options are 'fill' or 'stroke'. pos - (object) An *x*, *y* object with the position of the center of the square. dim - (number) The radius (or half-diameter) of the square. canvas - (object) A <Canvas> instance. Example: (start code js) NodeHelper.square.render('stroke', { x: 10, y: 30 }, 40, viz.canvas); (end code) */ 'render': function(type, pos, dim, canvas){ canvas.getCtx()[type + "Rect"](pos.x - dim, pos.y - dim, 2*dim, 2*dim); }, /* Method: contains Returns *true* if *pos* is contained in the area of the shape. Returns *false* otherwise. Parameters: npos - (object) An *x*, *y* object with the <Graph.Node> position. pos - (object) An *x*, *y* object with the position to check. dim - (number) The radius (or half-diameter) of the square. Example: (start code js) NodeHelper.square.contains({ x: 10, y: 30 }, { x: 15, y: 35 }, 30); (end code) */ 'contains': function(npos, pos, dim){ return Math.abs(pos.x - npos.x) <= dim && Math.abs(pos.y - npos.y) <= dim; } }, /* Object: NodeHelper.rectangle */ 'rectangle': { /* Method: render Renders a rectangle into the canvas. Parameters: type - (string) Possible options are 'fill' or 'stroke'. pos - (object) An *x*, *y* object with the position of the center of the rectangle. width - (number) The width of the rectangle. height - (number) The height of the rectangle. canvas - (object) A <Canvas> instance. Example: (start code js) NodeHelper.rectangle.render('fill', { x: 10, y: 30 }, 30, 40, viz.canvas); (end code) */ 'render': function(type, pos, width, height, canvas){ canvas.getCtx()[type + "Rect"](pos.x - width / 2, pos.y - height / 2, width, height); }, /* Method: contains Returns *true* if *pos* is contained in the area of the shape. Returns *false* otherwise. Parameters: npos - (object) An *x*, *y* object with the <Graph.Node> position. pos - (object) An *x*, *y* object with the position to check. width - (number) The width of the rendered rectangle. height - (number) The height of the rendered rectangle. Example: (start code js) NodeHelper.rectangle.contains({ x: 10, y: 30 }, { x: 15, y: 35 }, 30, 40); (end code) */ 'contains': function(npos, pos, width, height){ return Math.abs(pos.x - npos.x) <= width / 2 && Math.abs(pos.y - npos.y) <= height / 2; } }, /* Object: NodeHelper.triangle */ 'triangle': { /* Method: render Renders a triangle into the canvas. Parameters: type - (string) Possible options are 'fill' or 'stroke'. pos - (object) An *x*, *y* object with the position of the center of the triangle. dim - (number) The dimension of the triangle. canvas - (object) A <Canvas> instance. Example: (start code js) NodeHelper.triangle.render('stroke', { x: 10, y: 30 }, 40, viz.canvas); (end code) */ 'render': function(type, pos, dim, canvas){ var ctx = canvas.getCtx(), c1x = pos.x, c1y = pos.y - dim, c2x = c1x - dim, c2y = pos.y + dim, c3x = c1x + dim, c3y = c2y; ctx.beginPath(); ctx.moveTo(c1x, c1y); ctx.lineTo(c2x, c2y); ctx.lineTo(c3x, c3y); ctx.closePath(); ctx[type](); }, /* Method: contains Returns *true* if *pos* is contained in the area of the shape. Returns *false* otherwise. Parameters: npos - (object) An *x*, *y* object with the <Graph.Node> position. pos - (object) An *x*, *y* object with the position to check. dim - (number) The dimension of the shape. Example: (start code js) NodeHelper.triangle.contains({ x: 10, y: 30 }, { x: 15, y: 35 }, 30); (end code) */ 'contains': function(npos, pos, dim) { return NodeHelper.circle.contains(npos, pos, dim); } }, /* Object: NodeHelper.star */ 'star': { /* Method: render Renders a star into the canvas. Parameters: type - (string) Possible options are 'fill' or 'stroke'. pos - (object) An *x*, *y* object with the position of the center of the star. dim - (number) The dimension of the star. canvas - (object) A <Canvas> instance. Example: (start code js) NodeHelper.star.render('stroke', { x: 10, y: 30 }, 40, viz.canvas); (end code) */ 'render': function(type, pos, dim, canvas){ var ctx = canvas.getCtx(), pi5 = Math.PI / 5; ctx.save(); ctx.translate(pos.x, pos.y); ctx.beginPath(); ctx.moveTo(dim, 0); for (var i = 0; i < 9; i++) { ctx.rotate(pi5); if (i % 2 == 0) { ctx.lineTo((dim / 0.525731) * 0.200811, 0); } else { ctx.lineTo(dim, 0); } } ctx.closePath(); ctx[type](); ctx.restore(); }, /* Method: contains Returns *true* if *pos* is contained in the area of the shape. Returns *false* otherwise. Parameters: npos - (object) An *x*, *y* object with the <Graph.Node> position. pos - (object) An *x*, *y* object with the position to check. dim - (number) The dimension of the shape. Example: (start code js) NodeHelper.star.contains({ x: 10, y: 30 }, { x: 15, y: 35 }, 30); (end code) */ 'contains': function(npos, pos, dim) { return NodeHelper.circle.contains(npos, pos, dim); } } }; /* Object: EdgeHelper Contains rendering primitives for simple edge shapes. */ var EdgeHelper = { /* Object: EdgeHelper.line */ 'line': { /* Method: render Renders a line into the canvas. Parameters: from - (object) An *x*, *y* object with the starting position of the line. to - (object) An *x*, *y* object with the ending position of the line. canvas - (object) A <Canvas> instance. Example: (start code js) EdgeHelper.line.render({ x: 10, y: 30 }, { x: 10, y: 50 }, viz.canvas); (end code) */ 'render': function(from, to, canvas){ var ctx = canvas.getCtx(); ctx.beginPath(); ctx.moveTo(from.x, from.y); ctx.lineTo(to.x, to.y); ctx.stroke(); }, /* Method: contains Returns *true* if *pos* is contained in the area of the shape. Returns *false* otherwise. Parameters: posFrom - (object) An *x*, *y* object with a <Graph.Node> position. posTo - (object) An *x*, *y* object with a <Graph.Node> position. pos - (object) An *x*, *y* object with the position to check. epsilon - (number) The dimension of the shape. Example: (start code js) EdgeHelper.line.contains({ x: 10, y: 30 }, { x: 15, y: 35 }, { x: 15, y: 35 }, 30); (end code) */ 'contains': function(posFrom, posTo, pos, epsilon) { var min = Math.min, max = Math.max, minPosX = min(posFrom.x, posTo.x), maxPosX = max(posFrom.x, posTo.x), minPosY = min(posFrom.y, posTo.y), maxPosY = max(posFrom.y, posTo.y); if(pos.x >= minPosX && pos.x <= maxPosX && pos.y >= minPosY && pos.y <= maxPosY) { if(Math.abs(posTo.x - posFrom.x) <= epsilon) { return true; } var dist = (posTo.y - posFrom.y) / (posTo.x - posFrom.x) * (pos.x - posFrom.x) + posFrom.y; return Math.abs(dist - pos.y) <= epsilon; } return false; } }, /* Object: EdgeHelper.arrow */ 'arrow': { /* Method: render Renders an arrow into the canvas. Parameters: from - (object) An *x*, *y* object with the starting position of the arrow. to - (object) An *x*, *y* object with the ending position of the arrow. dim - (number) The dimension of the arrow. swap - (boolean) Whether to set the arrow pointing to the starting position or the ending position. canvas - (object) A <Canvas> instance. Example: (start code js) EdgeHelper.arrow.render({ x: 10, y: 30 }, { x: 10, y: 50 }, 13, false, viz.canvas); (end code) */ 'render': function(from, to, dim, swap, canvas){ var ctx = canvas.getCtx(); // invert edge direction if (swap) { var tmp = from; from = to; to = tmp; } var vect = new Complex(to.x - from.x, to.y - from.y); vect.$scale(dim / vect.norm()); var intermediatePoint = new Complex(to.x - vect.x, to.y - vect.y), normal = new Complex(-vect.y / 2, vect.x / 2), v1 = intermediatePoint.add(normal), v2 = intermediatePoint.$add(normal.$scale(-1)); ctx.beginPath(); ctx.moveTo(from.x, from.y); ctx.lineTo(to.x, to.y); ctx.stroke(); ctx.beginPath(); ctx.moveTo(v1.x, v1.y); ctx.lineTo(v2.x, v2.y); ctx.lineTo(to.x, to.y); ctx.closePath(); ctx.fill(); }, /* Method: contains Returns *true* if *pos* is contained in the area of the shape. Returns *false* otherwise. Parameters: posFrom - (object) An *x*, *y* object with a <Graph.Node> position. posTo - (object) An *x*, *y* object with a <Graph.Node> position. pos - (object) An *x*, *y* object with the position to check. epsilon - (number) The dimension of the shape. Example: (start code js) EdgeHelper.arrow.contains({ x: 10, y: 30 }, { x: 15, y: 35 }, { x: 15, y: 35 }, 30); (end code) */ 'contains': function(posFrom, posTo, pos, epsilon) { return EdgeHelper.line.contains(posFrom, posTo, pos, epsilon); } }, /* Object: EdgeHelper.hyperline */ 'hyperline': { /* Method: render Renders a hyperline into the canvas. A hyperline are the lines drawn for the <Hypertree> visualization. Parameters: from - (object) An *x*, *y* object with the starting position of the hyperline. *x* and *y* must belong to [0, 1). to - (object) An *x*, *y* object with the ending position of the hyperline. *x* and *y* must belong to [0, 1). r - (number) The scaling factor. canvas - (object) A <Canvas> instance. Example: (start code js) EdgeHelper.hyperline.render({ x: 10, y: 30 }, { x: 10, y: 50 }, 100, viz.canvas); (end code) */ 'render': function(from, to, r, canvas){ var ctx = canvas.getCtx(); var centerOfCircle = computeArcThroughTwoPoints(from, to); if (centerOfCircle.a > 1000 || centerOfCircle.b > 1000 || centerOfCircle.ratio < 0) { ctx.beginPath(); ctx.moveTo(from.x * r, from.y * r); ctx.lineTo(to.x * r, to.y * r); ctx.stroke(); } else { var angleBegin = Math.atan2(to.y - centerOfCircle.y, to.x - centerOfCircle.x); var angleEnd = Math.atan2(from.y - centerOfCircle.y, from.x - centerOfCircle.x); var sense = sense(angleBegin, angleEnd); ctx.beginPath(); ctx.arc(centerOfCircle.x * r, centerOfCircle.y * r, centerOfCircle.ratio * r, angleBegin, angleEnd, sense); ctx.stroke(); } /* Calculates the arc parameters through two points. More information in <http://en.wikipedia.org/wiki/Poincar%C3%A9_disc_model#Analytic_geometry_constructions_in_the_hyperbolic_plane> Parameters: p1 - A <Complex> instance. p2 - A <Complex> instance. scale - The Disk's diameter. Returns: An object containing some arc properties. */ function computeArcThroughTwoPoints(p1, p2){ var aDen = (p1.x * p2.y - p1.y * p2.x), bDen = aDen; var sq1 = p1.squaredNorm(), sq2 = p2.squaredNorm(); // Fall back to a straight line if (aDen == 0) return { x: 0, y: 0, ratio: -1 }; var a = (p1.y * sq2 - p2.y * sq1 + p1.y - p2.y) / aDen; var b = (p2.x * sq1 - p1.x * sq2 + p2.x - p1.x) / bDen; var x = -a / 2; var y = -b / 2; var squaredRatio = (a * a + b * b) / 4 - 1; // Fall back to a straight line if (squaredRatio < 0) return { x: 0, y: 0, ratio: -1 }; var ratio = Math.sqrt(squaredRatio); var out = { x: x, y: y, ratio: ratio > 1000? -1 : ratio, a: a, b: b }; return out; } /* Sets angle direction to clockwise (true) or counterclockwise (false). Parameters: angleBegin - Starting angle for drawing the arc. angleEnd - The HyperLine will be drawn from angleBegin to angleEnd. Returns: A Boolean instance describing the sense for drawing the HyperLine. */ function sense(angleBegin, angleEnd){ return (angleBegin < angleEnd)? ((angleBegin + Math.PI > angleEnd)? false : true) : ((angleEnd + Math.PI > angleBegin)? true : false); } }, /* Method: contains Not Implemented Returns *true* if *pos* is contained in the area of the shape. Returns *false* otherwise. Parameters: posFrom - (object) An *x*, *y* object with a <Graph.Node> position. posTo - (object) An *x*, *y* object with a <Graph.Node> position. pos - (object) An *x*, *y* object with the position to check. epsilon - (number) The dimension of the shape. Example: (start code js) EdgeHelper.hyperline.contains({ x: 10, y: 30 }, { x: 15, y: 35 }, { x: 15, y: 35 }, 30); (end code) */ 'contains': $.lambda(false) } }; /* * File: Graph.Plot.js */ /* Object: Graph.Plot <Graph> rendering and animation methods. Properties: nodeHelper - <NodeHelper> object. edgeHelper - <EdgeHelper> object. */ Graph.Plot = { //Default intializer initialize: function(viz, klass){ this.viz = viz; this.config = viz.config; this.node = viz.config.Node; this.edge = viz.config.Edge; this.animation = new Animation; this.nodeTypes = new klass.Plot.NodeTypes; this.edgeTypes = new klass.Plot.EdgeTypes; this.labels = viz.labels; }, //Add helpers nodeHelper: NodeHelper, edgeHelper: EdgeHelper, Interpolator: { //node/edge property parsers 'map': { 'border': 'color', 'color': 'color', 'width': 'number', 'height': 'number', 'dim': 'number', 'alpha': 'number', 'lineWidth': 'number', 'angularWidth':'number', 'span':'number', 'valueArray':'array-number', 'dimArray':'array-number' //'colorArray':'array-color' }, //canvas specific parsers 'canvas': { 'globalAlpha': 'number', 'fillStyle': 'color', 'strokeStyle': 'color', 'lineWidth': 'number', 'shadowBlur': 'number', 'shadowColor': 'color', 'shadowOffsetX': 'number', 'shadowOffsetY': 'number', 'miterLimit': 'number' }, //label parsers 'label': { 'size': 'number', 'color': 'color' }, //Number interpolator 'compute': function(from, to, delta) { return from + (to - from) * delta; }, //Position interpolators 'moebius': function(elem, props, delta, vector) { var v = vector.scale(-delta); if(v.norm() < 1) { var x = v.x, y = v.y; var ans = elem.startPos .getc().moebiusTransformation(v); elem.pos.setc(ans.x, ans.y); v.x = x; v.y = y; } }, 'linear': function(elem, props, delta) { var from = elem.startPos.getc(true); var to = elem.endPos.getc(true); elem.pos.setc(this.compute(from.x, to.x, delta), this.compute(from.y, to.y, delta)); }, 'polar': function(elem, props, delta) { var from = elem.startPos.getp(true); var to = elem.endPos.getp(); var ans = to.interpolate(from, delta); elem.pos.setp(ans.theta, ans.rho); }, //Graph's Node/Edge interpolators 'number': function(elem, prop, delta, getter, setter) { var from = elem[getter](prop, 'start'); var to = elem[getter](prop, 'end'); elem[setter](prop, this.compute(from, to, delta)); }, 'color': function(elem, prop, delta, getter, setter) { var from = $.hexToRgb(elem[getter](prop, 'start')); var to = $.hexToRgb(elem[getter](prop, 'end')); var comp = this.compute; var val = $.rgbToHex([parseInt(comp(from[0], to[0], delta)), parseInt(comp(from[1], to[1], delta)), parseInt(comp(from[2], to[2], delta))]); elem[setter](prop, val); }, 'array-number': function(elem, prop, delta, getter, setter) { var from = elem[getter](prop, 'start'), to = elem[getter](prop, 'end'), cur = []; for(var i=0, l=from.length; i<l; i++) { var fromi = from[i], toi = to[i]; if(fromi.length) { for(var j=0, len=fromi.length, curi=[]; j<len; j++) { curi.push(this.compute(fromi[j], toi[j], delta)); } cur.push(curi); } else { cur.push(this.compute(fromi, toi, delta)); } } elem[setter](prop, cur); }, 'node': function(elem, props, delta, map, getter, setter) { map = this[map]; if(props) { var len = props.length; for(var i=0; i<len; i++) { var pi = props[i]; this[map[pi]](elem, pi, delta, getter, setter); } } else { for(var pi in map) { this[map[pi]](elem, pi, delta, getter, setter); } } }, 'edge': function(elem, props, delta, mapKey, getter, setter) { var adjs = elem.adjacencies; for(var id in adjs) this['node'](adjs[id], props, delta, mapKey, getter, setter); }, 'node-property': function(elem, props, delta) { this['node'](elem, props, delta, 'map', 'getData', 'setData'); }, 'edge-property': function(elem, props, delta) { this['edge'](elem, props, delta, 'map', 'getData', 'setData'); }, 'label-property': function(elem, props, delta) { this['node'](elem, props, delta, 'label', 'getLabelData', 'setLabelData'); }, 'node-style': function(elem, props, delta) { this['node'](elem, props, delta, 'canvas', 'getCanvasStyle', 'setCanvasStyle'); }, 'edge-style': function(elem, props, delta) { this['edge'](elem, props, delta, 'canvas', 'getCanvasStyle', 'setCanvasStyle'); } }, /* sequence Iteratively performs an action while refreshing the state of the visualization. Parameters: options - (object) An object containing some sequence options described below condition - (function) A function returning a boolean instance in order to stop iterations. step - (function) A function to execute on each step of the iteration. onComplete - (function) A function to execute when the sequence finishes. duration - (number) Duration (in milliseconds) of each step. Example: (start code js) var rg = new $jit.RGraph(options); var i = 0; rg.fx.sequence({ condition: function() { return i == 10; }, step: function() { alert(i++); }, onComplete: function() { alert('done!'); } }); (end code) */ sequence: function(options) { var that = this; options = $.merge({ condition: $.lambda(false), step: $.empty, onComplete: $.empty, duration: 200 }, options || {}); var interval = setInterval(function() { if(options.condition()) { options.step(); } else { clearInterval(interval); options.onComplete(); } that.viz.refresh(true); }, options.duration); }, /* prepare Prepare graph position and other attribute values before performing an Animation. This method is used internally by the Toolkit. See also: <Animation>, <Graph.Plot.animate> */ prepare: function(modes) { var graph = this.viz.graph, accessors = { 'node-property': { 'getter': 'getData', 'setter': 'setData' }, 'edge-property': { 'getter': 'getData', 'setter': 'setData' }, 'node-style': { 'getter': 'getCanvasStyle', 'setter': 'setCanvasStyle' }, 'edge-style': { 'getter': 'getCanvasStyle', 'setter': 'setCanvasStyle' } }; //parse modes var m = {}; if($.type(modes) == 'array') { for(var i=0, len=modes.length; i < len; i++) { var elems = modes[i].split(':'); m[elems.shift()] = elems; } } else { for(var p in modes) { if(p == 'position') { m[modes.position] = []; } else { m[p] = $.splat(modes[p]); } } } graph.eachNode(function(node) { node.startPos.set(node.pos); $.each(['node-property', 'node-style'], function(p) { if(p in m) { var prop = m[p]; for(var i=0, l=prop.length; i < l; i++) { node[accessors[p].setter](prop[i], node[accessors[p].getter](prop[i]), 'start'); } } }); $.each(['edge-property', 'edge-style'], function(p) { if(p in m) { var prop = m[p]; node.eachAdjacency(function(adj) { for(var i=0, l=prop.length; i < l; i++) { adj[accessors[p].setter](prop[i], adj[accessors[p].getter](prop[i]), 'start'); } }); } }); }); return m; }, /* Method: animate Animates a <Graph> by interpolating some <Graph.Node>, <Graph.Adjacence> or <Graph.Label> properties. Parameters: opt - (object) Animation options. The object properties are described below duration - (optional) Described in <Options.Fx>. fps - (optional) Described in <Options.Fx>. hideLabels - (optional|boolean) Whether to hide labels during the animation. modes - (required|object) An object with animation modes (described below). Animation modes: Animation modes are strings representing different node/edge and graph properties that you'd like to animate. They are represented by an object that has as keys main categories of properties to animate and as values a list of these specific properties. The properties are described below position - Describes the way nodes' positions must be interpolated. Possible values are 'linear', 'polar' or 'moebius'. node-property - Describes which Node properties will be interpolated. These properties can be any of the ones defined in <Options.Node>. edge-property - Describes which Edge properties will be interpolated. These properties can be any the ones defined in <Options.Edge>. label-property - Describes which Label properties will be interpolated. These properties can be any of the ones defined in <Options.Label> like color or size. node-style - Describes which Node Canvas Styles will be interpolated. These are specific canvas properties like fillStyle, strokeStyle, lineWidth, shadowBlur, shadowColor, shadowOffsetX, shadowOffsetY, etc. edge-style - Describes which Edge Canvas Styles will be interpolated. These are specific canvas properties like fillStyle, strokeStyle, lineWidth, shadowBlur, shadowColor, shadowOffsetX, shadowOffsetY, etc. Example: (start code js) var viz = new $jit.Viz(options); //...tweak some Data, CanvasStyles or LabelData properties... viz.fx.animate({ modes: { 'position': 'linear', 'node-property': ['width', 'height'], 'node-style': 'shadowColor', 'label-property': 'size' }, hideLabels: false }); //...can also be written like this... viz.fx.animate({ modes: ['linear', 'node-property:width:height', 'node-style:shadowColor', 'label-property:size'], hideLabels: false }); (end code) */ animate: function(opt, versor) { opt = $.merge(this.viz.config, opt || {}); var that = this, viz = this.viz, graph = viz.graph, interp = this.Interpolator, animation = opt.type === 'nodefx'? this.nodeFxAnimation : this.animation; //prepare graph values var m = this.prepare(opt.modes); //animate if(opt.hideLabels) this.labels.hideLabels(true); animation.setOptions($.merge(opt, { $animating: false, compute: function(delta) { graph.eachNode(function(node) { for(var p in m) { interp[p](node, m[p], delta, versor); } }); that.plot(opt, this.$animating, delta); this.$animating = true; }, complete: function() { if(opt.hideLabels) that.labels.hideLabels(false); that.plot(opt); opt.onComplete(); opt.onAfterCompute(); } })).start(); }, /* nodeFx Apply animation to node properties like color, width, height, dim, etc. Parameters: options - Animation options. This object properties is described below elements - The Elements to be transformed. This is an object that has a properties (start code js) 'elements': { //can also be an array of ids 'id': 'id-of-node-to-transform', //properties to be modified. All properties are optional. 'properties': { 'color': '#ccc', //some color 'width': 10, //some width 'height': 10, //some height 'dim': 20, //some dim 'lineWidth': 10 //some line width } } (end code) - _reposition_ Whether to recalculate positions and add a motion animation. This might be used when changing _width_ or _height_ properties in a <Layouts.Tree> like layout. Default's *false*. - _onComplete_ A method that is called when the animation completes. ...and all other <Graph.Plot.animate> options like _duration_, _fps_, _transition_, etc. Example: (start code js) var rg = new RGraph(canvas, config); //can be also Hypertree or ST rg.fx.nodeFx({ 'elements': { 'id':'mynodeid', 'properties': { 'color':'#ccf' }, 'transition': Trans.Quart.easeOut } }); (end code) */ nodeFx: function(opt) { var viz = this.viz, graph = viz.graph, animation = this.nodeFxAnimation, options = $.merge(this.viz.config, { 'elements': { 'id': false, 'properties': {} }, 'reposition': false }); opt = $.merge(options, opt || {}, { onBeforeCompute: $.empty, onAfterCompute: $.empty }); //check if an animation is running animation.stopTimer(); var props = opt.elements.properties; //set end values for nodes if(!opt.elements.id) { graph.eachNode(function(n) { for(var prop in props) { n.setData(prop, props[prop], 'end'); } }); } else { var ids = $.splat(opt.elements.id); $.each(ids, function(id) { var n = graph.getNode(id); if(n) { for(var prop in props) { n.setData(prop, props[prop], 'end'); } } }); } //get keys var propnames = []; for(var prop in props) propnames.push(prop); //add node properties modes var modes = ['node-property:' + propnames.join(':')]; //set new node positions if(opt.reposition) { modes.push('linear'); viz.compute('end'); } //animate this.animate($.merge(opt, { modes: modes, type: 'nodefx' })); }, /* Method: plot Plots a <Graph>. Parameters: opt - (optional) Plotting options. Most of them are described in <Options.Fx>. Example: (start code js) var viz = new $jit.Viz(options); viz.fx.plot(); (end code) */ plot: function(opt, animating) { var viz = this.viz, aGraph = viz.graph, canvas = viz.canvas, id = viz.root, that = this, ctx = canvas.getCtx(), min = Math.min, opt = opt || this.viz.controller; opt.clearCanvas && canvas.clear(); var root = aGraph.getNode(id); if(!root) return; var T = !!root.visited; aGraph.eachNode(function(node) { var nodeAlpha = node.getData('alpha'); node.eachAdjacency(function(adj) { var nodeTo = adj.nodeTo; if(!!nodeTo.visited === T && node.drawn && nodeTo.drawn) { !animating && opt.onBeforePlotLine(adj); ctx.save(); ctx.globalAlpha = min(nodeAlpha, nodeTo.getData('alpha'), adj.getData('alpha')); that.plotLine(adj, canvas, animating); ctx.restore(); !animating && opt.onAfterPlotLine(adj); } }); ctx.save(); if(node.drawn) { !animating && opt.onBeforePlotNode(node); that.plotNode(node, canvas, animating); !animating && opt.onAfterPlotNode(node); } if(!that.labelsHidden && opt.withLabels) { if(node.drawn && nodeAlpha >= 0.95) { that.labels.plotLabel(canvas, node, opt); } else { that.labels.hideLabel(node, false); } } ctx.restore(); node.visited = !T; }); }, /* Plots a Subtree. */ plotTree: function(node, opt, animating) { var that = this, viz = this.viz, canvas = viz.canvas, config = this.config, ctx = canvas.getCtx(); var nodeAlpha = node.getData('alpha'); node.eachSubnode(function(elem) { if(opt.plotSubtree(node, elem) && elem.exist && elem.drawn) { var adj = node.getAdjacency(elem.id); !animating && opt.onBeforePlotLine(adj); ctx.globalAlpha = Math.min(nodeAlpha, elem.getData('alpha')); that.plotLine(adj, canvas, animating); !animating && opt.onAfterPlotLine(adj); that.plotTree(elem, opt, animating); } }); if(node.drawn) { !animating && opt.onBeforePlotNode(node); this.plotNode(node, canvas, animating); !animating && opt.onAfterPlotNode(node); if(!opt.hideLabels && opt.withLabels && nodeAlpha >= 0.95) this.labels.plotLabel(canvas, node, opt); else this.labels.hideLabel(node, false); } else { this.labels.hideLabel(node, true); } }, /* Method: plotNode Plots a <Graph.Node>. Parameters: node - (object) A <Graph.Node>. canvas - (object) A <Canvas> element. */ plotNode: function(node, canvas, animating) { var f = node.getData('type'), ctxObj = this.node.CanvasStyles; if(f != 'none') { var width = node.getData('lineWidth'), color = node.getData('color'), alpha = node.getData('alpha'), ctx = canvas.getCtx(); ctx.lineWidth = width; ctx.fillStyle = ctx.strokeStyle = color; ctx.globalAlpha = alpha; for(var s in ctxObj) { ctx[s] = node.getCanvasStyle(s); } this.nodeTypes[f].render.call(this, node, canvas, animating); } }, /* Method: plotLine Plots a <Graph.Adjacence>. Parameters: adj - (object) A <Graph.Adjacence>. canvas - (object) A <Canvas> instance. */ plotLine: function(adj, canvas, animating) { var f = adj.getData('type'), ctxObj = this.edge.CanvasStyles; if(f != 'none') { var width = adj.getData('lineWidth'), color = adj.getData('color'), ctx = canvas.getCtx(); ctx.lineWidth = width; ctx.fillStyle = ctx.strokeStyle = color; for(var s in ctxObj) { ctx[s] = adj.getCanvasStyle(s); } this.edgeTypes[f].render.call(this, adj, canvas, animating); } } }; /* * File: Graph.Label.js * */ /* Object: Graph.Label An interface for plotting/hiding/showing labels. Description: This is a generic interface for plotting/hiding/showing labels. The <Graph.Label> interface is implemented in multiple ways to provide different label types. For example, the Graph.Label interface is implemented as <Graph.Label.HTML> to provide HTML label elements. Also we provide the <Graph.Label.SVG> interface for SVG type labels. The <Graph.Label.Native> interface implements these methods with the native Canvas text rendering functions. All subclasses (<Graph.Label.HTML>, <Graph.Label.SVG> and <Graph.Label.Native>) implement the method plotLabel. */ Graph.Label = {}; /* Class: Graph.Label.Native Implements labels natively, using the Canvas text API. */ Graph.Label.Native = new Class({ /* Method: plotLabel Plots a label for a given node. Parameters: canvas - (object) A <Canvas> instance. node - (object) A <Graph.Node>. controller - (object) A configuration object. Example: (start code js) var viz = new $jit.Viz(options); var node = viz.graph.getNode('nodeId'); viz.labels.plotLabel(viz.canvas, node, viz.config); (end code) */ plotLabel: function(canvas, node, controller) { var ctx = canvas.getCtx(); var pos = node.pos.getc(true); ctx.font = node.getLabelData('style') + ' ' + node.getLabelData('size') + 'px ' + node.getLabelData('family'); ctx.textAlign = node.getLabelData('textAlign'); ctx.fillStyle = ctx.strokeStyle = node.getLabelData('color'); ctx.textBaseline = node.getLabelData('textBaseline'); this.renderLabel(canvas, node, controller); }, /* renderLabel Does the actual rendering of the label in the canvas. The default implementation renders the label close to the position of the node, this method should be overriden to position the labels differently. Parameters: canvas - A <Canvas> instance. node - A <Graph.Node>. controller - A configuration object. See also <Hypertree>, <RGraph>, <ST>. */ renderLabel: function(canvas, node, controller) { var ctx = canvas.getCtx(); var pos = node.pos.getc(true); ctx.fillText(node.name, pos.x, pos.y + node.getData("height") / 2); }, hideLabel: $.empty, hideLabels: $.empty }); /* Class: Graph.Label.DOM Abstract Class implementing some DOM label methods. Implemented by: <Graph.Label.HTML> and <Graph.Label.SVG>. */ Graph.Label.DOM = new Class({ //A flag value indicating if node labels are being displayed or not. labelsHidden: false, //Label container labelContainer: false, //Label elements hash. labels: {}, /* Method: getLabelContainer Lazy fetcher for the label container. Returns: The label container DOM element. Example: (start code js) var viz = new $jit.Viz(options); var labelContainer = viz.labels.getLabelContainer(); alert(labelContainer.innerHTML); (end code) */ getLabelContainer: function() { return this.labelContainer ? this.labelContainer : this.labelContainer = document.getElementById(this.viz.config.labelContainer); }, /* Method: getLabel Lazy fetcher for the label element. Parameters: id - (string) The label id (which is also a <Graph.Node> id). Returns: The label element. Example: (start code js) var viz = new $jit.Viz(options); var label = viz.labels.getLabel('someid'); alert(label.innerHTML); (end code) */ getLabel: function(id) { return (id in this.labels && this.labels[id] != null) ? this.labels[id] : this.labels[id] = document.getElementById(id); }, /* Method: hideLabels Hides all labels (by hiding the label container). Parameters: hide - (boolean) A boolean value indicating if the label container must be hidden or not. Example: (start code js) var viz = new $jit.Viz(options); rg.labels.hideLabels(true); (end code) */ hideLabels: function (hide) { var container = this.getLabelContainer(); if(hide) container.style.display = 'none'; else container.style.display = ''; this.labelsHidden = hide; }, /* Method: clearLabels Clears the label container. Useful when using a new visualization with the same canvas element/widget. Parameters: force - (boolean) Forces deletion of all labels. Example: (start code js) var viz = new $jit.Viz(options); viz.labels.clearLabels(); (end code) */ clearLabels: function(force) { for(var id in this.labels) { if (force || !this.viz.graph.hasNode(id)) { this.disposeLabel(id); delete this.labels[id]; } } }, /* Method: disposeLabel Removes a label. Parameters: id - (string) A label id (which generally is also a <Graph.Node> id). Example: (start code js) var viz = new $jit.Viz(options); viz.labels.disposeLabel('labelid'); (end code) */ disposeLabel: function(id) { var elem = this.getLabel(id); if(elem && elem.parentNode) { elem.parentNode.removeChild(elem); } }, /* Method: hideLabel Hides the corresponding <Graph.Node> label. Parameters: node - (object) A <Graph.Node>. Can also be an array of <Graph.Nodes>. show - (boolean) If *true*, nodes will be shown. Otherwise nodes will be hidden. Example: (start code js) var rg = new $jit.Viz(options); viz.labels.hideLabel(viz.graph.getNode('someid'), false); (end code) */ hideLabel: function(node, show) { node = $.splat(node); var st = show ? "" : "none", lab, that = this; $.each(node, function(n) { var lab = that.getLabel(n.id); if (lab) { lab.style.display = st; } }); }, /* fitsInCanvas Returns _true_ or _false_ if the label for the node is contained in the canvas dom element or not. Parameters: pos - A <Complex> instance (I'm doing duck typing here so any object with _x_ and _y_ parameters will do). canvas - A <Canvas> instance. Returns: A boolean value specifying if the label is contained in the <Canvas> DOM element or not. */ fitsInCanvas: function(pos, canvas) { var size = canvas.getSize(); if(pos.x >= size.width || pos.x < 0 || pos.y >= size.height || pos.y < 0) return false; return true; } }); /* Class: Graph.Label.HTML Implements HTML labels. Extends: All <Graph.Label.DOM> methods. */ Graph.Label.HTML = new Class({ Implements: Graph.Label.DOM, /* Method: plotLabel Plots a label for a given node. Parameters: canvas - (object) A <Canvas> instance. node - (object) A <Graph.Node>. controller - (object) A configuration object. Example: (start code js) var viz = new $jit.Viz(options); var node = viz.graph.getNode('nodeId'); viz.labels.plotLabel(viz.canvas, node, viz.config); (end code) */ plotLabel: function(canvas, node, controller) { var id = node.id, tag = this.getLabel(id); if(!tag && !(tag = document.getElementById(id))) { tag = document.createElement('div'); var container = this.getLabelContainer(); tag.id = id; tag.className = 'node'; tag.style.position = 'absolute'; controller.onCreateLabel(tag, node); container.appendChild(tag); this.labels[node.id] = tag; } this.placeLabel(tag, node, controller); } }); /* Class: Graph.Label.SVG Implements SVG labels. Extends: All <Graph.Label.DOM> methods. */ Graph.Label.SVG = new Class({ Implements: Graph.Label.DOM, /* Method: plotLabel Plots a label for a given node. Parameters: canvas - (object) A <Canvas> instance. node - (object) A <Graph.Node>. controller - (object) A configuration object. Example: (start code js) var viz = new $jit.Viz(options); var node = viz.graph.getNode('nodeId'); viz.labels.plotLabel(viz.canvas, node, viz.config); (end code) */ plotLabel: function(canvas, node, controller) { var id = node.id, tag = this.getLabel(id); if(!tag && !(tag = document.getElementById(id))) { var ns = 'http://www.w3.org/2000/svg'; tag = document.createElementNS(ns, 'svg:text'); var tspan = document.createElementNS(ns, 'svg:tspan'); tag.appendChild(tspan); var container = this.getLabelContainer(); tag.setAttribute('id', id); tag.setAttribute('class', 'node'); container.appendChild(tag); controller.onCreateLabel(tag, node); this.labels[node.id] = tag; } this.placeLabel(tag, node, controller); } }); Graph.Geom = new Class({ initialize: function(viz) { this.viz = viz; this.config = viz.config; this.node = viz.config.Node; this.edge = viz.config.Edge; }, /* Applies a translation to the tree. Parameters: pos - A <Complex> number specifying translation vector. prop - A <Graph.Node> position property ('pos', 'start' or 'end'). Example: (start code js) st.geom.translate(new Complex(300, 100), 'end'); (end code) */ translate: function(pos, prop) { prop = $.splat(prop); this.viz.graph.eachNode(function(elem) { $.each(prop, function(p) { elem.getPos(p).$add(pos); }); }); }, /* Hides levels of the tree until it properly fits in canvas. */ setRightLevelToShow: function(node, canvas, callback) { var level = this.getRightLevelToShow(node, canvas), fx = this.viz.labels, opt = $.merge({ execShow:true, execHide:true, onHide: $.empty, onShow: $.empty }, callback || {}); node.eachLevel(0, this.config.levelsToShow, function(n) { var d = n._depth - node._depth; if(d > level) { opt.onHide(n); if(opt.execHide) { n.drawn = false; n.exist = false; fx.hideLabel(n, false); } } else { opt.onShow(n); if(opt.execShow) { n.exist = true; } } }); node.drawn= true; }, /* Returns the right level to show for the current tree in order to fit in canvas. */ getRightLevelToShow: function(node, canvas) { var config = this.config; var level = config.levelsToShow; var constrained = config.constrained; if(!constrained) return level; while(!this.treeFitsInCanvas(node, canvas, level) && level > 1) { level-- ; } return level; } }); /* * File: Loader.js * */ /* Object: Loader Provides methods for loading and serving JSON data. */ var Loader = { construct: function(json) { var isGraph = ($.type(json) == 'array'); var ans = new Graph(this.graphOptions, this.config.Node, this.config.Edge, this.config.Label); if(!isGraph) //make tree (function (ans, json) { ans.addNode(json); if(json.children) { for(var i=0, ch = json.children; i<ch.length; i++) { ans.addAdjacence(json, ch[i]); arguments.callee(ans, ch[i]); } } })(ans, json); else //make graph (function (ans, json) { var getNode = function(id) { for(var i=0, l=json.length; i<l; i++) { if(json[i].id == id) { return json[i]; } } // The node was not defined in the JSON // Let's create it var newNode = { "id" : id, "name" : id }; return ans.addNode(newNode); }; for(var i=0, l=json.length; i<l; i++) { ans.addNode(json[i]); var adj = json[i].adjacencies; if (adj) { for(var j=0, lj=adj.length; j<lj; j++) { var node = adj[j], data = {}; if(typeof adj[j] != 'string') { data = $.merge(node.data, {}); node = node.nodeTo; } ans.addAdjacence(json[i], getNode(node), data); } } } })(ans, json); return ans; }, /* Method: loadJSON Loads a JSON structure to the visualization. The JSON structure can be a JSON *tree* or *graph* structure. A JSON tree or graph structure consists of nodes, each having as properties id - (string) A unique identifier for the node name - (string) A node's name data - (object) The data optional property contains a hash (i.e {}) where you can store all the information you want about this node. For JSON *Tree* structures, there's an extra optional property *children* of type Array which contains the node's children. Example: (start code js) var json = { "id": "aUniqueIdentifier", "name": "usually a nodes name", "data": { "some key": "some value", "some other key": "some other value" }, "children": [ *other nodes or empty* ] }; (end code) JSON *Graph* structures consist of an array of nodes, each specifying the nodes to which the current node is connected. For JSON *Graph* structures, the *children* property is replaced by the *adjacencies* property. There are two types of *Graph* structures, *simple* and *extended* graph structures. For *simple* Graph structures, the adjacencies property contains an array of strings, each specifying the id of the node connected to the main node. Example: (start code js) var json = [ { "id": "aUniqueIdentifier", "name": "usually a nodes name", "data": { "some key": "some value", "some other key": "some other value" }, "adjacencies": ["anotherUniqueIdentifier", "yetAnotherUniqueIdentifier", 'etc'] }, 'other nodes go here...' ]; (end code) For *extended Graph structures*, the adjacencies property contains an array of Adjacency objects that have as properties nodeTo - (string) The other node connected by this adjacency. data - (object) A data property, where we can store custom key/value information. Example: (start code js) var json = [ { "id": "aUniqueIdentifier", "name": "usually a nodes name", "data": { "some key": "some value", "some other key": "some other value" }, "adjacencies": [ { nodeTo:"aNodeId", data: {} //put whatever you want here }, 'other adjacencies go here...' }, 'other nodes go here...' ]; (end code) About the data property: As described before, you can store custom data in the *data* property of JSON *nodes* and *adjacencies*. You can use almost any string as key for the data object. Some keys though are reserved by the toolkit, and have special meanings. This is the case for keys starting with a dollar sign, for example, *$width*. For JSON *node* objects, adding dollar prefixed properties that match the names of the options defined in <Options.Node> will override the general value for that option with that particular value. For this to work however, you do have to set *overridable = true* in <Options.Node>. The same thing is true for JSON adjacencies. Dollar prefixed data properties will alter values set in <Options.Edge> if <Options.Edge> has *overridable = true*. When loading JSON data into TreeMaps, the *data* property must contain a value for the *$area* key, since this is the value which will be taken into account when creating the layout. The same thing goes for the *$color* parameter. In JSON Nodes you can use also *$label-* prefixed properties to refer to <Options.Label> properties. For example, *$label-size* will refer to <Options.Label> size property. Also, in JSON nodes and adjacencies you can set canvas specific properties individually by using the *$canvas-* prefix. For example, *$canvas-shadowBlur* will refer to the *shadowBlur* property. These properties can also be accessed after loading the JSON data from <Graph.Nodes> and <Graph.Adjacences> by using <Accessors>. For more information take a look at the <Graph> and <Accessors> documentation. Finally, these properties can also be used to create advanced animations like with <Options.NodeStyles>. For more information about creating animations please take a look at the <Graph.Plot> and <Graph.Plot.animate> documentation. loadJSON Parameters: json - A JSON Tree or Graph structure. i - For Graph structures only. Sets the indexed node as root for the visualization. */ loadJSON: function(json, i) { this.json = json; //if they're canvas labels erase them. if(this.labels && this.labels.clearLabels) { this.labels.clearLabels(true); } this.graph = this.construct(json); if($.type(json) != 'array'){ this.root = json.id; } else { this.root = json[i? i : 0].id; } }, /* Method: toJSON Returns a JSON tree/graph structure from the visualization's <Graph>. See <Loader.loadJSON> for the graph formats available. See also: <Loader.loadJSON> Parameters: type - (string) Default's "tree". The type of the JSON structure to be returned. Possible options are "tree" or "graph". */ toJSON: function(type) { type = type || "tree"; if(type == 'tree') { var ans = {}; var rootNode = this.graph.getNode(this.root); var ans = (function recTree(node) { var ans = {}; ans.id = node.id; ans.name = node.name; ans.data = node.data; var ch =[]; node.eachSubnode(function(n) { ch.push(recTree(n)); }); ans.children = ch; return ans; })(rootNode); return ans; } else { var ans = []; var T = !!this.graph.getNode(this.root).visited; this.graph.eachNode(function(node) { var ansNode = {}; ansNode.id = node.id; ansNode.name = node.name; ansNode.data = node.data; var adjs = []; node.eachAdjacency(function(adj) { var nodeTo = adj.nodeTo; if(!!nodeTo.visited === T) { var ansAdj = {}; ansAdj.nodeTo = nodeTo.id; ansAdj.data = adj.data; adjs.push(ansAdj); } }); ansNode.adjacencies = adjs; ans.push(ansNode); node.visited = !T; }); return ans; } } }; /* * File: Layouts.js * * Implements base Tree and Graph layouts. * * Description: * * Implements base Tree and Graph layouts like Radial, Tree, etc. * */ /* * Object: Layouts * * Parent object for common layouts. * */ var Layouts = $jit.Layouts = {}; //Some util shared layout functions are defined here. var NodeDim = { label: null, compute: function(graph, prop, opt) { this.initializeLabel(opt); var label = this.label, style = label.style; graph.eachNode(function(n) { var autoWidth = n.getData('autoWidth'), autoHeight = n.getData('autoHeight'); if(autoWidth || autoHeight) { //delete dimensions since these are //going to be overridden now. delete n.data.$width; delete n.data.$height; delete n.data.$dim; var width = n.getData('width'), height = n.getData('height'); //reset label dimensions style.width = autoWidth? 'auto' : width + 'px'; style.height = autoHeight? 'auto' : height + 'px'; //TODO(nico) should let the user choose what to insert here. label.innerHTML = n.name; var offsetWidth = label.offsetWidth, offsetHeight = label.offsetHeight; var type = n.getData('type'); if($.indexOf(['circle', 'square', 'triangle', 'star'], type) === -1) { n.setData('width', offsetWidth); n.setData('height', offsetHeight); } else { var dim = offsetWidth > offsetHeight? offsetWidth : offsetHeight; n.setData('width', dim); n.setData('height', dim); n.setData('dim', dim); } } }); }, initializeLabel: function(opt) { if(!this.label) { this.label = document.createElement('div'); document.body.appendChild(this.label); } this.setLabelStyles(opt); }, setLabelStyles: function(opt) { $.extend(this.label.style, { 'visibility': 'hidden', 'position': 'absolute', 'width': 'auto', 'height': 'auto' }); this.label.className = 'jit-autoadjust-label'; } }; /* * Class: Layouts.Tree * * Implements a Tree Layout. * * Implemented By: * * <ST> * * Inspired by: * * Drawing Trees (Andrew J. Kennedy) <http://research.microsoft.com/en-us/um/people/akenn/fun/drawingtrees.pdf> * */ Layouts.Tree = (function() { //Layout functions var slice = Array.prototype.slice; /* Calculates the max width and height nodes for a tree level */ function getBoundaries(graph, config, level, orn, prop) { var dim = config.Node; var multitree = config.multitree; if (dim.overridable) { var w = -1, h = -1; graph.eachNode(function(n) { if (n._depth == level && (!multitree || ('$orn' in n.data) && n.data.$orn == orn)) { var dw = n.getData('width', prop); var dh = n.getData('height', prop); w = (w < dw) ? dw : w; h = (h < dh) ? dh : h; } }); return { 'width' : w < 0 ? dim.width : w, 'height' : h < 0 ? dim.height : h }; } else { return dim; } } function movetree(node, prop, val, orn) { var p = (orn == "left" || orn == "right") ? "y" : "x"; node.getPos(prop)[p] += val; } function moveextent(extent, val) { var ans = []; $.each(extent, function(elem) { elem = slice.call(elem); elem[0] += val; elem[1] += val; ans.push(elem); }); return ans; } function merge(ps, qs) { if (ps.length == 0) return qs; if (qs.length == 0) return ps; var p = ps.shift(), q = qs.shift(); return [ [ p[0], q[1] ] ].concat(merge(ps, qs)); } function mergelist(ls, def) { def = def || []; if (ls.length == 0) return def; var ps = ls.pop(); return mergelist(ls, merge(ps, def)); } function fit(ext1, ext2, subtreeOffset, siblingOffset, i) { if (ext1.length <= i || ext2.length <= i) return 0; var p = ext1[i][1], q = ext2[i][0]; return Math.max(fit(ext1, ext2, subtreeOffset, siblingOffset, ++i) + subtreeOffset, p - q + siblingOffset); } function fitlistl(es, subtreeOffset, siblingOffset) { function $fitlistl(acc, es, i) { if (es.length <= i) return []; var e = es[i], ans = fit(acc, e, subtreeOffset, siblingOffset, 0); return [ ans ].concat($fitlistl(merge(acc, moveextent(e, ans)), es, ++i)); } ; return $fitlistl( [], es, 0); } function fitlistr(es, subtreeOffset, siblingOffset) { function $fitlistr(acc, es, i) { if (es.length <= i) return []; var e = es[i], ans = -fit(e, acc, subtreeOffset, siblingOffset, 0); return [ ans ].concat($fitlistr(merge(moveextent(e, ans), acc), es, ++i)); } ; es = slice.call(es); var ans = $fitlistr( [], es.reverse(), 0); return ans.reverse(); } function fitlist(es, subtreeOffset, siblingOffset, align) { var esl = fitlistl(es, subtreeOffset, siblingOffset), esr = fitlistr(es, subtreeOffset, siblingOffset); if (align == "left") esr = esl; else if (align == "right") esl = esr; for ( var i = 0, ans = []; i < esl.length; i++) { ans[i] = (esl[i] + esr[i]) / 2; } return ans; } function design(graph, node, prop, config, orn) { var multitree = config.multitree; var auxp = [ 'x', 'y' ], auxs = [ 'width', 'height' ]; var ind = +(orn == "left" || orn == "right"); var p = auxp[ind], notp = auxp[1 - ind]; var cnode = config.Node; var s = auxs[ind], nots = auxs[1 - ind]; var siblingOffset = config.siblingOffset; var subtreeOffset = config.subtreeOffset; var align = config.align; function $design(node, maxsize, acum) { var sval = node.getData(s, prop); var notsval = maxsize || (node.getData(nots, prop)); var trees = [], extents = [], chmaxsize = false; var chacum = notsval + config.levelDistance; node.eachSubnode(function(n) { if (n.exist && (!multitree || ('$orn' in n.data) && n.data.$orn == orn)) { if (!chmaxsize) chmaxsize = getBoundaries(graph, config, n._depth, orn, prop); var s = $design(n, chmaxsize[nots], acum + chacum); trees.push(s.tree); extents.push(s.extent); } }); var positions = fitlist(extents, subtreeOffset, siblingOffset, align); for ( var i = 0, ptrees = [], pextents = []; i < trees.length; i++) { movetree(trees[i], prop, positions[i], orn); pextents.push(moveextent(extents[i], positions[i])); } var resultextent = [ [ -sval / 2, sval / 2 ] ] .concat(mergelist(pextents)); node.getPos(prop)[p] = 0; if (orn == "top" || orn == "left") { node.getPos(prop)[notp] = acum; } else { node.getPos(prop)[notp] = -acum; } return { tree : node, extent : resultextent }; } $design(node, false, 0); } return new Class({ /* Method: compute Computes nodes' positions. */ compute : function(property, computeLevels) { var prop = property || 'start'; var node = this.graph.getNode(this.root); $.extend(node, { 'drawn' : true, 'exist' : true, 'selected' : true }); NodeDim.compute(this.graph, prop, this.config); if (!!computeLevels || !("_depth" in node)) { this.graph.computeLevels(this.root, 0, "ignore"); } this.computePositions(node, prop); }, computePositions : function(node, prop) { var config = this.config; var multitree = config.multitree; var align = config.align; var indent = align !== 'center' && config.indent; var orn = config.orientation; var orns = multitree ? [ 'top', 'right', 'bottom', 'left' ] : [ orn ]; var that = this; $.each(orns, function(orn) { //calculate layout design(that.graph, node, prop, that.config, orn, prop); var i = [ 'x', 'y' ][+(orn == "left" || orn == "right")]; //absolutize (function red(node) { node.eachSubnode(function(n) { if (n.exist && (!multitree || ('$orn' in n.data) && n.data.$orn == orn)) { n.getPos(prop)[i] += node.getPos(prop)[i]; if (indent) { n.getPos(prop)[i] += align == 'left' ? indent : -indent; } red(n); } }); })(node); }); } }); })(); /* * File: Spacetree.js */ /* Class: ST A Tree layout with advanced contraction and expansion animations. Inspired by: SpaceTree: Supporting Exploration in Large Node Link Tree, Design Evolution and Empirical Evaluation (Catherine Plaisant, Jesse Grosjean, Benjamin B. Bederson) <http://hcil.cs.umd.edu/trs/2002-05/2002-05.pdf> Drawing Trees (Andrew J. Kennedy) <http://research.microsoft.com/en-us/um/people/akenn/fun/drawingtrees.pdf> Note: This visualization was built and engineered from scratch, taking only the papers as inspiration, and only shares some features with the visualization described in those papers. Implements: All <Loader> methods Constructor Options: Inherits options from - <Options.Canvas> - <Options.Controller> - <Options.Tree> - <Options.Node> - <Options.Edge> - <Options.Label> - <Options.Events> - <Options.Tips> - <Options.NodeStyles> - <Options.Navigation> Additionally, there are other parameters and some default values changed constrained - (boolean) Default's *true*. Whether to show the entire tree when loaded or just the number of levels specified by _levelsToShow_. levelsToShow - (number) Default's *2*. The number of levels to show for a subtree. This number is relative to the selected node. levelDistance - (number) Default's *30*. The distance between two consecutive levels of the tree. Node.type - Described in <Options.Node>. Default's set to *rectangle*. offsetX - (number) Default's *0*. The x-offset distance from the selected node to the center of the canvas. offsetY - (number) Default's *0*. The y-offset distance from the selected node to the center of the canvas. duration - Described in <Options.Fx>. It's default value has been changed to *700*. Instance Properties: canvas - Access a <Canvas> instance. graph - Access a <Graph> instance. op - Access a <ST.Op> instance. fx - Access a <ST.Plot> instance. labels - Access a <ST.Label> interface implementation. */ $jit.ST= (function() { // Define some private methods first... // Nodes in path var nodesInPath = []; // Nodes to contract function getNodesToHide(node) { node = node || this.clickedNode; if(!this.config.constrained) { return []; } var Geom = this.geom; var graph = this.graph; var canvas = this.canvas; var level = node._depth, nodeArray = []; graph.eachNode(function(n) { if(n.exist && !n.selected) { if(n.isDescendantOf(node.id)) { if(n._depth <= level) nodeArray.push(n); } else { nodeArray.push(n); } } }); var leafLevel = Geom.getRightLevelToShow(node, canvas); node.eachLevel(leafLevel, leafLevel, function(n) { if(n.exist && !n.selected) nodeArray.push(n); }); for (var i = 0; i < nodesInPath.length; i++) { var n = this.graph.getNode(nodesInPath[i]); if(!n.isDescendantOf(node.id)) { nodeArray.push(n); } } return nodeArray; }; // Nodes to expand function getNodesToShow(node) { var nodeArray = [], config = this.config; node = node || this.clickedNode; this.clickedNode.eachLevel(0, config.levelsToShow, function(n) { if(config.multitree && !('$orn' in n.data) && n.anySubnode(function(ch){ return ch.exist && !ch.drawn; })) { nodeArray.push(n); } else if(n.drawn && !n.anySubnode("drawn")) { nodeArray.push(n); } }); return nodeArray; }; // Now define the actual class. return new Class({ Implements: [Loader, Extras, Layouts.Tree], initialize: function(controller) { var $ST = $jit.ST; var config= { levelsToShow: 2, levelDistance: 30, constrained: true, Node: { type: 'rectangle' }, duration: 700, offsetX: 0, offsetY: 0 }; this.controller = this.config = $.merge( Options("Canvas", "Fx", "Tree", "Node", "Edge", "Controller", "Tips", "NodeStyles", "Events", "Navigation", "Label"), config, controller); var canvasConfig = this.config; if(canvasConfig.useCanvas) { this.canvas = canvasConfig.useCanvas; this.config.labelContainer = this.canvas.id + '-label'; } else { if(canvasConfig.background) { canvasConfig.background = $.merge({ type: 'Fade', colorStop1: this.config.colorStop1, colorStop2: this.config.colorStop2 }, canvasConfig.background); } this.canvas = new Canvas(this, canvasConfig); this.config.labelContainer = (typeof canvasConfig.injectInto == 'string'? canvasConfig.injectInto : canvasConfig.injectInto.id) + '-label'; } this.graphOptions = { 'complex': true }; this.graph = new Graph(this.graphOptions, this.config.Node, this.config.Edge); this.labels = new $ST.Label[canvasConfig.Label.type](this); this.fx = new $ST.Plot(this, $ST); this.op = new $ST.Op(this); this.group = new $ST.Group(this); this.geom = new $ST.Geom(this); this.clickedNode= null; // initialize extras this.initializeExtras(); }, /* Method: plot Plots the <ST>. This is a shortcut to *fx.plot*. */ plot: function() { this.fx.plot(this.controller); }, /* Method: switchPosition Switches the tree orientation. Parameters: pos - (string) The new tree orientation. Possible values are "top", "left", "right" and "bottom". method - (string) Set this to "animate" if you want to animate the tree when switching its position. You can also set this parameter to "replot" to just replot the subtree. onComplete - (optional|object) This callback is called once the "switching" animation is complete. Example: (start code js) st.switchPosition("right", "animate", { onComplete: function() { alert('completed!'); } }); (end code) */ switchPosition: function(pos, method, onComplete) { var Geom = this.geom, Plot = this.fx, that = this; if(!Plot.busy) { Plot.busy = true; this.contract({ onComplete: function() { Geom.switchOrientation(pos); that.compute('end', false); Plot.busy = false; if(method == 'animate') { that.onClick(that.clickedNode.id, onComplete); } else if(method == 'replot') { that.select(that.clickedNode.id, onComplete); } } }, pos); } }, /* Method: switchAlignment Switches the tree alignment. Parameters: align - (string) The new tree alignment. Possible values are "left", "center" and "right". method - (string) Set this to "animate" if you want to animate the tree after aligning its position. You can also set this parameter to "replot" to just replot the subtree. onComplete - (optional|object) This callback is called once the "switching" animation is complete. Example: (start code js) st.switchAlignment("right", "animate", { onComplete: function() { alert('completed!'); } }); (end code) */ switchAlignment: function(align, method, onComplete) { this.config.align = align; if(method == 'animate') { this.select(this.clickedNode.id, onComplete); } else if(method == 'replot') { this.onClick(this.clickedNode.id, onComplete); } }, /* Method: addNodeInPath Adds a node to the current path as selected node. The selected node will be visible (as in non-collapsed) at all times. Parameters: id - (string) A <Graph.Node> id. Example: (start code js) st.addNodeInPath("nodeId"); (end code) */ addNodeInPath: function(id) { nodesInPath.push(id); this.select((this.clickedNode && this.clickedNode.id) || this.root); }, /* Method: clearNodesInPath Removes all nodes tagged as selected by the <ST.addNodeInPath> method. See also: <ST.addNodeInPath> Example: (start code js) st.clearNodesInPath(); (end code) */ clearNodesInPath: function(id) { nodesInPath.length = 0; this.select((this.clickedNode && this.clickedNode.id) || this.root); }, /* Method: refresh Computes positions and plots the tree. */ refresh: function() { this.reposition(); this.select((this.clickedNode && this.clickedNode.id) || this.root); }, reposition: function() { this.graph.computeLevels(this.root, 0, "ignore"); this.geom.setRightLevelToShow(this.clickedNode, this.canvas); this.graph.eachNode(function(n) { if(n.exist) n.drawn = true; }); this.compute('end'); }, requestNodes: function(node, onComplete) { var handler = $.merge(this.controller, onComplete), lev = this.config.levelsToShow; if(handler.request) { var leaves = [], d = node._depth; node.eachLevel(0, lev, function(n) { if(n.drawn && !n.anySubnode()) { leaves.push(n); n._level = lev - (n._depth - d); } }); this.group.requestNodes(leaves, handler); } else handler.onComplete(); }, contract: function(onComplete, switched) { var orn = this.config.orientation; var Geom = this.geom, Group = this.group; if(switched) Geom.switchOrientation(switched); var nodes = getNodesToHide.call(this); if(switched) Geom.switchOrientation(orn); Group.contract(nodes, $.merge(this.controller, onComplete)); }, move: function(node, onComplete) { this.compute('end', false); var move = onComplete.Move, offset = { 'x': move.offsetX, 'y': move.offsetY }; if(move.enable) { this.geom.translate(node.endPos.add(offset).$scale(-1), "end"); } this.fx.animate($.merge(this.controller, { modes: ['linear'] }, onComplete)); }, expand: function (node, onComplete) { var nodeArray = getNodesToShow.call(this, node); this.group.expand(nodeArray, $.merge(this.controller, onComplete)); }, selectPath: function(node) { var that = this; this.graph.eachNode(function(n) { n.selected = false; }); function path(node) { if(node == null || node.selected) return; node.selected = true; $.each(that.group.getSiblings([node])[node.id], function(n) { n.exist = true; n.drawn = true; }); var parents = node.getParents(); parents = (parents.length > 0)? parents[0] : null; path(parents); }; for(var i=0, ns = [node.id].concat(nodesInPath); i < ns.length; i++) { path(this.graph.getNode(ns[i])); } }, /* Method: setRoot Switches the current root node. Changes the topology of the Tree. Parameters: id - (string) The id of the node to be set as root. method - (string) Set this to "animate" if you want to animate the tree after adding the subtree. You can also set this parameter to "replot" to just replot the subtree. onComplete - (optional|object) An action to perform after the animation (if any). Example: (start code js) st.setRoot('nodeId', 'animate', { onComplete: function() { alert('complete!'); } }); (end code) */ setRoot: function(id, method, onComplete) { if(this.busy) return; this.busy = true; var that = this, canvas = this.canvas; var rootNode = this.graph.getNode(this.root); var clickedNode = this.graph.getNode(id); function $setRoot() { if(this.config.multitree && clickedNode.data.$orn) { var orn = clickedNode.data.$orn; var opp = { 'left': 'right', 'right': 'left', 'top': 'bottom', 'bottom': 'top' }[orn]; rootNode.data.$orn = opp; (function tag(rootNode) { rootNode.eachSubnode(function(n) { if(n.id != id) { n.data.$orn = opp; tag(n); } }); })(rootNode); delete clickedNode.data.$orn; } this.root = id; this.clickedNode = clickedNode; this.graph.computeLevels(this.root, 0, "ignore"); this.geom.setRightLevelToShow(clickedNode, canvas, { execHide: false, onShow: function(node) { if(!node.drawn) { node.drawn = true; node.setData('alpha', 1, 'end'); node.setData('alpha', 0); node.pos.setc(clickedNode.pos.x, clickedNode.pos.y); } } }); this.compute('end'); this.busy = true; this.fx.animate({ modes: ['linear', 'node-property:alpha'], onComplete: function() { that.busy = false; that.onClick(id, { onComplete: function() { onComplete && onComplete.onComplete(); } }); } }); } // delete previous orientations (if any) delete rootNode.data.$orns; if(method == 'animate') { $setRoot.call(this); that.selectPath(clickedNode); } else if(method == 'replot') { $setRoot.call(this); this.select(this.root); } }, /* Method: addSubtree Adds a subtree. Parameters: subtree - (object) A JSON Tree object. See also <Loader.loadJSON>. method - (string) Set this to "animate" if you want to animate the tree after adding the subtree. You can also set this parameter to "replot" to just replot the subtree. onComplete - (optional|object) An action to perform after the animation (if any). Example: (start code js) st.addSubtree(json, 'animate', { onComplete: function() { alert('complete!'); } }); (end code) */ addSubtree: function(subtree, method, onComplete) { if(method == 'replot') { this.op.sum(subtree, $.extend({ type: 'replot' }, onComplete || {})); } else if (method == 'animate') { this.op.sum(subtree, $.extend({ type: 'fade:seq' }, onComplete || {})); } }, /* Method: removeSubtree Removes a subtree. Parameters: id - (string) The _id_ of the subtree to be removed. removeRoot - (boolean) Default's *false*. Remove the root of the subtree or only its subnodes. method - (string) Set this to "animate" if you want to animate the tree after removing the subtree. You can also set this parameter to "replot" to just replot the subtree. onComplete - (optional|object) An action to perform after the animation (if any). Example: (start code js) st.removeSubtree('idOfSubtreeToBeRemoved', false, 'animate', { onComplete: function() { alert('complete!'); } }); (end code) */ removeSubtree: function(id, removeRoot, method, onComplete) { var node = this.graph.getNode(id), subids = []; node.eachLevel(+!removeRoot, false, function(n) { subids.push(n.id); }); if(method == 'replot') { this.op.removeNode(subids, $.extend({ type: 'replot' }, onComplete || {})); } else if (method == 'animate') { this.op.removeNode(subids, $.extend({ type: 'fade:seq'}, onComplete || {})); } }, /* Method: select Selects a node in the <ST> without performing an animation. Useful when selecting nodes which are currently hidden or deep inside the tree. Parameters: id - (string) The id of the node to select. onComplete - (optional|object) an onComplete callback. Example: (start code js) st.select('mynodeid', { onComplete: function() { alert('complete!'); } }); (end code) */ select: function(id, onComplete) { var group = this.group, geom = this.geom; var node= this.graph.getNode(id), canvas = this.canvas; var root = this.graph.getNode(this.root); var complete = $.merge(this.controller, onComplete); var that = this; complete.onBeforeCompute(node); this.selectPath(node); this.clickedNode= node; this.requestNodes(node, { onComplete: function(){ group.hide(group.prepare(getNodesToHide.call(that)), complete); geom.setRightLevelToShow(node, canvas); that.compute("current"); that.graph.eachNode(function(n) { var pos = n.pos.getc(true); n.startPos.setc(pos.x, pos.y); n.endPos.setc(pos.x, pos.y); n.visited = false; }); var offset = { x: complete.offsetX, y: complete.offsetY }; that.geom.translate(node.endPos.add(offset).$scale(-1), ["start", "current", "end"]); group.show(getNodesToShow.call(that)); that.plot(); complete.onAfterCompute(that.clickedNode); complete.onComplete(); } }); }, /* Method: onClick Animates the <ST> to center the node specified by *id*. Parameters: id - (string) A node id. options - (optional|object) A group of options and callbacks described below. onComplete - (object) An object callback called when the animation finishes. Move - (object) An object that has as properties _offsetX_ or _offsetY_ for adding some offset position to the centered node. Example: (start code js) st.onClick('mynodeid', { Move: { enable: true, offsetX: 30, offsetY: 5 }, onComplete: function() { alert('yay!'); } }); (end code) */ onClick: function (id, options) { var canvas = this.canvas, that = this, Geom = this.geom, config = this.config; var innerController = { Move: { enable: true, offsetX: config.offsetX || 0, offsetY: config.offsetY || 0 }, setRightLevelToShowConfig: false, onBeforeRequest: $.empty, onBeforeContract: $.empty, onBeforeMove: $.empty, onBeforeExpand: $.empty }; var complete = $.merge(this.controller, innerController, options); if(!this.busy) { this.busy = true; var node = this.graph.getNode(id); this.selectPath(node, this.clickedNode); this.clickedNode = node; complete.onBeforeCompute(node); complete.onBeforeRequest(node); this.requestNodes(node, { onComplete: function() { complete.onBeforeContract(node); that.contract({ onComplete: function() { Geom.setRightLevelToShow(node, canvas, complete.setRightLevelToShowConfig); complete.onBeforeMove(node); that.move(node, { Move: complete.Move, onComplete: function() { complete.onBeforeExpand(node); that.expand(node, { onComplete: function() { that.busy = false; complete.onAfterCompute(id); complete.onComplete(); } }); // expand } }); // move } });// contract } });// request } } }); })(); $jit.ST.$extend = true; /* Class: ST.Op Custom extension of <Graph.Op>. Extends: All <Graph.Op> methods See also: <Graph.Op> */ $jit.ST.Op = new Class({ Implements: Graph.Op }); /* Performs operations on group of nodes. */ $jit.ST.Group = new Class({ initialize: function(viz) { this.viz = viz; this.canvas = viz.canvas; this.config = viz.config; this.animation = new Animation; this.nodes = null; }, /* Calls the request method on the controller to request a subtree for each node. */ requestNodes: function(nodes, controller) { var counter = 0, len = nodes.length, nodeSelected = {}; var complete = function() { controller.onComplete(); }; var viz = this.viz; if(len == 0) complete(); for(var i=0; i<len; i++) { nodeSelected[nodes[i].id] = nodes[i]; controller.request(nodes[i].id, nodes[i]._level, { onComplete: function(nodeId, data) { if(data && data.children) { data.id = nodeId; viz.op.sum(data, { type: 'nothing' }); } if(++counter == len) { viz.graph.computeLevels(viz.root, 0); complete(); } } }); } }, /* Collapses group of nodes. */ contract: function(nodes, controller) { var viz = this.viz; var that = this; nodes = this.prepare(nodes); this.animation.setOptions($.merge(controller, { $animating: false, compute: function(delta) { if(delta == 1) delta = 0.99; that.plotStep(1 - delta, controller, this.$animating); this.$animating = 'contract'; }, complete: function() { that.hide(nodes, controller); } })).start(); }, hide: function(nodes, controller) { var viz = this.viz; for(var i=0; i<nodes.length; i++) { // TODO nodes are requested on demand, but not // deleted when hidden. Would that be a good feature? // Currently that feature is buggy, so I'll turn it off // Actually this feature is buggy because trimming should take // place onAfterCompute and not right after collapsing nodes. if (true || !controller || !controller.request) { nodes[i].eachLevel(1, false, function(elem){ if (elem.exist) { $.extend(elem, { 'drawn': false, 'exist': false }); } }); } else { var ids = []; nodes[i].eachLevel(1, false, function(n) { ids.push(n.id); }); viz.op.removeNode(ids, { 'type': 'nothing' }); viz.labels.clearLabels(); } } controller.onComplete(); }, /* Expands group of nodes. */ expand: function(nodes, controller) { var that = this; this.show(nodes); this.animation.setOptions($.merge(controller, { $animating: false, compute: function(delta) { that.plotStep(delta, controller, this.$animating); this.$animating = 'expand'; }, complete: function() { that.plotStep(undefined, controller, false); controller.onComplete(); } })).start(); }, show: function(nodes) { var config = this.config; this.prepare(nodes); $.each(nodes, function(n) { // check for root nodes if multitree if(config.multitree && !('$orn' in n.data)) { delete n.data.$orns; var orns = ' '; n.eachSubnode(function(ch) { if(('$orn' in ch.data) && orns.indexOf(ch.data.$orn) < 0 && ch.exist && !ch.drawn) { orns += ch.data.$orn + ' '; } }); n.data.$orns = orns; } n.eachLevel(0, config.levelsToShow, function(n) { if(n.exist) n.drawn = true; }); }); }, prepare: function(nodes) { this.nodes = this.getNodesWithChildren(nodes); return this.nodes; }, /* Filters an array of nodes leaving only nodes with children. */ getNodesWithChildren: function(nodes) { var ans = [], config = this.config, root = this.viz.root; nodes.sort(function(a, b) { return (a._depth <= b._depth) - (a._depth >= b._depth); }); for(var i=0; i<nodes.length; i++) { if(nodes[i].anySubnode("exist")) { for (var j = i+1, desc = false; !desc && j < nodes.length; j++) { if(!config.multitree || '$orn' in nodes[j].data) { desc = desc || nodes[i].isDescendantOf(nodes[j].id); } } if(!desc) ans.push(nodes[i]); } } return ans; }, plotStep: function(delta, controller, animating) { var viz = this.viz, config = this.config, canvas = viz.canvas, ctx = canvas.getCtx(), nodes = this.nodes; var i, node; // hide nodes that are meant to be collapsed/expanded var nds = {}; for(i=0; i<nodes.length; i++) { node = nodes[i]; nds[node.id] = []; var root = config.multitree && !('$orn' in node.data); var orns = root && node.data.$orns; node.eachSubgraph(function(n) { // TODO(nico): Cleanup // special check for root node subnodes when // multitree is checked. if(root && orns && orns.indexOf(n.data.$orn) > 0 && n.drawn) { n.drawn = false; nds[node.id].push(n); } else if((!root || !orns) && n.drawn) { n.drawn = false; nds[node.id].push(n); } }); node.drawn = true; } // plot the whole (non-scaled) tree if(nodes.length > 0) viz.fx.plot(); // show nodes that were previously hidden for(i in nds) { $.each(nds[i], function(n) { n.drawn = true; }); } // plot each scaled subtree for(i=0; i<nodes.length; i++) { node = nodes[i]; ctx.save(); viz.fx.plotSubtree(node, controller, delta, animating); ctx.restore(); } }, getSiblings: function(nodes) { var siblings = {}; $.each(nodes, function(n) { var par = n.getParents(); if (par.length == 0) { siblings[n.id] = [n]; } else { var ans = []; par[0].eachSubnode(function(sn) { ans.push(sn); }); siblings[n.id] = ans; } }); return siblings; } }); /* ST.Geom Performs low level geometrical computations. Access: This instance can be accessed with the _geom_ parameter of the st instance created. Example: (start code js) var st = new ST(canvas, config); st.geom.translate //or can also call any other <ST.Geom> method (end code) */ $jit.ST.Geom = new Class({ Implements: Graph.Geom, /* Changes the tree current orientation to the one specified. You should usually use <ST.switchPosition> instead. */ switchOrientation: function(orn) { this.config.orientation = orn; }, /* Makes a value dispatch according to the current layout Works like a CSS property, either _top-right-bottom-left_ or _top|bottom - left|right_. */ dispatch: function() { // TODO(nico) should store Array.prototype.slice.call somewhere. var args = Array.prototype.slice.call(arguments); var s = args.shift(), len = args.length; var val = function(a) { return typeof a == 'function'? a() : a; }; if(len == 2) { return (s == "top" || s == "bottom")? val(args[0]) : val(args[1]); } else if(len == 4) { switch(s) { case "top": return val(args[0]); case "right": return val(args[1]); case "bottom": return val(args[2]); case "left": return val(args[3]); } } return undefined; }, /* Returns label height or with, depending on the tree current orientation. */ getSize: function(n, invert) { var data = n.data, config = this.config; var siblingOffset = config.siblingOffset; var s = (config.multitree && ('$orn' in data) && data.$orn) || config.orientation; var w = n.getData('width') + siblingOffset; var h = n.getData('height') + siblingOffset; if(!invert) return this.dispatch(s, h, w); else return this.dispatch(s, w, h); }, /* Calculates a subtree base size. This is an utility function used by _getBaseSize_ */ getTreeBaseSize: function(node, level, leaf) { var size = this.getSize(node, true), baseHeight = 0, that = this; if(leaf(level, node)) return size; if(level === 0) return 0; node.eachSubnode(function(elem) { baseHeight += that.getTreeBaseSize(elem, level -1, leaf); }); return (size > baseHeight? size : baseHeight) + this.config.subtreeOffset; }, /* getEdge Returns a Complex instance with the begin or end position of the edge to be plotted. Parameters: node - A <Graph.Node> that is connected to this edge. type - Returns the begin or end edge position. Possible values are 'begin' or 'end'. Returns: A <Complex> number specifying the begin or end position. */ getEdge: function(node, type, s) { var $C = function(a, b) { return function(){ return node.pos.add(new Complex(a, b)); }; }; var dim = this.node; var w = node.getData('width'); var h = node.getData('height'); if(type == 'begin') { if(dim.align == "center") { return this.dispatch(s, $C(0, h/2), $C(-w/2, 0), $C(0, -h/2),$C(w/2, 0)); } else if(dim.align == "left") { return this.dispatch(s, $C(0, h), $C(0, 0), $C(0, 0), $C(w, 0)); } else if(dim.align == "right") { return this.dispatch(s, $C(0, 0), $C(-w, 0), $C(0, -h),$C(0, 0)); } else throw "align: not implemented"; } else if(type == 'end') { if(dim.align == "center") { return this.dispatch(s, $C(0, -h/2), $C(w/2, 0), $C(0, h/2), $C(-w/2, 0)); } else if(dim.align == "left") { return this.dispatch(s, $C(0, 0), $C(w, 0), $C(0, h), $C(0, 0)); } else if(dim.align == "right") { return this.dispatch(s, $C(0, -h),$C(0, 0), $C(0, 0), $C(-w, 0)); } else throw "align: not implemented"; } }, /* Adjusts the tree position due to canvas scaling or translation. */ getScaledTreePosition: function(node, scale) { var dim = this.node; var w = node.getData('width'); var h = node.getData('height'); var s = (this.config.multitree && ('$orn' in node.data) && node.data.$orn) || this.config.orientation; var $C = function(a, b) { return function(){ return node.pos.add(new Complex(a, b)).$scale(1 - scale); }; }; if(dim.align == "left") { return this.dispatch(s, $C(0, h), $C(0, 0), $C(0, 0), $C(w, 0)); } else if(dim.align == "center") { return this.dispatch(s, $C(0, h / 2), $C(-w / 2, 0), $C(0, -h / 2),$C(w / 2, 0)); } else if(dim.align == "right") { return this.dispatch(s, $C(0, 0), $C(-w, 0), $C(0, -h),$C(0, 0)); } else throw "align: not implemented"; }, /* treeFitsInCanvas Returns a Boolean if the current subtree fits in canvas. Parameters: node - A <Graph.Node> which is the current root of the subtree. canvas - The <Canvas> object. level - The depth of the subtree to be considered. */ treeFitsInCanvas: function(node, canvas, level) { var csize = canvas.getSize(); var s = (this.config.multitree && ('$orn' in node.data) && node.data.$orn) || this.config.orientation; var size = this.dispatch(s, csize.width, csize.height); var baseSize = this.getTreeBaseSize(node, level, function(level, node) { return level === 0 || !node.anySubnode(); }); return (baseSize < size); } }); /* Class: ST.Plot Custom extension of <Graph.Plot>. Extends: All <Graph.Plot> methods See also: <Graph.Plot> */ $jit.ST.Plot = new Class({ Implements: Graph.Plot, /* Plots a subtree from the spacetree. */ plotSubtree: function(node, opt, scale, animating) { var viz = this.viz, canvas = viz.canvas, config = viz.config; scale = Math.min(Math.max(0.001, scale), 1); if(scale >= 0) { node.drawn = false; var ctx = canvas.getCtx(); var diff = viz.geom.getScaledTreePosition(node, scale); ctx.translate(diff.x, diff.y); ctx.scale(scale, scale); } this.plotTree(node, $.merge(opt, { 'withLabels': true, 'hideLabels': !!scale, 'plotSubtree': function(n, ch) { var root = config.multitree && !('$orn' in node.data); var orns = root && node.getData('orns'); return !root || orns.indexOf(elem.getData('orn')) > -1; } }), animating); if(scale >= 0) node.drawn = true; }, /** * Return array with correct positions for each element * * @param {Array} dimArray * @param {Number} fontHeight * @return {Array} */ positions: function(dimArray, fontHeight) { var group = []; var isLastElem = false; var i; var newArray = []; var position = 0; var currentState; for (i = 0; i < dimArray.length; i++) { currentState = {type: 'element', position: position, height: dimArray[i], font: fontHeight, filament: true}; if (dimArray[i] <= fontHeight) { if (isLastElem) { group = []; } group.push(currentState); isLastElem = false; } else { group.push(currentState); newArray.push({type: 'group', val:group, groupHeight: 0, groupPosition: group[0].position}); group = []; isLastElem = true; } position += dimArray[i]; } if (group.length > 0) { newArray.push({type: 'group', val: group, groupHeight: 0, groupPosition: group[0].position}); group = []; } var figureHeight = position; for (i = 0; i < newArray.length; i++) { newArray[i] = this.pipelineGetHeight(newArray[i]); } newArray = this.pipelineMoveBlocks(newArray, figureHeight, fontHeight); var ret = []; for (i = 0; i < newArray.length; i++) { group = newArray[i].val; for (var k = 0; k < group.length; k++) { ret.push(group[k]); } } return ret; }, /** * Return recalculation group height(groupHeight) and positions of elements * * @param {Array} group * @return {Array} */ pipelineGetHeight: function(group) { var position = 0; var between = 3; var count = group.val.length; var fontHeight = group.val[0].font; var positionStart = group.val[0].position; if (count == 1) { group.groupHeight = group.val[0].font; group.val[0].filament = false; return group; } if (count == 2) { group.groupHeight = fontHeight * 2 + between; group.val[1].position = positionStart + fontHeight + between; group.val[0].filament = false; group.val[1].filament = false; return group; } var even = true; for (var i = 0; i < group.val.length; i++) { group.val[i].position = positionStart + position; even = i % 2; position += between; if (even) { group.val[i].filament = false; position += fontHeight; } else { group.val[i].filament = true; } } group.groupHeight = (group.val[group.val.length - 1].position - group.val[0].position) + fontHeight + between; return group; }, /** * Return array with new group and elements positions relation figure layout border * * @param {Array} block * @param {Number} figureheight * @param {Number} fontHeight * @return {Array} */ pipelineMoveBlocks: function(block, figureheight, fontHeight) { var offset; var rebuild; if (block.length < 2) { return block; } var lastValue = block[block.length - 1]; var prelastValue; if ((lastValue.groupPosition + lastValue.groupHeight) > figureheight) { offset = (figureheight - lastValue.groupHeight) - lastValue.groupPosition; lastValue.groupPosition += offset; for (var li = 0; li < lastValue.val.length; li++) { lastValue.val[li].position += offset; } prelastValue = block[block.length - 2]; if (prelastValue.groupPosition + fontHeight > lastValue.groupPosition) { block[block.length - 2] = this.pipelineMergeGroup(lastValue, prelastValue); block.pop(); rebuild = true; } if (block.length < 3) { return block; } } for (var i = 1; i < block.length; i++) { if ( (block[i - 1].groupPosition + block[i - 1].groupHeight) > block[i].groupPosition) { block[i - 1] = this.pipelineMergeGroup(block[i], block[i - 1]); block.splice(i, 1); rebuild = true; } } if (rebuild) { block = this.pipelineMoveBlocks(block, figureheight, fontHeight); } return block; }, /** * Merge two groups * * @param {Array} lastValue * @param {Array} prelastValue * @return {Array} */ pipelineMergeGroup: function(lastValue, prelastValue) { var newGroup; newGroup = prelastValue; newGroup.val = newGroup.val.concat(lastValue.val); newGroup = this.pipelineGetHeight(newGroup); newGroup.groupPosition = prelastValue.groupPosition; return newGroup; }, /* Method: getAlignedPos Returns a *x, y* object with the position of the top/left corner of a <ST> node. Parameters: pos - (object) A <Graph.Node> position. width - (number) The width of the node. height - (number) The height of the node. */ getAlignedPos: function(pos, width, height) { var nconfig = this.node; var square, orn; if(nconfig.align == "center") { square = { x: pos.x - width / 2, y: pos.y - height / 2 }; } else if (nconfig.align == "left") { orn = this.config.orientation; if(orn == "bottom" || orn == "top") { square = { x: pos.x - width / 2, y: pos.y }; } else { square = { x: pos.x, y: pos.y - height / 2 }; } } else if(nconfig.align == "right") { orn = this.config.orientation; if(orn == "bottom" || orn == "top") { square = { x: pos.x - width / 2, y: pos.y - height }; } else { square = { x: pos.x - width, y: pos.y - height / 2 }; } } else throw "align: not implemented"; return square; }, getOrientation: function(adj) { var config = this.config; var orn = config.orientation; if(config.multitree) { var nodeFrom = adj.nodeFrom; var nodeTo = adj.nodeTo; orn = (('$orn' in nodeFrom.data) && nodeFrom.data.$orn) || (('$orn' in nodeTo.data) && nodeTo.data.$orn); } return orn; } }); /* Class: ST.Label Custom extension of <Graph.Label>. Contains custom <Graph.Label.SVG>, <Graph.Label.HTML> and <Graph.Label.Native> extensions. Extends: All <Graph.Label> methods and subclasses. See also: <Graph.Label>, <Graph.Label.Native>, <Graph.Label.HTML>, <Graph.Label.SVG>. */ $jit.ST.Label = {}; /* ST.Label.Native Custom extension of <Graph.Label.Native>. Extends: All <Graph.Label.Native> methods See also: <Graph.Label.Native> */ $jit.ST.Label.Native = new Class({ Implements: Graph.Label.Native, renderLabel: function(canvas, node, controller) { var ctx = canvas.getCtx(); var coord = node.pos.getc(true); ctx.fillText(node.name, coord.x, coord.y); } }); $jit.ST.Label.DOM = new Class({ Implements: Graph.Label.DOM, /* placeLabel Overrides abstract method placeLabel in <Graph.Plot>. Parameters: tag - A DOM label element. node - A <Graph.Node>. controller - A configuration/controller object passed to the visualization. */ placeLabel: function(tag, node, controller) { var pos = node.pos.getc(true), config = this.viz.config, dim = config.Node, canvas = this.viz.canvas, w = node.getData('width'), h = node.getData('height'), radius = canvas.getSize(), labelPos, orn; var ox = canvas.translateOffsetX, oy = canvas.translateOffsetY, sx = canvas.scaleOffsetX, sy = canvas.scaleOffsetY, posx = pos.x * sx + ox, posy = pos.y * sy + oy; if(dim.align == "center") { labelPos= { x: Math.round(posx - w / 2 + radius.width/2), y: Math.round(posy - h / 2 + radius.height/2) }; } else if (dim.align == "left") { orn = config.orientation; if(orn == "bottom" || orn == "top") { labelPos= { x: Math.round(posx - w / 2 + radius.width/2), y: Math.round(posy + radius.height/2) }; } else { labelPos= { x: Math.round(posx + radius.width/2), y: Math.round(posy - h / 2 + radius.height/2) }; } } else if(dim.align == "right") { orn = config.orientation; if(orn == "bottom" || orn == "top") { labelPos= { x: Math.round(posx - w / 2 + radius.width/2), y: Math.round(posy - h + radius.height/2) }; } else { labelPos= { x: Math.round(posx - w + radius.width/2), y: Math.round(posy - h / 2 + radius.height/2) }; } } else throw "align: not implemented"; var style = tag.style; style.left = labelPos.x + 'px'; style.top = labelPos.y + 'px'; style.display = this.fitsInCanvas(labelPos, canvas)? '' : 'none'; controller.onPlaceLabel(tag, node); } }); /* ST.Label.SVG Custom extension of <Graph.Label.SVG>. Extends: All <Graph.Label.SVG> methods See also: <Graph.Label.SVG> */ $jit.ST.Label.SVG = new Class({ Implements: [$jit.ST.Label.DOM, Graph.Label.SVG], initialize: function(viz) { this.viz = viz; } }); /* ST.Label.HTML Custom extension of <Graph.Label.HTML>. Extends: All <Graph.Label.HTML> methods. See also: <Graph.Label.HTML> */ $jit.ST.Label.HTML = new Class({ Implements: [$jit.ST.Label.DOM, Graph.Label.HTML], initialize: function(viz) { this.viz = viz; } }); /* Class: ST.Plot.NodeTypes This class contains a list of <Graph.Node> built-in types. Node types implemented are 'none', 'circle', 'rectangle', 'ellipse' and 'square'. You can add your custom node types, customizing your visualization to the extreme. Example: (start code js) ST.Plot.NodeTypes.implement({ 'mySpecialType': { 'render': function(node, canvas) { //print your custom node to canvas }, //optional 'contains': function(node, pos) { //return true if pos is inside the node or false otherwise } } }); (end code) */ $jit.ST.Plot.NodeTypes = new Class({ 'none': { 'render': $.empty, 'contains': $.lambda(false) }, 'circle': { 'render': function(node, canvas) { var dim = node.getData('dim'), pos = this.getAlignedPos(node.pos.getc(true), dim, dim), dim2 = dim/2; this.nodeHelper.circle.render('fill', {x:pos.x+dim2, y:pos.y+dim2}, dim2, canvas); }, 'contains': function(node, pos) { var dim = node.getData('dim'), npos = this.getAlignedPos(node.pos.getc(true), dim, dim), dim2 = dim/2; this.nodeHelper.circle.contains({x:npos.x+dim2, y:npos.y+dim2}, dim2); } }, 'square': { 'render': function(node, canvas) { var dim = node.getData('dim'), dim2 = dim/2, pos = this.getAlignedPos(node.pos.getc(true), dim, dim); this.nodeHelper.square.render('fill', {x:pos.x+dim2, y:pos.y+dim2}, dim2, canvas); }, 'contains': function(node, pos) { var dim = node.getData('dim'), npos = this.getAlignedPos(node.pos.getc(true), dim, dim), dim2 = dim/2; this.nodeHelper.square.contains({x:npos.x+dim2, y:npos.y+dim2}, dim2); } }, 'ellipse': { 'render': function(node, canvas) { var width = node.getData('width'), height = node.getData('height'), pos = this.getAlignedPos(node.pos.getc(true), width, height); this.nodeHelper.ellipse.render('fill', {x:pos.x+width/2, y:pos.y+height/2}, width, height, canvas); }, 'contains': function(node, pos) { var width = node.getData('width'), height = node.getData('height'), npos = this.getAlignedPos(node.pos.getc(true), width, height); this.nodeHelper.ellipse.contains({x:npos.x+width/2, y:npos.y+height/2}, width, height, canvas); } }, 'rectangle': { 'render': function(node, canvas) { var width = node.getData('width'), height = node.getData('height'), pos = this.getAlignedPos(node.pos.getc(true), width, height); this.nodeHelper.rectangle.render('fill', {x:pos.x+width/2, y:pos.y+height/2}, width, height, canvas); }, 'contains': function(node, pos) { var width = node.getData('width'), height = node.getData('height'), npos = this.getAlignedPos(node.pos.getc(true), width, height); this.nodeHelper.rectangle.contains({x:npos.x+width/2, y:npos.y+height/2}, width, height, canvas); } } }); /* Class: ST.Plot.EdgeTypes This class contains a list of <Graph.Adjacence> built-in types. Edge types implemented are 'none', 'line', 'arrow', 'quadratic:begin', 'quadratic:end', 'bezier'. You can add your custom edge types, customizing your visualization to the extreme. Example: (start code js) ST.Plot.EdgeTypes.implement({ 'mySpecialType': { 'render': function(adj, canvas) { //print your custom edge to canvas }, //optional 'contains': function(adj, pos) { //return true if pos is inside the arc or false otherwise } } }); (end code) */ $jit.ST.Plot.EdgeTypes = new Class({ 'none': $.empty, 'line': { 'render': function(adj, canvas) { var orn = this.getOrientation(adj), nodeFrom = adj.nodeFrom, nodeTo = adj.nodeTo, rel = nodeFrom._depth < nodeTo._depth, from = this.viz.geom.getEdge(rel? nodeFrom:nodeTo, 'begin', orn), to = this.viz.geom.getEdge(rel? nodeTo:nodeFrom, 'end', orn); this.edgeHelper.line.render(from, to, canvas); }, 'contains': function(adj, pos) { var orn = this.getOrientation(adj), nodeFrom = adj.nodeFrom, nodeTo = adj.nodeTo, rel = nodeFrom._depth < nodeTo._depth, from = this.viz.geom.getEdge(rel? nodeFrom:nodeTo, 'begin', orn), to = this.viz.geom.getEdge(rel? nodeTo:nodeFrom, 'end', orn); return this.edgeHelper.line.contains(from, to, pos, this.edge.epsilon); } }, 'arrow': { 'render': function(adj, canvas) { var orn = this.getOrientation(adj), node = adj.nodeFrom, child = adj.nodeTo, dim = adj.getData('dim'), from = this.viz.geom.getEdge(node, 'begin', orn), to = this.viz.geom.getEdge(child, 'end', orn), direction = adj.data.$direction, inv = (direction && direction.length>1 && direction[0] != node.id); this.edgeHelper.arrow.render(from, to, dim, inv, canvas); }, 'contains': function(adj, pos) { var orn = this.getOrientation(adj), nodeFrom = adj.nodeFrom, nodeTo = adj.nodeTo, rel = nodeFrom._depth < nodeTo._depth, from = this.viz.geom.getEdge(rel? nodeFrom:nodeTo, 'begin', orn), to = this.viz.geom.getEdge(rel? nodeTo:nodeFrom, 'end', orn); return this.edgeHelper.arrow.contains(from, to, pos, this.edge.epsilon); } }, 'quadratic:begin': { 'render': function(adj, canvas) { var orn = this.getOrientation(adj); var nodeFrom = adj.nodeFrom, nodeTo = adj.nodeTo, rel = nodeFrom._depth < nodeTo._depth, begin = this.viz.geom.getEdge(rel? nodeFrom:nodeTo, 'begin', orn), end = this.viz.geom.getEdge(rel? nodeTo:nodeFrom, 'end', orn), dim = adj.getData('dim'), ctx = canvas.getCtx(); ctx.beginPath(); ctx.moveTo(begin.x, begin.y); switch(orn) { case "left": ctx.quadraticCurveTo(begin.x + dim, begin.y, end.x, end.y); break; case "right": ctx.quadraticCurveTo(begin.x - dim, begin.y, end.x, end.y); break; case "top": ctx.quadraticCurveTo(begin.x, begin.y + dim, end.x, end.y); break; case "bottom": ctx.quadraticCurveTo(begin.x, begin.y - dim, end.x, end.y); break; } ctx.stroke(); } }, 'quadratic:end': { 'render': function(adj, canvas) { var orn = this.getOrientation(adj); var nodeFrom = adj.nodeFrom, nodeTo = adj.nodeTo, rel = nodeFrom._depth < nodeTo._depth, begin = this.viz.geom.getEdge(rel? nodeFrom:nodeTo, 'begin', orn), end = this.viz.geom.getEdge(rel? nodeTo:nodeFrom, 'end', orn), dim = adj.getData('dim'), ctx = canvas.getCtx(); ctx.beginPath(); ctx.moveTo(begin.x, begin.y); switch(orn) { case "left": ctx.quadraticCurveTo(end.x - dim, end.y, end.x, end.y); break; case "right": ctx.quadraticCurveTo(end.x + dim, end.y, end.x, end.y); break; case "top": ctx.quadraticCurveTo(end.x, end.y - dim, end.x, end.y); break; case "bottom": ctx.quadraticCurveTo(end.x, end.y + dim, end.x, end.y); break; } ctx.stroke(); } }, 'bezier': { 'render': function(adj, canvas) { var orn = this.getOrientation(adj), nodeFrom = adj.nodeFrom, nodeTo = adj.nodeTo, rel = nodeFrom._depth < nodeTo._depth, begin = this.viz.geom.getEdge(rel? nodeFrom:nodeTo, 'begin', orn), end = this.viz.geom.getEdge(rel? nodeTo:nodeFrom, 'end', orn), dim = adj.getData('dim'), ctx = canvas.getCtx(); ctx.beginPath(); ctx.moveTo(begin.x, begin.y); switch(orn) { case "left": ctx.bezierCurveTo(begin.x + dim, begin.y, end.x - dim, end.y, end.x, end.y); break; case "right": ctx.bezierCurveTo(begin.x - dim, begin.y, end.x + dim, end.y, end.x, end.y); break; case "top": ctx.bezierCurveTo(begin.x, begin.y + dim, end.x, end.y - dim, end.x, end.y); break; case "bottom": ctx.bezierCurveTo(begin.x, begin.y - dim, end.x, end.y + dim, end.x, end.y); break; } ctx.stroke(); } } }); Options.LineChart = { $extend: true, animate: false, labelOffset: 3, // label offset type: 'basic', // gradient dataPointSize: 10, Tips: { enable: false, onShow: $.empty, onHide: $.empty }, Ticks: { enable: false, segments: 4, color: '#000000' }, Events: { enable: false, onClick: $.empty }, selectOnHover: true, showAggregates: true, showLabels: true, filterOnClick: false, restoreOnRightClick: false }; /* * File: LineChart.js * */ $jit.ST.Plot.NodeTypes.implement({ 'linechart-basic' : { 'render' : function(node, canvas) { var pos = node.pos.getc(true), width = node.getData('width'), height = node.getData('height'), algnPos = this.getAlignedPos(pos, width, height), x = algnPos.x + width/2 , y = algnPos.y, stringArray = node.getData('stringArray'), lastNode = node.getData('lastNode'), dimArray = node.getData('dimArray'), valArray = node.getData('valueArray'), colorArray = node.getData('colorArray'), colorLength = colorArray.length, config = node.getData('config'), gradient = node.getData('gradient'), showLabels = config.showLabels, aggregates = config.showAggregates, label = config.Label, prev = node.getData('prev'), dataPointSize = config.dataPointSize; var ctx = canvas.getCtx(), border = node.getData('border'); if (colorArray && dimArray && stringArray) { for (var i=0, l=dimArray.length, acumLeft=0, acumRight=0, valAcum=0; i<l; i++) { ctx.fillStyle = ctx.strokeStyle = colorArray[i % colorLength]; ctx.lineWidth = 4; ctx.lineCap = "round"; if(!lastNode) { ctx.save(); //render line segment, dimarray[i][0] is the curent datapoint, dimarrya[i][1] is the next datapoint, we need both in the current iteration to draw the line segment ctx.beginPath(); ctx.moveTo(x, y - dimArray[i][0]); ctx.lineTo(x + width, y - dimArray[i][1]); ctx.stroke(); ctx.restore(); } //render data point ctx.fillRect(x - (dataPointSize/2), y - dimArray[i][0] - (dataPointSize/2),dataPointSize,dataPointSize); } if(label.type == 'Native' && showLabels) { //bottom labels ctx.fillStyle = ctx.strokeStyle = label.color; ctx.font = label.style + ' ' + label.size + 'px ' + label.family; ctx.textAlign = 'center'; ctx.textBaseline = 'middle'; ctx.fillText(node.name, x, y + label.size + config.labelOffset); } } }, 'contains': function(node, mpos) { var pos = node.pos.getc(true), width = node.getData('width'), height = node.getData('height'), config = node.getData('config'), dataPointSize = config.dataPointSize, dataPointMidPoint = dataPointSize/2, algnPos = this.getAlignedPos(pos, width, height), x = algnPos.x + width/2, y = algnPos.y, dimArray = node.getData('dimArray'); //bounding box check if(mpos.x < x - dataPointMidPoint || mpos.x > x + dataPointMidPoint) { return false; } //deep check for(var i=0, l=dimArray.length; i<l; i++) { var dimi = dimArray[i]; var url = Url.decode(node.getData('linkArray')[i]); if(mpos.x >= x - dataPointMidPoint && mpos.x <= x + dataPointMidPoint && mpos.y >= y - dimi[0] - dataPointMidPoint && mpos.y <= y - dimi[0] + dataPointMidPoint) { var valArrayCur = node.getData('valArrayCur'); var results = array_match(valArrayCur[i],valArrayCur); var matches = results[0]; var indexValues = results[1]; if(matches > 1) { var names = new Array(), values = new Array(), percentages = new Array(), linksArr = new Array(); for(var j=0, il=indexValues.length; j<il; j++) { names[j] = node.getData('stringArray')[indexValues[j]]; values[j] = valArrayCur[indexValues[j]]; percentages[j] = ((valArrayCur[indexValues[j]]/node.getData('groupTotalValue')) * 100).toFixed(1); linksArr[j] = Url.decode(node.getData('linkArray')[j]); } return { 'name': names, 'color': node.getData('colorArray')[i], 'value': values, 'percentage': percentages, 'link': false, 'collision': true }; } else { return { 'name': node.getData('stringArray')[i], 'color': node.getData('colorArray')[i], 'value': node.getData('valueArray')[i][0], // 'value': node.getData('valueArray')[i][0] + " - mx:" + mpos.x + " x:" + x + " my:" + mpos.y + " y:" + y + " h:" + height + " w:" + width, 'percentage': ((node.getData('valueArray')[i][0]/node.getData('groupTotalValue')) * 100).toFixed(1), 'link': url, 'collision': false }; } } } return false; } } }); /* Class: Line A visualization that displays line charts. Constructor Options: See <Options.Line>. */ $jit.LineChart = new Class({ st: null, colors: ["#416D9C", "#70A35E", "#EBB056", "#C74243", "#83548B", "#909291", "#557EAA"], selected: {}, busy: false, initialize: function(opt) { this.controller = this.config = $.merge(Options("Canvas", "Margin", "Label", "LineChart"), { Label: { type: 'Native' } }, opt); //set functions for showLabels and showAggregates var showLabels = this.config.showLabels, typeLabels = $.type(showLabels), showAggregates = this.config.showAggregates, typeAggregates = $.type(showAggregates); this.config.showLabels = typeLabels == 'function'? showLabels : $.lambda(showLabels); this.config.showAggregates = typeAggregates == 'function'? showAggregates : $.lambda(showAggregates); Options.Fx.clearCanvas = false; this.initializeViz(); }, initializeViz: function() { var config = this.config, that = this, nodeType = config.type.split(":")[0], nodeLabels = {}; var st = new $jit.ST({ injectInto: config.injectInto, orientation: "bottom", backgroundColor: config.backgroundColor, renderBackground: config.renderBackground, levelDistance: 0, siblingOffset: 0, subtreeOffset: 0, withLabels: config.Label.type != 'Native', useCanvas: config.useCanvas, Label: { type: config.Label.type }, Node: { overridable: true, type: 'linechart-' + nodeType, align: 'left', width: 1, height: 1 }, Edge: { type: 'none' }, Tips: { enable: config.Tips.enable, type: 'Native', force: true, onShow: function(tip, node, contains) { var elem = contains; config.Tips.onShow(tip, elem, node); } }, Events: { enable: true, type: 'Native', onClick: function(node, eventInfo, evt) { if(!config.filterOnClick && !config.Events.enable) return; var elem = eventInfo.getContains(); if(elem) config.filterOnClick && that.filter(elem.name); config.Events.enable && config.Events.onClick(elem, eventInfo, evt); }, onRightClick: function(node, eventInfo, evt) { if(!config.restoreOnRightClick) return; that.restore(); }, onMouseMove: function(node, eventInfo, evt) { if(!config.selectOnHover) return; if(node) { var elem = eventInfo.getContains(); that.select(node.id, elem.name, elem.index); } else { that.select(false, false, false); } } }, onCreateLabel: function(domElement, node) { var labelConf = config.Label, valueArray = node.getData('valueArray'), acumLeft = $.reduce(valueArray, function(x, y) { return x + y[0]; }, 0), acumRight = $.reduce(valueArray, function(x, y) { return x + y[1]; }, 0); if(node.getData('prev')) { var nlbs = { wrapper: document.createElement('div'), aggregate: document.createElement('div'), label: document.createElement('div') }; var wrapper = nlbs.wrapper, label = nlbs.label, aggregate = nlbs.aggregate, wrapperStyle = wrapper.style, labelStyle = label.style, aggregateStyle = aggregate.style; //store node labels nodeLabels[node.id] = nlbs; //append labels wrapper.appendChild(label); wrapper.appendChild(aggregate); if(!config.showLabels(node.name, acumLeft, acumRight, node)) { label.style.display = 'none'; } if(!config.showAggregates(node.name, acumLeft, acumRight, node)) { aggregate.style.display = 'none'; } wrapperStyle.position = 'relative'; wrapperStyle.overflow = 'visible'; wrapperStyle.fontSize = labelConf.size + 'px'; wrapperStyle.fontFamily = labelConf.family; wrapperStyle.color = labelConf.color; wrapperStyle.textAlign = 'center'; aggregateStyle.position = labelStyle.position = 'absolute'; domElement.style.width = node.getData('width') + 'px'; domElement.style.height = node.getData('height') + 'px'; label.innerHTML = node.name; domElement.appendChild(wrapper); } }, onPlaceLabel: function(domElement, node) { if(!node.getData('prev')) return; var labels = nodeLabels[node.id], wrapperStyle = labels.wrapper.style, labelStyle = labels.label.style, aggregateStyle = labels.aggregate.style, width = node.getData('width'), height = node.getData('height'), dimArray = node.getData('dimArray'), valArray = node.getData('valueArray'), acumLeft = $.reduce(valArray, function(x, y) { return x + y[0]; }, 0), acumRight = $.reduce(valArray, function(x, y) { return x + y[1]; }, 0), font = parseInt(wrapperStyle.fontSize, 10), domStyle = domElement.style; if(dimArray && valArray) { if(config.showLabels(node.name, acumLeft, acumRight, node)) { labelStyle.display = ''; } else { labelStyle.display = 'none'; } if(config.showAggregates(node.name, acumLeft, acumRight, node)) { aggregateStyle.display = ''; } else { aggregateStyle.display = 'none'; } wrapperStyle.width = aggregateStyle.width = labelStyle.width = domElement.style.width = width + 'px'; aggregateStyle.left = labelStyle.left = -width/2 + 'px'; for(var i=0, l=valArray.length, acum=0, leftAcum=0; i<l; i++) { if(dimArray[i][0] > 0) { acum+= valArray[i][0]; leftAcum+= dimArray[i][0]; } } aggregateStyle.top = (-font - config.labelOffset) + 'px'; labelStyle.top = (config.labelOffset + leftAcum) + 'px'; domElement.style.top = parseInt(domElement.style.top, 10) - leftAcum + 'px'; domElement.style.height = wrapperStyle.height = leftAcum + 'px'; labels.aggregate.innerHTML = acum; } } }); var size = st.canvas.getSize(), margin = config.Margin; st.config.offsetY = -size.height/2 + margin.bottom + (config.showLabels && (config.labelOffset + config.Label.size)); st.config.offsetX = (margin.right - margin.left - config.labelOffset - config.Label.size)/2; this.st = st; this.canvas = this.st.canvas; }, renderTitle: function() { var canvas = this.canvas, size = canvas.getSize(), config = this.config, margin = config.Margin, label = config.Label, title = config.Title; ctx = canvas.getCtx(); ctx.fillStyle = title.color; ctx.textAlign = 'left'; ctx.textBaseline = 'top'; ctx.font = label.style + ' bold ' +' ' + title.size + 'px ' + label.family; if(label.type == 'Native') { ctx.fillText(title.text, -size.width/2+margin.left, -size.height/2+margin.top); } }, renderTicks: function() { var canvas = this.canvas, size = canvas.getSize(), config = this.config, margin = config.Margin, ticks = config.Ticks, title = config.Title, subtitle = config.Subtitle, label = config.Label, maxValue = this.maxValue, maxTickValue = Math.ceil(maxValue*.1)*10; if(maxTickValue == maxValue) { var length = maxTickValue.toString().length; maxTickValue = maxTickValue + parseInt(pad(1,length)); } labelValue = 0, labelIncrement = maxTickValue/ticks.segments, ctx = canvas.getCtx(); ctx.strokeStyle = ticks.color; ctx.font = label.style + ' ' + label.size + 'px ' + label.family; ctx.textAlign = 'center'; ctx.textBaseline = 'middle'; idLabel = canvas.id + "-label"; labelDim = 100; container = document.getElementById(idLabel); var axis = (size.height/2)-(margin.bottom+config.labelOffset+label.size+(subtitle.text? subtitle.size+subtitle.offset:0)), htmlOrigin = size.height - (margin.bottom+config.labelOffset+label.size+(subtitle.text? subtitle.size+subtitle.offset:0)), grid = -size.height+(margin.bottom+config.labelOffset+label.size+margin.top+(title.text? title.size+title.offset:0)+(subtitle.text? subtitle.size+subtitle.offset:0)), segmentLength = grid/ticks.segments; ctx.fillStyle = ticks.color; ctx.fillRect(-(size.width/2)+margin.left+config.labelOffset+label.size-1, -(size.height/2)+margin.top+(title.text? title.size+title.offset:0),1,size.height-margin.top-margin.bottom-label.size-config.labelOffset-(title.text? title.size+title.offset:0)-(subtitle.text? subtitle.size+subtitle.offset:0)); while(axis>=grid) { ctx.save(); ctx.translate(-(size.width/2)+margin.left, Math.round(axis)); ctx.rotate(Math.PI / 2); ctx.fillStyle = label.color; if(config.showLabels) { if(label.type == 'Native') { ctx.fillText(labelValue, 0, 0); } else { //html labels on y axis labelDiv = document.createElement('div'); labelDiv.innerHTML = labelValue; labelDiv.className = "rotatedLabel"; // labelDiv.class = "rotatedLabel"; labelDiv.style.top = (htmlOrigin - (labelDim/2)) + "px"; labelDiv.style.left = margin.left + "px"; labelDiv.style.width = labelDim + "px"; labelDiv.style.height = labelDim + "px"; labelDiv.style.textAlign = "center"; labelDiv.style.verticalAlign = "middle"; labelDiv.style.position = "absolute"; container.appendChild(labelDiv); } } ctx.restore(); ctx.fillStyle = ticks.color; ctx.fillRect(-(size.width/2)+margin.left+config.labelOffset+label.size, Math.round(axis), size.width-margin.right-margin.left-config.labelOffset-label.size,1 ); htmlOrigin += segmentLength; axis += segmentLength; labelValue += labelIncrement; } }, renderBackground: function() { var canvas = this.canvas, config = this.config, backgroundColor = config.backgroundColor, size = canvas.getSize(), ctx = canvas.getCtx(); //ctx.globalCompositeOperation = "destination-over"; ctx.fillStyle = backgroundColor; ctx.fillRect(-size.width/2,-size.height/2,size.width,size.height); }, clear: function() { var canvas = this.canvas; var ctx = canvas.getCtx(), size = canvas.getSize(); ctx.fillStyle = "rgba(255,255,255,0)"; ctx.fillRect(-size.width/2,-size.height/2,size.width,size.height); ctx.clearRect(-size.width/2,-size.height/2,size.width,size.height); }, resizeGraph: function(json,width) { var canvas = this.canvas, size = canvas.getSize(), orgHeight = size.height; canvas.resize(width,orgHeight); if(typeof FlashCanvas == "undefined") { canvas.clear(); } else { this.clear();// hack for flashcanvas bug not properly clearing rectangle } this.loadJSON(json); }, /* Method: loadJSON Loads JSON data into the visualization. Parameters: json - The JSON data format. This format is described in <http://blog.thejit.org/2010/04/24/new-javascript-infovis-toolkit-visualizations/#json-data-format>. Example: (start code js) var areaChart = new $jit.AreaChart(options); areaChart.loadJSON(json); (end code) */ loadJSON: function(json) { var prefix = $.time(), ch = [], st = this.st, name = $.splat(json.label), color = $.splat(json.color || this.colors), config = this.config, ticks = config.Ticks, renderBackground = config.renderBackground, gradient = !!config.type.split(":")[1], animate = config.animate, title = config.Title, groupTotalValue = 0; var valArrayAll = new Array(); for(var i=0, values=json.values, l=values.length; i<l; i++) { var val = values[i]; var valArray = $.splat(val.values); for (var j=0, len=valArray.length; j<len; j++) { valArrayAll.push(parseInt(valArray[j])); } groupTotalValue += parseInt(valArray.sum()); } this.maxValue = Math.max.apply(null, valArrayAll); for(var i=0, values=json.values, l=values.length; i<l; i++) { var val = values[i], prev = values[i-1]; var next = (i+1 < l) ? values[i+1] : 0; var valLeft = $.splat(values[i].values); var valRight = (i+1 < l) ? $.splat(values[i+1].values) : 0; var valArray = $.zip(valLeft, valRight); var valArrayCur = $.splat(values[i].values); var linkArray = $.splat(values[i].links); var acumLeft = 0, acumRight = 0; var lastNode = (l-1 == i) ? true : false; ch.push({ 'id': prefix + val.label, 'name': val.label, 'data': { 'value': valArray, '$valueArray': valArray, '$valArrayCur': valArrayCur, '$colorArray': color, '$linkArray': linkArray, '$stringArray': name, '$next': next? next.label:false, '$prev': prev? prev.label:false, '$config': config, '$lastNode': lastNode, '$groupTotalValue': groupTotalValue, '$gradient': gradient }, 'children': [] }); } var root = { 'id': prefix + '$root', 'name': '', 'data': { '$type': 'none', '$width': 1, '$height': 1 }, 'children': ch }; st.loadJSON(root); this.normalizeDims(); if(renderBackground) { this.renderBackground(); } if(!animate && ticks.enable) { this.renderTicks(); } if(title.text) { this.renderTitle(); } st.compute(); st.select(st.root); if(animate) { st.fx.animate({ modes: ['node-property:height:dimArray'], duration:1500 }); } }, /* Method: updateJSON Use this method when updating values for the current JSON data. If the items specified by the JSON data already exist in the graph then their values will be updated. Parameters: json - (object) JSON data to be updated. The JSON format corresponds to the one described in <AreaChart.loadJSON>. onComplete - (object) A callback object to be called when the animation transition when updating the data end. Example: (start code js) areaChart.updateJSON(json, { onComplete: function() { alert('update complete!'); } }); (end code) */ updateJSON: function(json, onComplete) { if(this.busy) return; this.busy = true; var st = this.st, graph = st.graph, labels = json.label && $.splat(json.label), values = json.values, animate = this.config.animate, that = this; $.each(values, function(v) { var n = graph.getByName(v.label); if(n) { v.values = $.splat(v.values); var stringArray = n.getData('stringArray'), valArray = n.getData('valueArray'); $.each(valArray, function(a, i) { a[0] = v.values[i]; if(labels) stringArray[i] = labels[i]; }); n.setData('valueArray', valArray); var prev = n.getData('prev'), next = n.getData('next'), nextNode = graph.getByName(next); if(prev) { var p = graph.getByName(prev); if(p) { var valArray = p.getData('valueArray'); $.each(valArray, function(a, i) { a[1] = v.values[i]; }); } } if(!nextNode) { var valArray = n.getData('valueArray'); $.each(valArray, function(a, i) { a[1] = v.values[i]; }); } } }); this.normalizeDims(); st.compute(); st.select(st.root); if(animate) { st.fx.animate({ modes: ['node-property:height:dimArray'], duration:1500, onComplete: function() { that.busy = false; onComplete && onComplete.onComplete(); } }); } }, /* Method: filter Filter selected stacks, collapsing all other stacks. You can filter multiple stacks at the same time. Parameters: Variable strings arguments with the name of the stacks. Example: (start code js) areaChart.filter('label A', 'label C'); (end code) See also: <AreaChart.restore>. */ filter: function() { if(this.busy) return; this.busy = true; if(this.config.Tips.enable) this.st.tips.hide(); this.select(false, false, false); var args = Array.prototype.slice.call(arguments); var rt = this.st.graph.getNode(this.st.root); var that = this; rt.eachAdjacency(function(adj) { var n = adj.nodeTo, dimArray = n.getData('dimArray'), stringArray = n.getData('stringArray'); n.setData('dimArray', $.map(dimArray, function(d, i) { return ($.indexOf(args, stringArray[i]) > -1)? d:[0, 0]; }), 'end'); }); this.st.fx.animate({ modes: ['node-property:dimArray'], duration:1500, onComplete: function() { that.busy = false; } }); }, /* Method: restore Sets all stacks that could have been filtered visible. Example: (start code js) areaChart.restore(); (end code) See also: <AreaChart.filter>. */ restore: function() { if(this.busy) return; this.busy = true; if(this.config.Tips.enable) this.st.tips.hide(); this.select(false, false, false); this.normalizeDims(); var that = this; this.st.fx.animate({ modes: ['node-property:height:dimArray'], duration:1500, onComplete: function() { that.busy = false; } }); }, //adds the little brown bar when hovering the node select: function(id, name, index) { if(!this.config.selectOnHover) return; var s = this.selected; if(s.id != id || s.name != name || s.index != index) { s.id = id; s.name = name; s.index = index; this.st.graph.eachNode(function(n) { n.setData('border', false); }); if(id) { var n = this.st.graph.getNode(id); n.setData('border', s); var link = index === 0? 'prev':'next'; link = n.getData(link); if(link) { n = this.st.graph.getByName(link); if(n) { n.setData('border', { name: name, index: 1-index }); } } } this.st.plot(); } }, /* Method: getLegend Returns an object containing as keys the legend names and as values hex strings with color values. Example: (start code js) var legend = areaChart.getLegend(); (end code) */ getLegend: function() { var legend = new Array(); var name = new Array(); var color = new Array(); var n; this.st.graph.getNode(this.st.root).eachAdjacency(function(adj) { n = adj.nodeTo; }); var colors = n.getData('colorArray'), len = colors.length; $.each(n.getData('stringArray'), function(s, i) { color[i] = colors[i % len]; name[i] = s; }); legend['name'] = name; legend['color'] = color; return legend; }, /* Method: getMaxValue Returns the maximum accumulated value for the stacks. This method is used for normalizing the graph heights according to the canvas height. Example: (start code js) var ans = areaChart.getMaxValue(); (end code) In some cases it could be useful to override this method to normalize heights for a group of AreaCharts, like when doing small multiples. Example: (start code js) //will return 100 for all AreaChart instances, //displaying all of them with the same scale $jit.AreaChart.implement({ 'getMaxValue': function() { return 100; } }); (end code) */ normalizeDims: function() { //number of elements var root = this.st.graph.getNode(this.st.root), l=0; root.eachAdjacency(function() { l++; }); var maxValue = this.maxValue || 1, size = this.st.canvas.getSize(), config = this.config, margin = config.Margin, labelOffset = config.labelOffset + config.Label.size, fixedDim = (size.width - (margin.left + margin.right + labelOffset )) / (l-1), animate = config.animate, ticks = config.Ticks, height = size.height - (margin.top + margin.bottom) - (config.showAggregates && labelOffset) - (config.showLabels && labelOffset); var maxTickValue = Math.ceil(maxValue*.1)*10; if(maxTickValue == maxValue) { var length = maxTickValue.toString().length; maxTickValue = maxTickValue + parseInt(pad(1,length)); } this.st.graph.eachNode(function(n) { var acumLeft = 0, acumRight = 0, animateValue = []; $.each(n.getData('valueArray'), function(v) { acumLeft += +v[0]; acumRight += +v[1]; animateValue.push([0, 0]); }); var acum = acumRight>acumLeft? acumRight:acumLeft; n.setData('width', fixedDim); if(animate) { n.setData('height', acum * height / maxValue, 'end'); n.setData('dimArray', $.map(n.getData('valueArray'), function(n) { return [n[0] * height / maxValue, n[1] * height / maxValue]; }), 'end'); var dimArray = n.getData('dimArray'); if(!dimArray) { n.setData('dimArray', animateValue); } } else { if(ticks.enable) { n.setData('height', acum * height / maxValue); n.setData('dimArray', $.map(n.getData('valueArray'), function(n) { return [n[0] * height / maxTickValue, n[1] * height / maxTickValue]; })); } else { n.setData('height', acum * height / maxValue); n.setData('dimArray', $.map(n.getData('valueArray'), function(n) { return [n[0] * height / maxValue, n[1] * height / maxValue]; })); } } }); } }); /* * File: AreaChart.js * */ $jit.ST.Plot.NodeTypes.implement({ 'areachart-stacked' : { 'render' : function(node, canvas) { var pos = node.pos.getc(true), width = node.getData('width'), height = node.getData('height'), algnPos = this.getAlignedPos(pos, width, height), x = algnPos.x, y = algnPos.y, stringArray = node.getData('stringArray'), dimArray = node.getData('dimArray'), valArray = node.getData('valueArray'), valLeft = $.reduce(valArray, function(x, y) { return x + y[0]; }, 0), valRight = $.reduce(valArray, function(x, y) { return x + y[1]; }, 0), colorArray = node.getData('colorArray'), colorLength = colorArray.length, config = node.getData('config'), gradient = node.getData('gradient'), showLabels = config.showLabels, aggregates = config.showAggregates, label = config.Label, prev = node.getData('prev'); var ctx = canvas.getCtx(), border = node.getData('border'); if (colorArray && dimArray && stringArray) { for (var i=0, l=dimArray.length, acumLeft=0, acumRight=0, valAcum=0; i<l; i++) { ctx.fillStyle = ctx.strokeStyle = colorArray[i % colorLength]; ctx.save(); if(gradient && (dimArray[i][0] > 0 || dimArray[i][1] > 0)) { var h1 = acumLeft + dimArray[i][0], h2 = acumRight + dimArray[i][1], alpha = Math.atan((h2 - h1) / width), delta = 55; var linear = ctx.createLinearGradient(x + width/2, y - (h1 + h2)/2, x + width/2 + delta * Math.sin(alpha), y - (h1 + h2)/2 + delta * Math.cos(alpha)); var color = $.rgbToHex($.map($.hexToRgb(colorArray[i % colorLength].slice(1)), function(v) { return (v * 0.85) >> 0; })); linear.addColorStop(0, colorArray[i % colorLength]); linear.addColorStop(1, color); ctx.fillStyle = linear; } ctx.beginPath(); ctx.moveTo(x, y - acumLeft); ctx.lineTo(x + width, y - acumRight); ctx.lineTo(x + width, y - acumRight - dimArray[i][1]); ctx.lineTo(x, y - acumLeft - dimArray[i][0]); ctx.lineTo(x, y - acumLeft); ctx.fill(); ctx.restore(); if(border) { var strong = border.name == stringArray[i]; var perc = strong? 0.7 : 0.8; var color = $.rgbToHex($.map($.hexToRgb(colorArray[i % colorLength].slice(1)), function(v) { return (v * perc) >> 0; })); ctx.strokeStyle = color; ctx.lineWidth = strong? 4 : 1; ctx.save(); ctx.beginPath(); if(border.index === 0) { ctx.moveTo(x, y - acumLeft); ctx.lineTo(x, y - acumLeft - dimArray[i][0]); } else { ctx.moveTo(x + width, y - acumRight); ctx.lineTo(x + width, y - acumRight - dimArray[i][1]); } ctx.stroke(); ctx.restore(); } acumLeft += (dimArray[i][0] || 0); acumRight += (dimArray[i][1] || 0); if(dimArray[i][0] > 0) valAcum += (valArray[i][0] || 0); } if(prev && label.type == 'Native') { ctx.save(); ctx.beginPath(); ctx.fillStyle = ctx.strokeStyle = label.color; ctx.font = label.style + ' ' + label.size + 'px ' + label.family; ctx.textAlign = 'center'; ctx.textBaseline = 'middle'; if(aggregates(node.name, valLeft, valRight, node)) { ctx.fillText(valAcum, x, y - acumLeft - config.labelOffset - label.size/2, width); } if(showLabels(node.name, valLeft, valRight, node)) { ctx.fillText(node.name, x, y + label.size/2 + config.labelOffset); } ctx.restore(); } } }, 'contains': function(node, mpos) { var pos = node.pos.getc(true), width = node.getData('width'), height = node.getData('height'), algnPos = this.getAlignedPos(pos, width, height), x = algnPos.x, y = algnPos.y, dimArray = node.getData('dimArray'), rx = mpos.x - x; //bounding box check if(mpos.x < x || mpos.x > x + width || mpos.y > y || mpos.y < y - height) { return false; } //deep check for(var i=0, l=dimArray.length, lAcum=y, rAcum=y; i<l; i++) { var dimi = dimArray[i]; lAcum -= dimi[0]; rAcum -= dimi[1]; var intersec = lAcum + (rAcum - lAcum) * rx / width; if(mpos.y >= intersec) { var index = +(rx > width/2); return { 'name': node.getData('stringArray')[i], 'color': node.getData('colorArray')[i], 'value': node.getData('valueArray')[i][index], 'index': index }; } } return false; } } }); /* Class: AreaChart A visualization that displays stacked area charts. Constructor Options: See <Options.AreaChart>. */ $jit.AreaChart = new Class({ st: null, colors: ["#416D9C", "#70A35E", "#EBB056", "#C74243", "#83548B", "#909291", "#557EAA"], selected: {}, busy: false, initialize: function(opt) { this.controller = this.config = $.merge(Options("Canvas", "Margin", "Label", "AreaChart"), { Label: { type: 'Native' } }, opt); //set functions for showLabels and showAggregates var showLabels = this.config.showLabels, typeLabels = $.type(showLabels), showAggregates = this.config.showAggregates, typeAggregates = $.type(showAggregates); this.config.showLabels = typeLabels == 'function'? showLabels : $.lambda(showLabels); this.config.showAggregates = typeAggregates == 'function'? showAggregates : $.lambda(showAggregates); this.initializeViz(); }, initializeViz: function() { var config = this.config, that = this, nodeType = config.type.split(":")[0], nodeLabels = {}; var st = new $jit.ST({ injectInto: config.injectInto, orientation: "bottom", levelDistance: 0, siblingOffset: 0, subtreeOffset: 0, withLabels: config.Label.type != 'Native', useCanvas: config.useCanvas, Label: { type: config.Label.type }, Node: { overridable: true, type: 'areachart-' + nodeType, align: 'left', width: 1, height: 1 }, Edge: { type: 'none' }, Tips: { enable: config.Tips.enable, type: 'Native', force: true, onShow: function(tip, node, contains) { var elem = contains; config.Tips.onShow(tip, elem, node); } }, Events: { enable: true, type: 'Native', onClick: function(node, eventInfo, evt) { if(!config.filterOnClick && !config.Events.enable) return; var elem = eventInfo.getContains(); if(elem) config.filterOnClick && that.filter(elem.name); config.Events.enable && config.Events.onClick(elem, eventInfo, evt); }, onRightClick: function(node, eventInfo, evt) { if(!config.restoreOnRightClick) return; that.restore(); }, onMouseMove: function(node, eventInfo, evt) { if(!config.selectOnHover) return; if(node) { var elem = eventInfo.getContains(); that.select(node.id, elem.name, elem.index); } else { that.select(false, false, false); } } }, onCreateLabel: function(domElement, node) { var labelConf = config.Label, valueArray = node.getData('valueArray'), acumLeft = $.reduce(valueArray, function(x, y) { return x + y[0]; }, 0), acumRight = $.reduce(valueArray, function(x, y) { return x + y[1]; }, 0); if(node.getData('prev')) { var nlbs = { wrapper: document.createElement('div'), aggregate: document.createElement('div'), label: document.createElement('div') }; var wrapper = nlbs.wrapper, label = nlbs.label, aggregate = nlbs.aggregate, wrapperStyle = wrapper.style, labelStyle = label.style, aggregateStyle = aggregate.style; //store node labels nodeLabels[node.id] = nlbs; //append labels wrapper.appendChild(label); wrapper.appendChild(aggregate); if(!config.showLabels(node.name, acumLeft, acumRight, node)) { label.style.display = 'none'; } if(!config.showAggregates(node.name, acumLeft, acumRight, node)) { aggregate.style.display = 'none'; } wrapperStyle.position = 'relative'; wrapperStyle.overflow = 'visible'; wrapperStyle.fontSize = labelConf.size + 'px'; wrapperStyle.fontFamily = labelConf.family; wrapperStyle.color = labelConf.color; wrapperStyle.textAlign = 'center'; aggregateStyle.position = labelStyle.position = 'absolute'; domElement.style.width = node.getData('width') + 'px'; domElement.style.height = node.getData('height') + 'px'; label.innerHTML = node.name; domElement.appendChild(wrapper); } }, onPlaceLabel: function(domElement, node) { if(!node.getData('prev')) return; var labels = nodeLabels[node.id], wrapperStyle = labels.wrapper.style, labelStyle = labels.label.style, aggregateStyle = labels.aggregate.style, width = node.getData('width'), height = node.getData('height'), dimArray = node.getData('dimArray'), valArray = node.getData('valueArray'), acumLeft = $.reduce(valArray, function(x, y) { return x + y[0]; }, 0), acumRight = $.reduce(valArray, function(x, y) { return x + y[1]; }, 0), font = parseInt(wrapperStyle.fontSize, 10), domStyle = domElement.style; if(dimArray && valArray) { if(config.showLabels(node.name, acumLeft, acumRight, node)) { labelStyle.display = ''; } else { labelStyle.display = 'none'; } if(config.showAggregates(node.name, acumLeft, acumRight, node)) { aggregateStyle.display = ''; } else { aggregateStyle.display = 'none'; } wrapperStyle.width = aggregateStyle.width = labelStyle.width = domElement.style.width = width + 'px'; aggregateStyle.left = labelStyle.left = -width/2 + 'px'; for(var i=0, l=valArray.length, acum=0, leftAcum=0; i<l; i++) { if(dimArray[i][0] > 0) { acum+= valArray[i][0]; leftAcum+= dimArray[i][0]; } } aggregateStyle.top = (-font - config.labelOffset) + 'px'; labelStyle.top = (config.labelOffset + leftAcum) + 'px'; domElement.style.top = parseInt(domElement.style.top, 10) - leftAcum + 'px'; domElement.style.height = wrapperStyle.height = leftAcum + 'px'; labels.aggregate.innerHTML = acum; } } }); var size = st.canvas.getSize(), margin = config.Margin; st.config.offsetY = -size.height/2 + margin.bottom + (config.showLabels && (config.labelOffset + config.Label.size)); st.config.offsetX = (margin.right - margin.left)/2; this.st = st; this.canvas = this.st.canvas; }, /* Method: loadJSON Loads JSON data into the visualization. Parameters: json - The JSON data format. This format is described in <http://blog.thejit.org/2010/04/24/new-javascript-infovis-toolkit-visualizations/#json-data-format>. Example: (start code js) var areaChart = new $jit.AreaChart(options); areaChart.loadJSON(json); (end code) */ loadJSON: function(json) { var prefix = $.time(), ch = [], st = this.st, name = $.splat(json.label), color = $.splat(json.color || this.colors), config = this.config, gradient = !!config.type.split(":")[1], animate = config.animate; for(var i=0, values=json.values, l=values.length; i<l-1; i++) { var val = values[i], prev = values[i-1], next = values[i+1]; var valLeft = $.splat(values[i].values), valRight = $.splat(values[i+1].values); var valArray = $.zip(valLeft, valRight); var acumLeft = 0, acumRight = 0; ch.push({ 'id': prefix + val.label, 'name': val.label, 'data': { 'value': valArray, '$valueArray': valArray, '$colorArray': color, '$stringArray': name, '$next': next.label, '$prev': prev? prev.label:false, '$config': config, '$gradient': gradient }, 'children': [] }); } var root = { 'id': prefix + '$root', 'name': '', 'data': { '$type': 'none', '$width': 1, '$height': 1 }, 'children': ch }; st.loadJSON(root); this.normalizeDims(); st.compute(); st.select(st.root); if(animate) { st.fx.animate({ modes: ['node-property:height:dimArray'], duration:1500 }); } }, /* Method: updateJSON Use this method when updating values for the current JSON data. If the items specified by the JSON data already exist in the graph then their values will be updated. Parameters: json - (object) JSON data to be updated. The JSON format corresponds to the one described in <AreaChart.loadJSON>. onComplete - (object) A callback object to be called when the animation transition when updating the data end. Example: (start code js) areaChart.updateJSON(json, { onComplete: function() { alert('update complete!'); } }); (end code) */ updateJSON: function(json, onComplete) { if(this.busy) return; this.busy = true; var st = this.st, graph = st.graph, labels = json.label && $.splat(json.label), values = json.values, animate = this.config.animate, that = this; $.each(values, function(v) { var n = graph.getByName(v.label); if(n) { v.values = $.splat(v.values); var stringArray = n.getData('stringArray'), valArray = n.getData('valueArray'); $.each(valArray, function(a, i) { a[0] = v.values[i]; if(labels) stringArray[i] = labels[i]; }); n.setData('valueArray', valArray); var prev = n.getData('prev'), next = n.getData('next'), nextNode = graph.getByName(next); if(prev) { var p = graph.getByName(prev); if(p) { var valArray = p.getData('valueArray'); $.each(valArray, function(a, i) { a[1] = v.values[i]; }); } } if(!nextNode) { var valArray = n.getData('valueArray'); $.each(valArray, function(a, i) { a[1] = v.values[i]; }); } } }); this.normalizeDims(); st.compute(); st.select(st.root); if(animate) { st.fx.animate({ modes: ['node-property:height:dimArray'], duration:1500, onComplete: function() { that.busy = false; onComplete && onComplete.onComplete(); } }); } }, /* Method: filter Filter selected stacks, collapsing all other stacks. You can filter multiple stacks at the same time. Parameters: Variable strings arguments with the name of the stacks. Example: (start code js) areaChart.filter('label A', 'label C'); (end code) See also: <AreaChart.restore>. */ filter: function() { if(this.busy) return; this.busy = true; if(this.config.Tips.enable) this.st.tips.hide(); this.select(false, false, false); var args = Array.prototype.slice.call(arguments); var rt = this.st.graph.getNode(this.st.root); var that = this; rt.eachAdjacency(function(adj) { var n = adj.nodeTo, dimArray = n.getData('dimArray'), stringArray = n.getData('stringArray'); n.setData('dimArray', $.map(dimArray, function(d, i) { return ($.indexOf(args, stringArray[i]) > -1)? d:[0, 0]; }), 'end'); }); this.st.fx.animate({ modes: ['node-property:dimArray'], duration:1500, onComplete: function() { that.busy = false; } }); }, /* Method: restore Sets all stacks that could have been filtered visible. Example: (start code js) areaChart.restore(); (end code) See also: <AreaChart.filter>. */ restore: function() { if(this.busy) return; this.busy = true; if(this.config.Tips.enable) this.st.tips.hide(); this.select(false, false, false); this.normalizeDims(); var that = this; this.st.fx.animate({ modes: ['node-property:height:dimArray'], duration:1500, onComplete: function() { that.busy = false; } }); }, //adds the little brown bar when hovering the node select: function(id, name, index) { if(!this.config.selectOnHover) return; var s = this.selected; if(s.id != id || s.name != name || s.index != index) { s.id = id; s.name = name; s.index = index; this.st.graph.eachNode(function(n) { n.setData('border', false); }); if(id) { var n = this.st.graph.getNode(id); n.setData('border', s); var link = index === 0? 'prev':'next'; link = n.getData(link); if(link) { n = this.st.graph.getByName(link); if(n) { n.setData('border', { name: name, index: 1-index }); } } } this.st.plot(); } }, /* Method: getLegend Returns an object containing as keys the legend names and as values hex strings with color values. Example: (start code js) var legend = areaChart.getLegend(); (end code) */ getLegend: function() { var legend = {}; var n; this.st.graph.getNode(this.st.root).eachAdjacency(function(adj) { n = adj.nodeTo; }); var colors = n.getData('colorArray'), len = colors.length; $.each(n.getData('stringArray'), function(s, i) { legend[s] = colors[i % len]; }); return legend; }, /* Method: getMaxValue Returns the maximum accumulated value for the stacks. This method is used for normalizing the graph heights according to the canvas height. Example: (start code js) var ans = areaChart.getMaxValue(); (end code) In some cases it could be useful to override this method to normalize heights for a group of AreaCharts, like when doing small multiples. Example: (start code js) //will return 100 for all AreaChart instances, //displaying all of them with the same scale $jit.AreaChart.implement({ 'getMaxValue': function() { return 100; } }); (end code) */ getMaxValue: function() { var maxValue = 0; this.st.graph.eachNode(function(n) { var valArray = n.getData('valueArray'), acumLeft = 0, acumRight = 0; $.each(valArray, function(v) { acumLeft += +v[0]; acumRight += +v[1]; }); var acum = acumRight>acumLeft? acumRight:acumLeft; maxValue = maxValue>acum? maxValue:acum; }); return maxValue; }, normalizeDims: function() { //number of elements var root = this.st.graph.getNode(this.st.root), l=0; root.eachAdjacency(function() { l++; }); var maxValue = this.getMaxValue() || 1, size = this.st.canvas.getSize(), config = this.config, margin = config.Margin, labelOffset = config.labelOffset + config.Label.size, fixedDim = (size.width - (margin.left + margin.right)) / l, animate = config.animate, height = size.height - (margin.top + margin.bottom) - (config.showAggregates && labelOffset) - (config.showLabels && labelOffset); this.st.graph.eachNode(function(n) { var acumLeft = 0, acumRight = 0, animateValue = []; $.each(n.getData('valueArray'), function(v) { acumLeft += +v[0]; acumRight += +v[1]; animateValue.push([0, 0]); }); var acum = acumRight>acumLeft? acumRight:acumLeft; n.setData('width', fixedDim); if(animate) { n.setData('height', acum * height / maxValue, 'end'); n.setData('dimArray', $.map(n.getData('valueArray'), function(n) { return [n[0] * height / maxValue, n[1] * height / maxValue]; }), 'end'); var dimArray = n.getData('dimArray'); if(!dimArray) { n.setData('dimArray', animateValue); } } else { n.setData('height', acum * height / maxValue); n.setData('dimArray', $.map(n.getData('valueArray'), function(n) { return [n[0] * height / maxValue, n[1] * height / maxValue]; })); } }); } }); /* * File: Options.BarChart.js * */ /* Object: Options.BarChart <BarChart> options. Other options included in the BarChart are <Options.Canvas>, <Options.Label>, <Options.Margin>, <Options.Tips> and <Options.Events>. Syntax: (start code js) Options.BarChart = { animate: true, labelOffset: 3, barsOffset: 0, type: 'stacked', hoveredColor: '#9fd4ff', orientation: 'horizontal', showAggregates: true, showLabels: true }; (end code) Example: (start code js) var barChart = new $jit.BarChart({ animate: true, barsOffset: 10, type: 'stacked:gradient' }); (end code) Parameters: animate - (boolean) Default's *true*. Whether to add animated transitions when filtering/restoring stacks. offset - (number) Default's *25*. Adds margin between the visualization and the canvas. labelOffset - (number) Default's *3*. Adds margin between the label and the default place where it should be drawn. barsOffset - (number) Default's *0*. Separation between bars. type - (string) Default's *'stacked'*. Stack or grouped styles. Posible values are 'stacked', 'grouped', 'stacked:gradient', 'grouped:gradient' to add gradients. hoveredColor - (boolean|string) Default's *'#9fd4ff'*. Sets the selected color for a hovered bar stack. orientation - (string) Default's 'horizontal'. Sets the direction of the bars. Possible options are 'vertical' or 'horizontal'. showAggregates - (boolean) Default's *true*. Display the sum of the values of the different stacks. showLabels - (boolean) Default's *true*. Display the name of the slots. */ Options.BarChart = { $extend: true, animate: true, type: 'stacked', //stacked, grouped, : gradient labelOffset: 3, //label offset barsOffset: 0, //distance between bars nodeCount: 0, //number of bars hoveredColor: '#9fd4ff', background: false, renderBackground: false, orientation: 'horizontal', showAggregates: true, showLabels: true, Ticks: { enable: false, segments: 4, color: '#000000' }, Tips: { enable: false, onShow: $.empty, onHide: $.empty }, Events: { enable: false, onClick: $.empty } }; /* * File: BarChart.js * */ $jit.ST.Plot.NodeTypes.implement({ 'barchart-stacked' : { 'render' : function(node, canvas) { var pos = node.pos.getc(true), width = node.getData('width'), height = node.getData('height'), algnPos = this.getAlignedPos(pos, width, height), x = algnPos.x, y = algnPos.y, dimArray = node.getData('dimArray'), valueArray = node.getData('valueArray'), stringArray = node.getData('stringArray'), linkArray = node.getData('linkArray'), gvl = node.getData('gvl'), colorArray = node.getData('colorArray'), colorLength = colorArray.length, nodeCount = node.getData('nodeCount'); var ctx = canvas.getCtx(), canvasSize = canvas.getSize(), opt = {}, border = node.getData('border'), gradient = node.getData('gradient'), config = node.getData('config'), horz = config.orientation == 'horizontal', aggregates = config.showAggregates, showLabels = config.showLabels, label = config.Label, margin = config.Margin; if (colorArray && dimArray && stringArray) { for (var i=0, l=dimArray.length, acum=0, valAcum=0; i<l; i++) { acum += (dimArray[i] || 0); } } //drop shadow if(config.shadow.enable) { shadowThickness = config.shadow.size; ctx.fillStyle = "rgba(0,0,0,.2)"; if(horz) { ctx.fillRect(x, y - shadowThickness, acum + shadowThickness, height + (shadowThickness*2)); } else { ctx.fillRect(x - shadowThickness, y - acum - shadowThickness, width + (shadowThickness*2), acum + shadowThickness); } } if (colorArray && dimArray && stringArray) { for (var i=0, l=dimArray.length, acum=0, valAcum=0; i<l; i++) { ctx.fillStyle = ctx.strokeStyle = colorArray[i % colorLength]; if(gradient) { var linear; if(horz) { linear = ctx.createLinearGradient(x + acum + dimArray[i]/2, y, x + acum + dimArray[i]/2, y + height); } else { linear = ctx.createLinearGradient(x, y - acum - dimArray[i]/2, x + width, y - acum- dimArray[i]/2); } var color = $.rgbToHex($.map($.hexToRgb(colorArray[i % colorLength].slice(1)), function(v) { return (v * 0.8) >> 0; })); linear.addColorStop(0, color); linear.addColorStop(0.3, colorArray[i % colorLength]); linear.addColorStop(0.7, colorArray[i % colorLength]); linear.addColorStop(1, color); ctx.fillStyle = linear; } if (horz) { yCoord = y; xCoord = x + acum; chartBarWidth = dimArray[i]; chartBarHeight = height; } else { xCoord = x; yCoord = y - acum - dimArray[i]; chartBarWidth = width; chartBarHeight = dimArray[i]; } ctx.fillRect(xCoord, yCoord, chartBarWidth, chartBarHeight); // add label if (chartBarHeight > 0) { ctx.font = label.style + ' ' + (label.size - 2) + 'px ' + label.family; labelText = valueArray[i].toString(); mtxt = ctx.measureText(labelText); labelTextPaddingX = 10; labelTextPaddingY = 6; labelBoxWidth = mtxt.width + labelTextPaddingX; labelBoxHeight = label.size + labelTextPaddingY; // do NOT draw label if label box is smaller than chartBarHeight if ((horz && (labelBoxWidth < chartBarWidth)) || (!horz && (labelBoxHeight < chartBarHeight))) { labelBoxX = xCoord + chartBarWidth/2 - mtxt.width/2 - labelTextPaddingX/2; labelBoxY = yCoord + chartBarHeight/2 - labelBoxHeight/2; ctx.fillStyle = "rgba(255,255,255,.2)"; $.roundedRect(ctx, labelBoxX, labelBoxY, labelBoxWidth, labelBoxHeight, 4, "fill"); ctx.fillStyle = "rgba(0,0,0,.8)"; $.roundedRect(ctx, labelBoxX, labelBoxY, labelBoxWidth, labelBoxHeight, 4, "stroke"); ctx.textAlign = 'center'; ctx.fillStyle = "rgba(255,255,255,.6)"; ctx.fillText(labelText, labelBoxX + mtxt.width/2 + labelTextPaddingX/2, labelBoxY + labelBoxHeight/2); ctx.fillStyle = "rgba(0,0,0,.6)"; ctx.fillText(labelText, labelBoxX + mtxt.width/2 + labelTextPaddingX/2 + 1, labelBoxY + labelBoxHeight/2 + 1); } } if(border && border.name == stringArray[i]) { opt.acum = acum; opt.dimValue = dimArray[i]; } acum += (dimArray[i] || 0); valAcum += (valueArray[i] || 0); } if(border) { ctx.save(); ctx.lineWidth = 2; ctx.strokeStyle = border.color; if(horz) { ctx.strokeRect(x + opt.acum + 1, y + 1, opt.dimValue -2, height - 2); } else { ctx.strokeRect(x + 1, y - opt.acum - opt.dimValue + 1, width -2, opt.dimValue -2); } ctx.restore(); } if(label.type == 'Native') { ctx.save(); ctx.fillStyle = ctx.strokeStyle = label.color; ctx.font = label.style + ' ' + label.size + 'px ' + label.family; ctx.textBaseline = 'middle'; if(gvl) { acumValueLabel = gvl; } else { acumValueLabel = valAcum; } if(aggregates(node.name, valAcum)) { if(!horz) { ctx.textAlign = 'center'; ctx.font = label.style + ' ' + label.size + 'px ' + label.family; //background box ctx.save(); gridHeight = canvasSize.height - (margin.top + margin.bottom + (config.Title.text ? config.Title.size + config.Title.offset : 0) + (config.Subtitle.text ? config.Subtitle.size + config.Subtitle.offset : 0) + (label ? label.size + config.labelOffset : 0)); mtxt = ctx.measureText(acumValueLabel); boxWidth = mtxt.width+10; inset = 10; boxHeight = label.size+6; if(boxHeight + acum + config.labelOffset > gridHeight) { bottomPadding = acum - config.labelOffset - boxHeight; } else { bottomPadding = acum + config.labelOffset + inset; } ctx.translate(x + width/2 - (mtxt.width/2) , y - bottomPadding); cornerRadius = 4; boxX = -inset/2; boxY = -boxHeight/2; ctx.rotate(0 * Math.PI / 180); ctx.fillStyle = "rgba(255,255,255,.8)"; if(boxHeight + acum + config.labelOffset > gridHeight) { $.roundedRect(ctx,boxX,boxY,boxWidth,boxHeight,cornerRadius,"fill"); } //$.roundedRect(ctx,boxX,boxY,boxWidth,boxHeight,cornerRadius,"stroke"); ctx.fillStyle = ctx.strokeStyle = label.color; ctx.fillText(acumValueLabel, mtxt.width/2, 0); ctx.restore(); } } if(showLabels(node.name, valAcum, node)) { if(horz) { //background box ctx.font = label.style + ' ' + label.size + 'px ' + label.family; inset = 10; gridWidth = canvasSize.width - (config.Margin.left + config.Margin.right); mtxt = ctx.measureText(node.name + ": " + acumValueLabel); boxWidth = mtxt.width+10; inset = 10; if(acum + boxWidth + config.labelOffset + inset > gridWidth) { leftPadding = acum - config.labelOffset - boxWidth - inset; } else { leftPadding = acum + config.labelOffset; } ctx.textAlign = 'left'; ctx.translate(x + inset + leftPadding, y + height/2); boxHeight = label.size+6; boxX = -inset/2; boxY = -boxHeight/2; ctx.fillStyle = "rgba(255,255,255,.8)"; cornerRadius = 4; if(acum + boxWidth + config.labelOffset + inset > gridWidth) { $.roundedRect(ctx,boxX,boxY,boxWidth,boxHeight,cornerRadius,"fill"); } //$.roundedRect(ctx,boxX,boxY,boxWidth,boxHeight,cornerRadius,"stroke"); ctx.fillStyle = label.color; ctx.rotate(0 * Math.PI / 180); ctx.fillText(node.name + ": " + acumValueLabel, 0, 0); } else { //if the number of nodes greater than 8 rotate labels 45 degrees if(nodeCount > 8) { ctx.textAlign = 'left'; ctx.translate(x + width/2, y + label.size/2 + config.labelOffset); ctx.rotate(45* Math.PI / 180); ctx.fillText(node.name, 0, 0); } else { ctx.textAlign = 'center'; ctx.fillText(node.name, x + width/2, y + label.size/2 + config.labelOffset); } } } ctx.restore(); } } }, 'contains': function(node, mpos) { var pos = node.pos.getc(true), width = node.getData('width'), height = node.getData('height'), algnPos = this.getAlignedPos(pos, width, height), x = algnPos.x, y = algnPos.y, dimArray = node.getData('dimArray'), config = node.getData('config'), rx = mpos.x - x, horz = config.orientation == 'horizontal'; //bounding box check if(horz) { if(mpos.x < x || mpos.x > x + width || mpos.y > y + height || mpos.y < y) { return false; } } else { if(mpos.x < x || mpos.x > x + width || mpos.y > y || mpos.y < y - height) { return false; } } //deep check for(var i=0, l=dimArray.length, acum=(horz? x:y); i<l; i++) { var dimi = dimArray[i]; var url = Url.decode(node.getData('linkArray')[i]); if(horz) { acum += dimi; var intersec = acum; if(mpos.x <= intersec) { return { 'name': node.getData('stringArray')[i], 'color': node.getData('colorArray')[i], 'value': node.getData('valueArray')[i], 'valuelabel': node.getData('valuelabelArray')[i], 'percentage': ((node.getData('valueArray')[i]/node.getData('barTotalValue')) * 100).toFixed(1), 'link': url, 'label': node.name }; } } else { acum -= dimi; var intersec = acum; if(mpos.y >= intersec) { return { 'name': node.getData('stringArray')[i], 'color': node.getData('colorArray')[i], 'value': node.getData('valueArray')[i], 'valuelabel': node.getData('valuelabelArray')[i], 'percentage': ((node.getData('valueArray')[i]/node.getData('barTotalValue')) * 100).toFixed(1), 'link': url, 'label': node.name }; } } } return false; } }, 'barchart-grouped' : { 'render' : function(node, canvas) { var pos = node.pos.getc(true), width = node.getData('width'), height = node.getData('height'), algnPos = this.getAlignedPos(pos, width, height), x = algnPos.x, y = algnPos.y, dimArray = node.getData('dimArray'), valueArray = node.getData('valueArray'), valuelabelArray = node.getData('valuelabelArray'), linkArray = node.getData('linkArray'), valueLength = valueArray.length, colorArray = node.getData('colorArray'), colorLength = colorArray.length, stringArray = node.getData('stringArray'); var ctx = canvas.getCtx(), canvasSize = canvas.getSize(), opt = {}, border = node.getData('border'), gradient = node.getData('gradient'), config = node.getData('config'), horz = config.orientation == 'horizontal', aggregates = config.showAggregates, showLabels = config.showLabels, label = config.Label, shadow = config.shadow, margin = config.Margin, fixedDim = (horz? height : width) / valueLength; //drop shadow maxValue = Math.max.apply(null, dimArray); ctx.fillStyle = "rgba(0,0,0,.2)"; if (colorArray && dimArray && stringArray && shadow.enable) { shadowThickness = shadow.size; for (var i=0, l=valueLength, acum=0, valAcum=0; i<l; i++) { nextBar = (dimArray[i+1]) ? dimArray[i+1] : false; prevBar = (dimArray[i-1]) ? dimArray[i-1] : false; if(horz) { ctx.fillRect(x , y - shadowThickness + (fixedDim * i), dimArray[i]+ shadowThickness, fixedDim + shadowThickness*2); } else { if(i == 0) { if(nextBar && nextBar > dimArray[i]) { ctx.fillRect((x - shadowThickness) + fixedDim * i, y - dimArray[i] - shadowThickness, fixedDim, dimArray[i]+ shadowThickness); } else if (nextBar && nextBar < dimArray[i]){ ctx.fillRect((x - shadowThickness) + fixedDim * i, y - dimArray[i] - shadowThickness, fixedDim + shadowThickness*2, dimArray[i]+ shadowThickness); } else { ctx.fillRect((x - shadowThickness) + fixedDim * i, y - dimArray[i] - shadowThickness, fixedDim + shadowThickness, dimArray[i]+ shadowThickness); } } else if (i> 0 && i<l-1) { if(nextBar && nextBar > dimArray[i]) { ctx.fillRect((x - ((prevBar < dimArray[i]) ? shadowThickness : 0)) + fixedDim * i, y - dimArray[i] - shadowThickness, fixedDim, dimArray[i]+ shadowThickness); } else if (nextBar && nextBar < dimArray[i]){ ctx.fillRect((x - ((prevBar < dimArray[i]) ? shadowThickness : 0)) + fixedDim * i, y - dimArray[i] - shadowThickness, fixedDim + shadowThickness*2, dimArray[i]+ shadowThickness); } else { ctx.fillRect((x - ((prevBar < dimArray[i]) ? shadowThickness : 0)) + fixedDim * i, y - dimArray[i] - shadowThickness, fixedDim + shadowThickness, dimArray[i]+ shadowThickness); } } else if (i == l-1) { ctx.fillRect((x - ((prevBar < dimArray[i]) ? shadowThickness : 0)) + fixedDim * i, y - dimArray[i] - shadowThickness, fixedDim + shadowThickness*2, dimArray[i]+ shadowThickness); } } } } if (colorArray && dimArray && stringArray) { for (var i=0, l=valueLength, acum=0, valAcum=0; i<l; i++) { ctx.fillStyle = ctx.strokeStyle = colorArray[i % colorLength]; if(gradient) { var linear; if(horz) { linear = ctx.createLinearGradient(x + dimArray[i]/2, y + fixedDim * i, x + dimArray[i]/2, y + fixedDim * (i + 1)); } else { linear = ctx.createLinearGradient(x + fixedDim * i, y - dimArray[i]/2, x + fixedDim * (i + 1), y - dimArray[i]/2); } var color = $.rgbToHex($.map($.hexToRgb(colorArray[i % colorLength].slice(1)), function(v) { return (v * 0.8) >> 0; })); linear.addColorStop(0, color); linear.addColorStop(0.3, colorArray[i % colorLength]); linear.addColorStop(0.7, colorArray[i % colorLength]); linear.addColorStop(1, color); ctx.fillStyle = linear; } if(horz) { ctx.fillRect(x, y + fixedDim * i, dimArray[i], fixedDim); } else { ctx.fillRect(x + fixedDim * i, y - dimArray[i], fixedDim, dimArray[i]); } if(border && border.name == stringArray[i]) { opt.acum = fixedDim * i; opt.dimValue = dimArray[i]; } acum += (dimArray[i] || 0); valAcum += (valueArray[i] || 0); ctx.fillStyle = ctx.strokeStyle = label.color; ctx.font = label.style + ' ' + label.size + 'px ' + label.family; inset = 10; if(aggregates(node.name, valAcum) && label.type == 'Native') { if(valuelabelArray[i]) { acumValueLabel = valuelabelArray[i]; } else { acumValueLabel = valueArray[i]; } if(horz) { ctx.font = label.style + ' ' + label.size + 'px ' + label.family; ctx.textAlign = 'left'; ctx.textBaseline = 'top'; ctx.fillStyle = "rgba(255,255,255,.8)"; //background box gridWidth = canvasSize.width - (margin.left + margin.right + config.labeloffset + label.size); mtxt = ctx.measureText(acumValueLabel); boxWidth = mtxt.width+10; if(boxWidth + dimArray[i] + config.labelOffset > gridWidth) { leftPadding = dimArray[i] - config.labelOffset - boxWidth - inset; } else { leftPadding = dimArray[i] + config.labelOffset + inset; } boxHeight = label.size+6; boxX = x + leftPadding; boxY = y + i*fixedDim + (fixedDim/2) - boxHeight/2; cornerRadius = 4; if(boxWidth + dimArray[i] + config.labelOffset > gridWidth) { $.roundedRect(ctx,boxX,boxY,boxWidth,boxHeight,cornerRadius,"fill"); } // $.roundedRect(ctx,boxX,boxY,boxWidth,boxHeight,cornerRadius,"stroke"); ctx.fillStyle = ctx.strokeStyle = label.color; ctx.fillText(acumValueLabel, x + inset/2 + leftPadding, y + i*fixedDim + (fixedDim/2) - (label.size/2)); } else { ctx.font = label.style + ' ' + label.size + 'px ' + label.family; ctx.save(); ctx.textAlign = 'center'; //background box gridHeight = canvasSize.height - (margin.top + margin.bottom + (config.Title.text ? config.Title.size + config.Title.offset : 0) + (config.Subtitle.text ? config.Subtitle.size + config.Subtitle.offset : 0) + (label ? label.size + config.labelOffset : 0)); mtxt = ctx.measureText(acumValueLabel); boxWidth = mtxt.width+10; boxHeight = label.size+6; if(boxHeight + dimArray[i] + config.labelOffset > gridHeight) { bottomPadding = dimArray[i] - config.labelOffset - boxHeight - inset; } else { bottomPadding = dimArray[i] + config.labelOffset + inset; } ctx.translate(x + (i*fixedDim) + (fixedDim/2) , y - bottomPadding); boxX = -boxWidth/2; boxY = -boxHeight/2; ctx.fillStyle = "rgba(255,255,255,.8)"; cornerRadius = 4; //ctx.rotate(270* Math.PI / 180); if(boxHeight + dimArray[i] + config.labelOffset > gridHeight) { $.roundedRect(ctx,boxX,boxY,boxWidth,boxHeight,cornerRadius,"fill"); } //$.roundedRect(ctx,boxX,boxY,boxWidth,boxHeight,cornerRadius,"stroke"); ctx.fillStyle = ctx.strokeStyle = label.color; ctx.fillText(acumValueLabel, 0,0); ctx.restore(); } } } if(border) { ctx.save(); ctx.lineWidth = 2; ctx.strokeStyle = border.color; if(horz) { ctx.strokeRect(x + 1, y + opt.acum + 1, opt.dimValue -2, fixedDim - 2); } else { ctx.strokeRect(x + opt.acum + 1, y - opt.dimValue + 1, fixedDim -2, opt.dimValue -2); } ctx.restore(); } if(label.type == 'Native') { ctx.save(); ctx.fillStyle = ctx.strokeStyle = label.color; ctx.font = label.style + ' ' + label.size + 'px ' + label.family; ctx.textBaseline = 'middle'; if(showLabels(node.name, valAcum, node)) { if(horz) { ctx.textAlign = 'center'; ctx.translate(x - config.labelOffset - label.size/2, y + height/2); ctx.rotate(Math.PI / 2); ctx.fillText(node.name, 0, 0); } else { ctx.textAlign = 'center'; ctx.fillText(node.name, x + width/2, y + label.size/2 + config.labelOffset); } } ctx.restore(); } } }, 'contains': function(node, mpos) { var pos = node.pos.getc(true), width = node.getData('width'), height = node.getData('height'), algnPos = this.getAlignedPos(pos, width, height), x = algnPos.x, y = algnPos.y, dimArray = node.getData('dimArray'), len = dimArray.length, config = node.getData('config'), rx = mpos.x - x, horz = config.orientation == 'horizontal', fixedDim = (horz? height : width) / len; //bounding box check if(horz) { if(mpos.x < x || mpos.x > x + width || mpos.y > y + height || mpos.y < y) { return false; } } else { if(mpos.x < x || mpos.x > x + width || mpos.y > y || mpos.y < y - height) { return false; } } //deep check for(var i=0, l=dimArray.length; i<l; i++) { var dimi = dimArray[i]; var url = Url.decode(node.getData('linkArray')[i]); if(horz) { var limit = y + fixedDim * i; if(mpos.x <= x+ dimi && mpos.y >= limit && mpos.y <= limit + fixedDim) { return { 'name': node.getData('stringArray')[i], 'color': node.getData('colorArray')[i], 'value': node.getData('valueArray')[i], 'valuelabel': node.getData('valuelabelArray')[i], 'title': node.getData('titleArray')[i], 'percentage': ((node.getData('valueArray')[i]/node.getData('barTotalValue')) * 100).toFixed(1), 'link': url, 'label': node.name }; } } else { var limit = x + fixedDim * i; if(mpos.x >= limit && mpos.x <= limit + fixedDim && mpos.y >= y - dimi) { return { 'name': node.getData('stringArray')[i], 'color': node.getData('colorArray')[i], 'value': node.getData('valueArray')[i], 'valuelabel': node.getData('valuelabelArray')[i], 'title': node.getData('titleArray')[i], 'percentage': ((node.getData('valueArray')[i]/node.getData('barTotalValue')) * 100).toFixed(1), 'link': url, 'label': node.name }; } } } return false; } }, 'barchart-basic' : { 'render' : function(node, canvas) { var pos = node.pos.getc(true), width = node.getData('width'), height = node.getData('height'), algnPos = this.getAlignedPos(pos, width, height), x = algnPos.x, y = algnPos.y, dimArray = node.getData('dimArray'), valueArray = node.getData('valueArray'), valuelabelArray = node.getData('valuelabelArray'), linkArray = node.getData('linkArray'), valueLength = valueArray.length, colorArray = node.getData('colorMono'), colorLength = colorArray.length, stringArray = node.getData('stringArray'); var ctx = canvas.getCtx(), canvasSize = canvas.getSize(), opt = {}, border = node.getData('border'), gradient = node.getData('gradient'), config = node.getData('config'), horz = config.orientation == 'horizontal', aggregates = config.showAggregates, showLabels = config.showLabels, label = config.Label, fixedDim = (horz? height : width) / valueLength, margin = config.Margin; if (colorArray && dimArray && stringArray) { for (var i=0, l=valueLength, acum=0, valAcum=0; i<l; i++) { ctx.fillStyle = ctx.strokeStyle = colorArray[i % colorLength]; if(gradient) { var linear; if(horz) { linear = ctx.createLinearGradient(x + dimArray[i]/2, y + fixedDim * i, x + dimArray[i]/2, y + fixedDim * (i + 1)); } else { linear = ctx.createLinearGradient(x + fixedDim * i, y - dimArray[i]/2, x + fixedDim * (i + 1), y - dimArray[i]/2); } //drop shadow if(config.shadow.size) { shadowThickness = config.shadow.size; ctx.fillStyle = "rgba(0,0,0,.2)"; if(horz) { ctx.fillRect(x, y + fixedDim * i - (shadowThickness), dimArray[i] + shadowThickness, fixedDim + (shadowThickness*2)); } else { ctx.fillRect(x + fixedDim * i - (shadowThickness), y - dimArray[i] - shadowThickness, fixedDim + (shadowThickness*2), dimArray[i] + shadowThickness); } } var color = $.rgbToHex($.map($.hexToRgb(colorArray[i % colorLength].slice(1)), function(v) { return (v * 0.8) >> 0; })); linear.addColorStop(0, color); linear.addColorStop(0.3, colorArray[i % colorLength]); linear.addColorStop(0.7, colorArray[i % colorLength]); linear.addColorStop(1, color); ctx.fillStyle = linear; } if(horz) { ctx.fillRect(x, y + fixedDim * i, dimArray[i], fixedDim); } else { ctx.fillRect(x + fixedDim * i, y - dimArray[i], fixedDim, dimArray[i]); } if(border && border.name == stringArray[i]) { opt.acum = fixedDim * i; opt.dimValue = dimArray[i]; } acum += (dimArray[i] || 0); valAcum += (valueArray[i] || 0); if(label.type == 'Native') { ctx.fillStyle = ctx.strokeStyle = label.color; ctx.font = label.style + ' ' + label.size + 'px ' + label.family; if(aggregates(node.name, valAcum)) { if(valuelabelArray[i]) { acumValueLabel = valuelabelArray[i]; } else { acumValueLabel = valueArray[i]; } if(!horz) { ctx.textAlign = 'center'; ctx.font = label.style + ' ' + label.size + 'px ' + label.family; //background box ctx.save(); gridHeight = canvasSize.height - (margin.top + margin.bottom + (config.Title.text ? config.Title.size + config.Title.offset : 0) + (config.Subtitle.text ? config.Subtitle.size + config.Subtitle.offset : 0) + (label ? label.size + config.labelOffset : 0)); mtxt = ctx.measureText(acumValueLabel); boxWidth = mtxt.width+10; inset = 10; boxHeight = label.size+6; if(boxHeight + dimArray[i] + config.labelOffset > gridHeight) { bottomPadding = dimArray[i] - config.labelOffset - inset; } else { bottomPadding = dimArray[i] + config.labelOffset + inset; } ctx.translate(x + width/2 - (mtxt.width/2) , y - bottomPadding); cornerRadius = 4; boxX = -inset/2; boxY = -boxHeight/2; //ctx.rotate(270* Math.PI / 180); ctx.fillStyle = "rgba(255,255,255,.6)"; if(boxHeight + dimArray[i] + config.labelOffset > gridHeight) { $.roundedRect(ctx,boxX,boxY,boxWidth,boxHeight,cornerRadius,"fill"); } // $.roundedRect(ctx,boxX,boxY,boxWidth,boxHeight,cornerRadius,"stroke"); ctx.fillStyle = ctx.strokeStyle = label.color; ctx.fillText(acumValueLabel, mtxt.width/2, 0); ctx.restore(); } } } } if(border) { ctx.save(); ctx.lineWidth = 2; ctx.strokeStyle = border.color; if(horz) { ctx.strokeRect(x + 1, y + opt.acum + 1, opt.dimValue -2, fixedDim - 2); } else { ctx.strokeRect(x + opt.acum + 1, y - opt.dimValue + 1, fixedDim -2, opt.dimValue -2); } ctx.restore(); } if(label.type == 'Native') { ctx.save(); ctx.fillStyle = ctx.strokeStyle = label.color; ctx.font = label.style + ' ' + label.size + 'px ' + label.family; ctx.textBaseline = 'middle'; if(showLabels(node.name, valAcum, node)) { if(horz) { //background box gridWidth = canvasSize.width - (config.Margin.left + config.Margin.right); mtxt = ctx.measureText(node.name + ": " + valAcum); boxWidth = mtxt.width+10; inset = 10; if(acum + boxWidth + config.labelOffset + inset > gridWidth) { leftPadding = acum - config.labelOffset - boxWidth - inset; } else { leftPadding = acum + config.labelOffset; } ctx.textAlign = 'left'; ctx.translate(x + inset + leftPadding, y + height/2); boxHeight = label.size+6; boxX = -inset/2; boxY = -boxHeight/2; ctx.fillStyle = "rgba(255,255,255,.8)"; cornerRadius = 4; if(acum + boxWidth + config.labelOffset + inset > gridWidth) { $.roundedRect(ctx,boxX,boxY,boxWidth,boxHeight,cornerRadius,"fill"); } //$.roundedRect(ctx,boxX,boxY,boxWidth,boxHeight,cornerRadius,"stroke"); ctx.fillStyle = label.color; ctx.fillText(node.name + ": " + valAcum, 0, 0); } else { if(stringArray.length > 8) { ctx.textAlign = 'left'; ctx.translate(x + width/2, y + label.size/2 + config.labelOffset); ctx.rotate(45* Math.PI / 180); ctx.fillText(node.name, 0, 0); } else { ctx.textAlign = 'center'; ctx.fillText(node.name, x + width/2, y + label.size/2 + config.labelOffset); } } } ctx.restore(); } } }, 'contains': function(node, mpos) { var pos = node.pos.getc(true), width = node.getData('width'), height = node.getData('height'), config = node.getData('config'), algnPos = this.getAlignedPos(pos, width, height), x = algnPos.x, y = algnPos.y , dimArray = node.getData('dimArray'), len = dimArray.length, rx = mpos.x - x, horz = config.orientation == 'horizontal', fixedDim = (horz? height : width) / len; //bounding box check if(horz) { if(mpos.x < x || mpos.x > x + width || mpos.y > y + height || mpos.y < y) { return false; } } else { if(mpos.x < x || mpos.x > x + width || mpos.y > y || mpos.y < y - height) { return false; } } //deep check for(var i=0, l=dimArray.length; i<l; i++) { var dimi = dimArray[i]; var url = Url.decode(node.getData('linkArray')[i]); if(horz) { var limit = y + fixedDim * i; if(mpos.x <= x+ dimi && mpos.y >= limit && mpos.y <= limit + fixedDim) { return { 'name': node.getData('stringArray')[i], 'color': node.getData('colorArray')[i], 'value': node.getData('valueArray')[i], 'valuelabel': node.getData('valuelabelArray')[i], 'percentage': ((node.getData('valueArray')[i]/node.getData('groupTotalValue')) * 100).toFixed(1), 'link': url, 'label': node.name }; } } else { var limit = x + fixedDim * i; if(mpos.x >= limit && mpos.x <= limit + fixedDim && mpos.y >= y - dimi) { return { 'name': node.getData('stringArray')[i], 'color': node.getData('colorArray')[i], 'value': node.getData('valueArray')[i], 'valuelabel': node.getData('valuelabelArray')[i], 'percentage': ((node.getData('valueArray')[i]/node.getData('groupTotalValue')) * 100).toFixed(1), 'link': url, 'label': node.name }; } } } return false; } } }); /* Class: BarChart A visualization that displays stacked bar charts. Constructor Options: See <Options.BarChart>. */ $jit.BarChart = new Class({ st: null, colors: ["#004b9c", "#9c0079", "#9c0033", "#28009c", "#9c0000", "#7d009c", "#001a9c","#00809c","#009c80","#009c42","#009c07","#469c00","#799c00","#9c9600","#9c5c00"], selected: {}, busy: false, initialize: function(opt) { this.controller = this.config = $.merge(Options("Canvas", "Margin", "Label", "BarChart"), { Label: { type: 'Native' } }, opt); //set functions for showLabels and showAggregates var showLabels = this.config.showLabels, typeLabels = $.type(showLabels), showAggregates = this.config.showAggregates, typeAggregates = $.type(showAggregates); this.config.showLabels = typeLabels == 'function'? showLabels : $.lambda(showLabels); this.config.showAggregates = typeAggregates == 'function'? showAggregates : $.lambda(showAggregates); Options.Fx.clearCanvas = false; this.initializeViz(); }, initializeViz: function() { var config = this.config, that = this; var nodeType = config.type.split(":")[0], horz = config.orientation == 'horizontal', nodeLabels = {}; var st = new $jit.ST({ injectInto: config.injectInto, orientation: horz? 'left' : 'bottom', background: config.background, renderBackground: config.renderBackground, backgroundColor: config.backgroundColor, colorStop1: config.colorStop1, colorStop2: config.colorStop2, levelDistance: 0, nodeCount: config.nodeCount, siblingOffset: config.barsOffset, subtreeOffset: 0, withLabels: config.Label.type != 'Native', useCanvas: config.useCanvas, Label: { type: config.Label.type }, Node: { overridable: true, type: 'barchart-' + nodeType, align: 'left', width: 1, height: 1 }, Edge: { type: 'none' }, Tips: { enable: config.Tips.enable, type: 'Native', force: true, onShow: function(tip, node, contains) { var elem = contains; config.Tips.onShow(tip, elem, node); if(elem.link != 'undefined' && elem.link != '') { document.body.style.cursor = 'pointer'; } }, onHide: function(call) { document.body.style.cursor = 'default'; } }, Events: { enable: true, type: 'Native', onClick: function(node, eventInfo, evt) { if(!config.Events.enable) return; var elem = eventInfo.getContains(); config.Events.onClick(elem, eventInfo, evt); }, onMouseMove: function(node, eventInfo, evt) { if(!config.hoveredColor) return; if(node) { var elem = eventInfo.getContains(); that.select(node.id, elem.name, elem.index); } else { that.select(false, false, false); } } }, onCreateLabel: function(domElement, node) { var labelConf = config.Label, valueArray = node.getData('valueArray'), acum = $.reduce(valueArray, function(x, y) { return x + y; }, 0), grouped = config.type.split(':')[0] == 'grouped', horz = config.orientation == 'horizontal'; var nlbs = { wrapper: document.createElement('div'), aggregate: document.createElement('div'), label: document.createElement('div') }; var wrapper = nlbs.wrapper, label = nlbs.label, aggregate = nlbs.aggregate, wrapperStyle = wrapper.style, labelStyle = label.style, aggregateStyle = aggregate.style; //store node labels nodeLabels[node.id] = nlbs; //append labels wrapper.appendChild(label); wrapper.appendChild(aggregate); if(!config.showLabels(node.name, acum, node)) { labelStyle.display = 'none'; } if(!config.showAggregates(node.name, acum, node)) { aggregateStyle.display = 'none'; } wrapperStyle.position = 'relative'; wrapperStyle.overflow = 'visible'; wrapperStyle.fontSize = labelConf.size + 'px'; wrapperStyle.fontFamily = labelConf.family; wrapperStyle.color = labelConf.color; wrapperStyle.textAlign = 'center'; aggregateStyle.position = labelStyle.position = 'absolute'; domElement.style.width = node.getData('width') + 'px'; domElement.style.height = node.getData('height') + 'px'; aggregateStyle.left = "0px"; labelStyle.left = config.labelOffset + 'px'; labelStyle.whiteSpace = "nowrap"; label.innerHTML = node.name; domElement.appendChild(wrapper); }, onPlaceLabel: function(domElement, node) { if(!nodeLabels[node.id]) return; var labels = nodeLabels[node.id], wrapperStyle = labels.wrapper.style, labelStyle = labels.label.style, aggregateStyle = labels.aggregate.style, grouped = config.type.split(':')[0] == 'grouped', horz = config.orientation == 'horizontal', dimArray = node.getData('dimArray'), valArray = node.getData('valueArray'), nodeCount = node.getData('nodeCount'), valueLength = valArray.length; valuelabelArray = node.getData('valuelabelArray'), stringArray = node.getData('stringArray'), width = (grouped && horz)? Math.max.apply(null, dimArray) : node.getData('width'), height = (grouped && !horz)? Math.max.apply(null, dimArray) : node.getData('height'), font = parseInt(wrapperStyle.fontSize, 10), domStyle = domElement.style, fixedDim = (horz? height : width) / valueLength; if(dimArray && valArray) { wrapperStyle.width = aggregateStyle.width = labelStyle.width = domElement.style.width = width + 'px'; aggregateStyle.width = width - config.labelOffset + "px"; for(var i=0, l=valArray.length, acum=0; i<l; i++) { if(dimArray[i] > 0) { acum+= valArray[i]; } } if(config.showLabels(node.name, acum, node)) { labelStyle.display = ''; } else { labelStyle.display = 'none'; } if(config.showAggregates(node.name, acum, node)) { aggregateStyle.display = ''; } else { aggregateStyle.display = 'none'; } if(config.orientation == 'horizontal') { aggregateStyle.textAlign = 'right'; labelStyle.textAlign = 'left'; labelStyle.textIndex = aggregateStyle.textIndent = config.labelOffset + 'px'; aggregateStyle.top = labelStyle.top = (height-font)/2 + 'px'; domElement.style.height = wrapperStyle.height = height + 'px'; } else { aggregateStyle.top = (-font - config.labelOffset) + 'px'; labelStyle.top = (config.labelOffset + height) + 'px'; domElement.style.top = parseInt(domElement.style.top, 10) - height + 'px'; domElement.style.height = wrapperStyle.height = height + 'px'; if(stringArray.length > 8) { labels.label.className = "rotatedLabelReverse"; labelStyle.textAlign = "left"; labelStyle.top = config.labelOffset + height + width/2 + "px"; } } if(horz) { labels.label.innerHTML = labels.label.innerHTML + ": " + acum; labels.aggregate.innerHTML = ""; } else { if(grouped) { maxValue = Math.max.apply(null,dimArray); for (var i=0, l=valArray.length, acum=0, valAcum=0; i<l; i++) { valueLabelDim = 50; valueLabel = document.createElement('div'); valueLabel.innerHTML = valuelabelArray[i]; // valueLabel.class = "rotatedLabel"; valueLabel.className = "rotatedLabel"; valueLabel.style.position = "absolute"; valueLabel.style.textAlign = "left"; valueLabel.style.verticalAlign = "middle"; valueLabel.style.height = valueLabelDim + "px"; valueLabel.style.width = valueLabelDim + "px"; valueLabel.style.top = (maxValue - dimArray[i]) - valueLabelDim - config.labelOffset + "px"; valueLabel.style.left = (fixedDim * i) + "px"; labels.wrapper.appendChild(valueLabel); } } else { labels.aggregate.innerHTML = acum; } } } } }); var size = st.canvas.getSize(), l = config.nodeCount, margin = config.Margin; title = config.Title; subtitle = config.Subtitle, grouped = config.type.split(':')[0] == 'grouped', margin = config.Margin, ticks = config.Ticks, marginWidth = margin.left + margin.right + (config.Label && grouped ? config.Label.size + config.labelOffset: 0), marginHeight = (title.text? title.size + title.offset : 0) + (subtitle.text? subtitle.size + subtitle.offset : 0) + margin.top + margin.bottom, horz = config.orientation == 'horizontal', fixedDim = (size[horz? 'height':'width'] - (horz? marginHeight:marginWidth) - (ticks.enable? config.Label.size + config.labelOffset : 0) - (l -1) * config.barsOffset) / l, fixedDim = (fixedDim > 40) ? 40 : fixedDim; whiteSpace = size.width - (marginWidth + (fixedDim * l)); //bug in IE7 when vertical bar charts load in dashlets where number of bars exceed a certain width, canvas renders with an incorrect width, a hard refresh fixes the problem if(!horz && typeof FlashCanvas != "undefined" && size.width < 250) location.reload(); //if not a grouped chart and is a vertical chart, adjust bar spacing to fix canvas width. if(!grouped && !horz) { st.config.siblingOffset = whiteSpace/(l+1); } //Bars offset if(horz) { st.config.offsetX = size.width/2 - margin.left - (grouped && config.Label ? config.labelOffset + config.Label.size : 0); if(config.Ticks.enable) { st.config.offsetY = ((margin.bottom+config.Label.size+config.labelOffset+(subtitle.text? subtitle.size+subtitle.offset:0)) - (margin.top + (title.text? title.size+title.offset:0))) /2; } else { st.config.offsetY = (margin.bottom - margin.top - (title.text? title.size+title.offset:0) - (subtitle.text? subtitle.size+subtitle.offset:0))/2; } } else { st.config.offsetY = -size.height/2 + margin.bottom + (config.showLabels && (config.labelOffset + config.Label.size)) + (subtitle.text? subtitle.size+subtitle.offset:0); if(config.Ticks.enable) { st.config.offsetX = ((margin.right-config.Label.size-config.labelOffset) - margin.left)/2; } else { st.config.offsetX = (margin.right - margin.left)/2; } } this.st = st; this.canvas = this.st.canvas; }, renderTitle: function() { var canvas = this.canvas, size = canvas.getSize(), config = this.config, margin = config.Margin, label = config.Label, title = config.Title; ctx = canvas.getCtx(); ctx.fillStyle = title.color; ctx.textAlign = 'left'; ctx.font = label.style + ' bold ' +' ' + title.size + 'px ' + label.family; if(label.type == 'Native') { ctx.fillText(title.text, -size.width/2+margin.left, -size.height/2+margin.top); } }, renderSubtitle: function() { var canvas = this.canvas, size = canvas.getSize(), config = this.config, margin = config.Margin, label = config.Label, subtitle = config.Subtitle, nodeCount = config.nodeCount, horz = config.orientation == 'horizontal' ? true : false, ctx = canvas.getCtx(); ctx.fillStyle = title.color; ctx.textAlign = 'left'; ctx.font = label.style + ' ' + subtitle.size + 'px ' + label.family; if(label.type == 'Native') { ctx.fillText(subtitle.text, -size.width/2+margin.left, size.height/2-(!horz && nodeCount > 8 ? 20 : margin.bottom)-subtitle.size); } }, renderScrollNote: function() { var canvas = this.canvas, size = canvas.getSize(), config = this.config, margin = config.Margin, label = config.Label, note = config.ScrollNote; ctx = canvas.getCtx(); ctx.fillStyle = title.color; title = config.Title; ctx.textAlign = 'center'; ctx.font = label.style + ' bold ' +' ' + note.size + 'px ' + label.family; if(label.type == 'Native') { ctx.fillText(note.text, 0, -size.height/2+margin.top+title.size); } }, renderTicks: function() { var canvas = this.canvas, size = canvas.getSize(), config = this.config, margin = config.Margin, ticks = config.Ticks, title = config.Title, subtitle = config.Subtitle, label = config.Label, shadow = config.shadow; horz = config.orientation == 'horizontal', grouped = config.type.split(':')[0] == 'grouped', ctx = canvas.getCtx(); ctx.strokeStyle = ticks.color; ctx.font = label.style + ' ' + label.size + 'px ' + label.family; ctx.textAlign = 'center'; ctx.textBaseline = 'middle'; idLabel = canvas.id + "-label"; labelDim = 100; container = document.getElementById(idLabel); if(horz) { var axis = -(size.width/2)+margin.left + (grouped && config.Label ? config.labelOffset + label.size : 0), grid = size.width-(margin.left + margin.right + (grouped && config.Label ? config.labelOffset + label.size : 0)), segmentLength = grid/ticks.segments; ctx.fillStyle = ticks.color; // Main horizontal line var xTop = axis; var yTop = size.height / 2 - margin.bottom - config.labelOffset - label.size - (subtitle.text ? subtitle.size + subtitle.offset : 0) + (shadow.enable ? shadow.size : 0); var xLength = size.width - margin.left - margin.right - (grouped && config.Label ? config.labelOffset + label.size : 0); var yLength = 1; ctx.fillRect(xTop, yTop, xLength, yLength); maxTickValue = config.Ticks.maxValue; var humanNumber = config.Ticks.humanNumber; var segments = config.Ticks.segments; var tempHumanNumber = humanNumber; var humanNumberPow = 0; // Tries to find pow of humanNumber if it is less than 1. For 0.001 humanNumberPos will be 3. it means 0.001*10^3 = 1. // humanNumberPow is required for work with number less than 1. while (tempHumanNumber % 1 != 0) { tempHumanNumber = tempHumanNumber * 10; humanNumberPow ++; } // Tries convert length of line to steps in pixels. 4 steps, 160 length - 40 pixels per step var pixelsPerStep = xLength / maxTickValue; var lineHeight = size.height - margin.bottom - margin.top - config.labelOffset - label.size - (title.text ? title.size+title.offset : 0) - (subtitle.text ? subtitle.size + subtitle.offset : 0); for (var i = 0; i <= segments; i++) { var iX = Math.round(xTop + i * pixelsPerStep * humanNumber); ctx.save(); ctx.translate(iX, yTop + yLength + margin.top); ctx.rotate(0 * Math.PI / 2 * 3); ctx.fillStyle = label.color; // Float numbers fix (0.45 can be displayed as 0.44466666) var labelText = humanNumber * Math.pow(10, humanNumberPow) * i; labelText = labelText * Math.pow(10, -humanNumberPow); if (config.showLabels) { // Filling Text through canvas or html elements if (label.type == 'Native') { ctx.fillText(labelText, 0, 0); // For coords see ctx.translate above } else { //html labels on y axis labelDiv = document.createElement('div'); labelDiv.innerHTML = labelText; labelDiv.style.top = Math.round(size.height - margin.bottom - config.labelOffset) + "px"; labelDiv.style.left = Math.round(margin.left - labelDim / 2 + i * pixelsPerStep * humanNumber) + "px"; labelDiv.style.width = labelDim + "px"; labelDiv.style.height = labelDim + "px"; labelDiv.style.textAlign = "center"; labelDiv.style.verticalAlign = "middle"; labelDiv.style.position = "absolute"; labelDiv.style.background = '1px solid red'; container.appendChild(labelDiv); } } ctx.restore(); ctx.fillStyle = ticks.color; // Drawing line ctx.fillRect(Math.round(axis) + i * pixelsPerStep * humanNumber, -size.height / 2 + margin.top + (title.text ? title.size + title.offset : 0) - (shadow.enable ? shadow.size : 0), 1, lineHeight + (shadow.enable ? shadow.size * 2: 0)); } } else { var axis = (size.height/2)-(margin.bottom+config.labelOffset+label.size+(subtitle.text? subtitle.size+subtitle.offset:0)), htmlOrigin = size.height - (margin.bottom+config.labelOffset+label.size+(subtitle.text? subtitle.size+subtitle.offset:0)), grid = -size.height+(margin.bottom+config.labelOffset+label.size+margin.top+(title.text? title.size+title.offset:0)+(subtitle.text? subtitle.size+subtitle.offset:0)), segmentLength = grid/ticks.segments; ctx.fillStyle = ticks.color; // Main horizontal line var xTop = -size.width / 2 + margin.left + config.labelOffset + label.size - 1; var yTop = -size.height / 2 + margin.top + (title.text ? title.size + title.offset : 0); var xLength = 1; var yLength = size.height - margin.top - margin.bottom - label.size - config.labelOffset - (title.text ? title.size + title.offset : 0) - (subtitle.text ? subtitle.size + subtitle.offset : 0); ctx.fillRect(xTop, yTop, xLength, yLength); maxTickValue = config.Ticks.maxValue; var humanNumber = config.Ticks.humanNumber; var segments = config.Ticks.segments; var tempHumanNumber = humanNumber; var humanNumberPow = 0; // Tries to find pow of humanNumber if it is less than 1. For 0.001 humanNumberPos will be 3. it means 0.001*10^3 = 1. // humanNumberPow is required for work with number less than 1. while (tempHumanNumber % 1 != 0) { tempHumanNumber = tempHumanNumber * 10; humanNumberPow ++; } // Tries convert length of line to steps in pixels. 4 steps, 160 length - 40 pixels per step var pixelsPerStep = yLength / maxTickValue; for (var i = 0; i <= segments; i++) { var iY = Math.round(yTop + yLength - i * pixelsPerStep * humanNumber); ctx.save(); ctx.translate(-size.width / 2 + margin.left, iY); ctx.rotate(0 * Math.PI / 2 * 3); ctx.fillStyle = label.color; // Float numbers fix (0.45 can be displayed as 0.44466666) var labelText = humanNumber * Math.pow(10, humanNumberPow) * i; labelText = labelText * Math.pow(10, -humanNumberPow); if (config.showLabels) { // Filling Text through canvas or html elements if (label.type == 'Native') { ctx.fillText(labelText, 0, 0); // For coords see ctx.translate above } else { //html labels on y axis labelDiv = document.createElement('div'); labelDiv.innerHTML = labelText; labelDiv.className = "rotatedLabel"; // labelDiv.class = "rotatedLabel"; labelDiv.style.top = Math.round(htmlOrigin - labelDim / 2 - i * pixelsPerStep * humanNumber) + "px"; labelDiv.style.left = margin.left + "px"; labelDiv.style.width = labelDim + "px"; labelDiv.style.height = labelDim + "px"; labelDiv.style.textAlign = "center"; labelDiv.style.verticalAlign = "middle"; labelDiv.style.position = "absolute"; container.appendChild(labelDiv); } } ctx.restore(); ctx.fillStyle = ticks.color; ctx.fillRect(-size.width / 2 + margin.left + config.labelOffset + label.size, iY, size.width - margin.right - margin.left - config.labelOffset - label.size, 1); } } }, renderBackground: function() { var canvas = this.canvas, config = this.config, backgroundColor = config.backgroundColor, size = canvas.getSize(), ctx = canvas.getCtx(); ctx.fillStyle = backgroundColor; ctx.fillRect(-size.width/2,-size.height/2,size.width,size.height); }, clear: function() { var canvas = this.canvas; var ctx = canvas.getCtx(), size = canvas.getSize(); ctx.fillStyle = "rgba(255,255,255,0)"; ctx.fillRect(-size.width/2,-size.height/2,size.width,size.height); ctx.clearRect(-size.width/2,-size.height/2,size.width,size.height); }, resizeGraph: function(json,width) { var canvas = this.canvas, size = canvas.getSize(), config = this.config, orgHeight = size.height, margin = config.Margin, st = this.st, grouped = config.type.split(':')[0] == 'grouped', horz = config.orientation == 'horizontal'; canvas.resize(width,orgHeight); if(typeof FlashCanvas == "undefined") { canvas.clear(); } else { this.clear();// hack for flashcanvas bug not properly clearing rectangle } if(horz) { st.config.offsetX = size.width/2 - margin.left - (grouped && config.Label ? config.labelOffset + config.Label.size : 0); } this.loadJSON(json); }, /* Method: loadJSON Loads JSON data into the visualization. Parameters: json - The JSON data format. This format is described in <http://blog.thejit.org/2010/04/24/new-javascript-infovis-toolkit-visualizations/#json-data-format>. Example: (start code js) var barChart = new $jit.BarChart(options); barChart.loadJSON(json); (end code) */ loadJSON: function(json) { if(this.busy) return; this.busy = true; var prefix = $.time(), ch = [], st = this.st, name = $.splat(json.label), color = $.splat(json.color || this.colors), config = this.config, gradient = !!config.type.split(":")[1], renderBackground = config.renderBackground, animate = config.animate, ticks = config.Ticks, title = config.Title, note = config.ScrollNote, subtitle = config.Subtitle, horz = config.orientation == 'horizontal', that = this, colorLength = color.length, nameLength = name.length; groupTotalValue = 0; for(var i=0, values=json.values, l=values.length; i<l; i++) { var val = values[i]; var valArray = $.splat(val.values); groupTotalValue += parseFloat(valArray.sum()); } for(var i=0, values=json.values, l=values.length; i<l; i++) { var val = values[i]; var valArray = $.splat(values[i].values); var valuelabelArray = $.splat(values[i].valuelabels); var linkArray = $.splat(values[i].links); var titleArray = $.splat(values[i].titles); var barTotalValue = valArray.sum(); var acum = 0; if (typeof val.id == 'undefined') { val.id = val.label; } ch.push({ 'id': prefix + val.id, 'name': val.label, 'data': { 'value': valArray, '$linkArray': linkArray, '$gvl': val.gvaluelabel, '$titleArray': titleArray, '$valueArray': valArray, '$valuelabelArray': valuelabelArray, '$colorArray': color, '$colorMono': $.splat(color[i % colorLength]), '$stringArray': name, '$barTotalValue': barTotalValue, '$groupTotalValue': groupTotalValue, '$nodeCount': values.length, '$gradient': gradient, '$config': config }, 'children': [] }); } var root = { 'id': prefix + '$root', 'name': '', 'data': { '$type': 'none', '$width': 1, '$height': 1 }, 'children': ch }; st.loadJSON(root); this.normalizeDims(); if(renderBackground) { this.renderBackground(); } if(!animate && ticks.enable) { this.renderTicks(); } if(!animate && note.text) { this.renderScrollNote(); } if(!animate && title.text) { this.renderTitle(); } if(!animate && subtitle.text) { this.renderSubtitle(); } st.compute(); st.select(st.root); if(animate) { if(horz) { st.fx.animate({ modes: ['node-property:width:dimArray'], duration:1500, onComplete: function() { that.busy = false; } }); } else { st.fx.animate({ modes: ['node-property:height:dimArray'], duration:1500, onComplete: function() { that.busy = false; } }); } } else { this.busy = false; } }, /* Method: updateJSON Use this method when updating values for the current JSON data. If the items specified by the JSON data already exist in the graph then their values will be updated. Parameters: json - (object) JSON data to be updated. The JSON format corresponds to the one described in <BarChart.loadJSON>. onComplete - (object) A callback object to be called when the animation transition when updating the data end. Example: (start code js) barChart.updateJSON(json, { onComplete: function() { alert('update complete!'); } }); (end code) */ updateJSON: function(json, onComplete) { if(this.busy) return; this.busy = true; var st = this.st; var graph = st.graph; var values = json.values; var animate = this.config.animate; var that = this; var horz = this.config.orientation == 'horizontal'; $.each(values, function(v) { var n = graph.getByName(v.label); if(n) { n.setData('valueArray', $.splat(v.values)); if(json.label) { n.setData('stringArray', $.splat(json.label)); } } }); this.normalizeDims(); st.compute(); st.select(st.root); if(animate) { if(horz) { st.fx.animate({ modes: ['node-property:width:dimArray'], duration:1500, onComplete: function() { that.busy = false; onComplete && onComplete.onComplete(); } }); } else { st.fx.animate({ modes: ['node-property:height:dimArray'], duration:1500, onComplete: function() { that.busy = false; onComplete && onComplete.onComplete(); } }); } } }, //adds the little brown bar when hovering the node select: function(id, name) { if(!this.config.hoveredColor) return; var s = this.selected; if(s.id != id || s.name != name) { s.id = id; s.name = name; s.color = this.config.hoveredColor; this.st.graph.eachNode(function(n) { if(id == n.id) { n.setData('border', s); } else { n.setData('border', false); } }); this.st.plot(); } }, /* Method: getLegend Returns an object containing as keys the legend names and as values hex strings with color values. Example: (start code js) var legend = barChart.getLegend(); (end code) */ getLegend: function() { var legend = new Array(); var name = new Array(); var color = new Array(); var n; this.st.graph.getNode(this.st.root).eachAdjacency(function(adj) { n = adj.nodeTo; }); var colors = n.getData('colorArray'), len = colors.length; $.each(n.getData('stringArray'), function(s, i) { color[i] = colors[i % len]; name[i] = s; }); legend['name'] = name; legend['color'] = color; return legend; }, /* Method: getMaxValue Returns the maximum accumulated value for the stacks. This method is used for normalizing the graph heights according to the canvas height. Example: (start code js) var ans = barChart.getMaxValue(); (end code) In some cases it could be useful to override this method to normalize heights for a group of BarCharts, like when doing small multiples. Example: (start code js) //will return 100 for all BarChart instances, //displaying all of them with the same scale $jit.BarChart.implement({ 'getMaxValue': function() { return 100; } }); (end code) */ getMaxValue: function() { var maxValue = 0, stacked = this.config.type.split(':')[0] == 'stacked'; this.st.graph.eachNode(function(n) { var valArray = n.getData('valueArray'), acum = 0; if(!valArray) return; if(stacked) { $.each(valArray, function(v) { acum += +v; }); } else { acum = Math.max.apply(null, valArray); } maxValue = maxValue>acum? maxValue:acum; }); return maxValue; }, setBarType: function(type) { this.config.type = type; this.st.config.Node.type = 'barchart-' + type.split(':')[0]; }, normalizeDims: function() { //number of elements var root = this.st.graph.getNode(this.st.root), l=0; root.eachAdjacency(function() { l++; }); var maxValue = this.getMaxValue() || 1, size = this.st.canvas.getSize(), config = this.config, margin = config.Margin, ticks = config.Ticks, title = config.Title, subtitle = config.Subtitle, grouped = config.type.split(':')[0] == 'grouped', marginWidth = margin.left + margin.right + (config.Label && grouped ? config.Label.size + config.labelOffset: 0), marginHeight = (title.text? title.size + title.offset : 0) + (subtitle.text? subtitle.size + subtitle.offset : 0) + margin.top + margin.bottom, horz = config.orientation == 'horizontal', fixedDim = (size[horz? 'height':'width'] - (horz? marginHeight:marginWidth) - (ticks.enable? config.Label.size + config.labelOffset : 0) - (l -1) * config.barsOffset) / l, animate = config.animate, height = size[horz? 'width':'height'] - (horz? marginWidth:marginHeight) - ((config.showLabels && !horz) ? (config.Label.size + config.labelOffset) : 0), dim1 = horz? 'height':'width', dim2 = horz? 'width':'height', basic = config.type.split(':')[0] == 'basic'; // Bug #47147 Correct detection of maxTickValue and step size for asix labels var iDirection = 10; // We need this var for convert value. 10^2 = 100 var zeroCount = 0; // Pow for iDirection for detection of size of human step. var iNumber = maxValue; // This var will store two first digits from maxValue. For 1265848 it will be 12. For 0.0453 it will be 45. // Tries to get two first digits from maxValue if (iNumber >= 0) { // Tries to calculate zeroCount // if iNumber = 100 we will get zeroCount = 2, iNumber = 0.1 while (iNumber >= 1) { zeroCount ++; iNumber = iNumber / 10; } iNumber = Math.floor(iNumber * 100); // We need to increase iNumber by 100 to get two first digits. for 0.1 it will be 0.1*100 = 10 } else { iDirection = 0.1; // if iNumber is less than 1 we should change iDirection. 0.1^2 = 0.01 // Tries to calculate zeroCount // if iNumber = 0.01 we will get zeroCount = 2, iNumber = 1 while (iNumber < 1) { zeroCount ++; iNumber = iNumber * 10; } iNumber = Math.floor(iNumber * 10); // We need to increase iNumber by 10 to get two first digits. for 1 it will be 1*10 = 10 } var humanNumber = 0; var iNumberTemp = iNumber + 1; // We need to add 1 for correct tick size detection. It means that tick always will be great than max value of chart. // 5 is human step. And we try to detect max value of tick. if maxValue is 1234567 it means iNumber = 12, iNumberTemp = 13 and as result we will get iNumberTemp = 15. while (iNumberTemp % 5 != 0) { iNumberTemp ++; } var isFound = false; zeroCount --; // We need to reduce zeroCount because of increase by 10 or 100 in steps above. It means iNumber = 10, zeroCount = 2 - 1 = 1. 10 * 10^1 = 100. 100 is original value of iNumber // Tries to find humanNumber. Our step is 5. ticks.segments is number of lines = 4 (for example) // iNumberTemp = 15 (for example). 15 % 4 = 3. It means that we should add 5 to iNumberTemp till division will equal 0. 20 % 4 = 0. Our result is iNumberTemp = 20 while (isFound == false) { if (iNumberTemp % ticks.segments == 0) { humanNumber = iNumberTemp / ticks.segments; isFound = true; break; } iNumberTemp = iNumberTemp + 5; } // Getting real values var maxTickValue = config.Ticks.maxValue = maxTickValue = iNumberTemp * Math.pow(iDirection, zeroCount - 1); config.Ticks.humanNumber = humanNumber = humanNumber * Math.pow(iDirection, zeroCount - 1); config.Ticks.segments = Math.floor(maxTickValue / humanNumber); fixedDim = fixedDim > 40 ? 40 : fixedDim; this.st.graph.eachNode(function(n) { var acum = 0, animateValue = []; $.each(n.getData('valueArray'), function(v) { acum += +v; animateValue.push(0); }); if(grouped) { fixedDim = animateValue.length * 40; } n.setData(dim1, fixedDim); if(animate) { n.setData(dim2, acum * height / maxValue, 'end'); n.setData('dimArray', $.map(n.getData('valueArray'), function(n) { return n * height / maxValue; }), 'end'); var dimArray = n.getData('dimArray'); if(!dimArray) { n.setData('dimArray', animateValue); } } else { if(ticks.enable) { n.setData(dim2, acum * height / maxTickValue); n.setData('dimArray', $.map(n.getData('valueArray'), function(n) { return n * height / maxTickValue; })); } else { n.setData(dim2, acum * height / maxValue); n.setData('dimArray', $.map(n.getData('valueArray'), function(n) { return n * height / maxValue; })); } } }); } }); //funnel chart options Options.FunnelChart = { $extend: true, animate: true, type: 'stacked', //stacked, grouped, : gradient labelOffset: 3, //label offset barsOffset: 0, //distance between bars hoveredColor: '#9fd4ff', orientation: 'vertical', showAggregates: true, showLabels: true, Tips: { enable: false, onShow: $.empty, onHide: $.empty }, Events: { enable: false, onClick: $.empty } }; $jit.ST.Plot.NodeTypes.implement({ 'funnelchart-basic' : { 'render' : function(node, canvas) { var pos = node.pos.getc(true), width = node.getData('width'), height = node.getData('height'), algnPos = this.getAlignedPos(pos, width, height), x = algnPos.x, y = algnPos.y, dimArray = node.getData('dimArray'), valueArray = node.getData('valueArray'), valuelabelArray = node.getData('valuelabelArray'), linkArray = node.getData('linkArray'), colorArray = node.getData('colorArray'), colorLength = colorArray.length, stringArray = node.getData('stringArray'); var ctx = canvas.getCtx(), opt = {}, border = node.getData('border'), gradient = node.getData('gradient'), config = node.getData('config'), horz = config.orientation == 'horizontal', aggregates = config.showAggregates, showLabels = config.showLabels, label = config.Label, size = canvas.getSize(), labelOffset = config.labelOffset + 10; minWidth = width * .25; ratio = .65; if (colorArray && dimArray && stringArray) { var newDimArray = this.positions(dimArray, label.size); // horizontal lines for (var i=0, l=dimArray.length, acum=0, valAcum=0; i<l; i++) { ctx.fillStyle = ctx.strokeStyle = colorArray[i % colorLength]; if(label.type == 'Native') { if(showLabels(node.name, valAcum, node)) { ctx.font = label.style + ' ' + label.size + 'px ' + label.family; var stringValue = stringArray[i]; var valueLabel = String(valuelabelArray[i]); var mV = ctx.measureText(stringValue); var mVL = ctx.measureText(valueLabel); var next_mVL = 0; var next_mV = 0; if ((i + 1) < l) { next_mV = ctx.measureText(stringArray[i + 1]); next_mVL = ctx.measureText(String(valuelabelArray[i + 1])); } else { next_mV = mV; next_mVL = mVL; } var previousElementHeight = (i > 0) ? dimArray[i - 1] : 100; var labelOffsetHeight = (previousElementHeight < label.size && i > 0) ? ((dimArray[i] > label.size) ? (dimArray[i]/2) - (label.size/2) : label.size) : 0; var topWidth = minWidth + ((acum + dimArray[i]) * ratio); var bottomWidth = minWidth + ((acum) * ratio); var bottomWidthLabel = minWidth + (newDimArray[i].position * ratio); var labelOffsetRight = (newDimArray[i].filament) ? (next_mV.width + 25) : 0; var labelOffsetLeft = (newDimArray[i].filament) ? (next_mVL.width + 25) : 0; // ctx.fillRect((-bottomWidth/2) - mVL.width - config.labelOffset , y - acum, bottomWidth + mVL.width + mV.width + (config.labelOffset*2), 1); //right lines ctx.beginPath(); ctx.moveTo(bottomWidth/2,y - acum); // ctx.lineTo(bottomWidthLabel / 2 + (labelOffset - 10), y - newDimArray[i].position); // top right ctx.lineTo(bottomWidthLabel / 2 + (labelOffset) + labelOffsetRight + mV.width, y - newDimArray[i].position); // bottom right ctx.stroke(); //left lines ctx.beginPath(); ctx.moveTo(-bottomWidth/2,y - acum); // ctx.lineTo( - bottomWidthLabel / 2 - (labelOffset - 10), y - newDimArray[i].position); // top right ctx.lineTo( - bottomWidthLabel / 2 - (labelOffset) - labelOffsetLeft - mVL.width, y - newDimArray[i].position); // bottom right ctx.stroke(); } } acum += (dimArray[i] || 0); valAcum += (valueArray[i] || 0); } //funnel segments and labels for (var i=0, l=dimArray.length, acum=0, valAcum=0; i<l; i++) { ctx.fillStyle = ctx.strokeStyle = colorArray[i % colorLength]; var colori = colorArray[i % colorLength]; if(label.type == 'Native') { var stringValue = stringArray[i]; var valueLabel = String(valuelabelArray[i]); var mV = ctx.measureText(stringValue); var mVL = ctx.measureText(valueLabel); } else { var mV = 10; var mVL = 10; } if ((i + 1) < l) { next_mV = ctx.measureText(stringArray[i + 1]); next_mVL = ctx.measureText(String(valuelabelArray[i + 1])); } else { next_mV = mV; next_mVL = mVL; } var previousElementHeight = (i > 0) ? dimArray[i - 1] : 100; var labelOffsetHeight = (previousElementHeight < label.size && i > 0) ? ((dimArray[i] > label.size) ? (dimArray[i]/2) - (label.size/2) : label.size) : 0; var labelOffsetRight = (newDimArray[i].filament) ? (next_mV.width + 20) : 0; var labelOffsetLeft = (newDimArray[i].filament) ? (next_mVL.width + 20) : 0; var topWidth = minWidth + ((acum + dimArray[i]) * ratio); var bottomWidth = minWidth + ((acum) * ratio); var bottomWidthLabel = minWidth + (newDimArray[i].position * ratio); if(gradient) { var linear; linear = ctx.createLinearGradient(-topWidth/2, y - acum - dimArray[i]/2, topWidth/2, y - acum- dimArray[i]/2); var colorRgb = $.hexToRgb(colori); var color = $.map($.hexToRgb(colorArray[i % colorLength].slice(1)), function(v) { return (v * .5) >> 0; }); linear.addColorStop(0, 'rgba('+color+',1)'); linear.addColorStop(0.5, 'rgba('+colorRgb+',1)'); linear.addColorStop(1, 'rgba('+color+',1)'); ctx.fillStyle = linear; } ctx.beginPath(); ctx.moveTo(-topWidth/2,y - acum - dimArray[i]); //top left ctx.lineTo(topWidth/2,y - acum - dimArray[i]); // top right ctx.lineTo(bottomWidth/2,y - acum); // bottom right ctx.lineTo(-bottomWidth/2,y - acum); // bottom left ctx.closePath(); ctx.fill(); if(border && border.name == stringArray[i]) { opt.acum = acum; opt.dimValue = dimArray[i]; } if(border) { ctx.save(); ctx.lineWidth = 2; ctx.strokeStyle = border.color; //ctx.strokeRect(x + 1, y - opt.acum - opt.dimValue + 1, minWidth -2, opt.dimValue -2); ctx.restore(); } if(label.type == 'Native') { ctx.save(); ctx.fillStyle = ctx.strokeStyle = label.color; ctx.font = label.style + ' ' + label.size + 'px ' + label.family; ctx.textBaseline = 'middle'; acumValueLabel = valAcum; if(showLabels(node.name, valAcum, node)) { ctx.textAlign = 'left'; ctx.fillText(stringArray[i], (bottomWidthLabel / 2) + labelOffset + labelOffsetRight, y - newDimArray[i].position - label.size / 2); ctx.textAlign = 'right'; ctx.fillText(valuelabelArray[i], (- bottomWidthLabel / 2) - labelOffset - labelOffsetLeft, y - newDimArray[i].position - label.size / 2); } ctx.restore(); } acum += (dimArray[i] || 0); valAcum += (valueArray[i] || 0); } } }, 'contains': function(node, mpos) { var pos = node.pos.getc(true), width = node.getData('width'), height = node.getData('height'), algnPos = this.getAlignedPos(pos, width, height), x = algnPos.x, y = algnPos.y, dimArray = node.getData('dimArray'), config = node.getData('config'), st = node.getData('st'), rx = mpos.x - x, horz = config.orientation == 'horizontal', minWidth = width * .25; ratio = .65, canvas = node.getData('canvas'), size = canvas.getSize(), offsetY = st.config.offsetY; //bounding box check if(mpos.y > y || mpos.y < y - height) { return false; } var newY = Math.abs(mpos.y + offsetY); var bound = minWidth + (newY * ratio); var boundLeft = -bound/2; var boundRight = bound/2; if(mpos.x < boundLeft || mpos.x > boundRight ) { return false; } //deep check for(var i=0, l=dimArray.length, acum=(horz? x:y); i<l; i++) { var dimi = dimArray[i]; var url = Url.decode(node.getData('linkArray')[i]); acum -= dimi; var intersec = acum; if(mpos.y >= intersec) { return { 'name': node.getData('stringArray')[i], 'color': node.getData('colorArray')[i], 'value': node.getData('valueArray')[i], 'percentage': node.getData('percentageArray')[i], 'valuelabel': node.getData('valuelabelArray')[i], 'link': url, 'label': node.name }; } } return false; } } }); /* Class: FunnelChart A visualization that displays funnel charts. Constructor Options: See <Options.FunnelChart>. */ $jit.FunnelChart = new Class({ st: null, colors: ["#004b9c", "#9c0079", "#9c0033", "#28009c", "#9c0000", "#7d009c", "#001a9c","#00809c","#009c80","#009c42","#009c07","#469c00","#799c00","#9c9600","#9c5c00"], selected: {}, busy: false, initialize: function(opt) { this.controller = this.config = $.merge(Options("Canvas", "Margin", "Label", "BarChart"), { Label: { type: 'Native' } }, opt); //set functions for showLabels and showAggregates var showLabels = this.config.showLabels, typeLabels = $.type(showLabels), showAggregates = this.config.showAggregates, typeAggregates = $.type(showAggregates); this.config.showLabels = typeLabels == 'function'? showLabels : $.lambda(showLabels); this.config.showAggregates = typeAggregates == 'function'? showAggregates : $.lambda(showAggregates); Options.Fx.clearCanvas = false; this.initializeViz(); }, initializeViz: function() { var config = this.config, that = this; var nodeType = config.type.split(":")[0], horz = config.orientation == 'horizontal', nodeLabels = {}; var st = new $jit.ST({ injectInto: config.injectInto, orientation: horz? 'left' : 'bottom', levelDistance: 0, background: config.background, renderBackground: config.renderBackground, backgroundColor: config.backgroundColor, colorStop1: config.colorStop1, colorStop2: config.colorStop2, siblingOffset: config.segmentOffset, subtreeOffset: 0, withLabels: config.Label.type != 'Native', useCanvas: config.useCanvas, Label: { type: config.Label.type }, Node: { overridable: true, type: 'funnelchart-' + nodeType, align: 'left', width: 1, height: 1 }, Edge: { type: 'none' }, Tips: { enable: config.Tips.enable, type: 'Native', force: true, onShow: function(tip, node, contains) { var elem = contains; config.Tips.onShow(tip, elem, node); if(elem.link != 'undefined' && elem.link != '') { document.body.style.cursor = 'pointer'; } }, onHide: function(call) { document.body.style.cursor = 'default'; } }, Events: { enable: true, type: 'Native', onClick: function(node, eventInfo, evt) { if(!config.Events.enable) return; var elem = eventInfo.getContains(); config.Events.onClick(elem, eventInfo, evt); }, onMouseMove: function(node, eventInfo, evt) { if(!config.hoveredColor) return; if(node) { var elem = eventInfo.getContains(); that.select(node.id, elem.name, elem.index); } else { that.select(false, false, false); } } }, onCreateLabel: function(domElement, node) { var labelConf = config.Label, valueArray = node.getData('valueArray'), idArray = node.getData('idArray'), valuelabelArray = node.getData('valuelabelArray'), stringArray = node.getData('stringArray'); size = st.canvas.getSize() prefix = $.time(); for(var i=0, l=valueArray.length; i<l; i++) { var nlbs = { wrapper: document.createElement('div'), valueLabel: document.createElement('div'), label: document.createElement('div') }; var wrapper = nlbs.wrapper, label = nlbs.label, valueLabel = nlbs.valueLabel, wrapperStyle = wrapper.style, labelStyle = label.style, valueLabelStyle = valueLabel.style; //store node labels nodeLabels[idArray[i]] = nlbs; //append labels wrapper.appendChild(label); wrapper.appendChild(valueLabel); wrapperStyle.position = 'relative'; wrapperStyle.overflow = 'visible'; wrapperStyle.fontSize = labelConf.size + 'px'; wrapperStyle.fontFamily = labelConf.family; wrapperStyle.color = labelConf.color; wrapperStyle.textAlign = 'center'; wrapperStyle.width = size.width + 'px'; valueLabelStyle.position = labelStyle.position = 'absolute'; valueLabelStyle.left = labelStyle.left = '0px'; valueLabelStyle.width = (size.width/3) + 'px'; valueLabelStyle.textAlign = 'right'; label.innerHTML = stringArray[i]; valueLabel.innerHTML = valuelabelArray[i]; domElement.id = prefix+'funnel'; domElement.style.width = size.width + 'px'; domElement.appendChild(wrapper); } }, onPlaceLabel: function(domElement, node) { var dimArray = node.getData('dimArray'), idArray = node.getData('idArray'), valueArray = node.getData('valueArray'), valuelabelArray = node.getData('valuelabelArray'), stringArray = node.getData('stringArray'); size = st.canvas.getSize(), pos = node.pos.getc(true), domElement.style.left = "0px", domElement.style.top = "0px", minWidth = node.getData('width') * .25, ratio = .65, pos = node.pos.getc(true), labelConf = config.Label; for(var i=0, l=valueArray.length, acum = 0; i<l; i++) { var labels = nodeLabels[idArray[i]], wrapperStyle = labels.wrapper.style, labelStyle = labels.label.style, valueLabelStyle = labels.valueLabel.style; var bottomWidth = minWidth + (acum * ratio); font = parseInt(wrapperStyle.fontSize, 10), domStyle = domElement.style; wrapperStyle.top = (pos.y + size.height/2) - acum - labelConf.size + "px"; valueLabelStyle.left = (size.width/2) - (bottomWidth/2) - config.labelOffset - (size.width/3) + 'px'; labelStyle.left = (size.width/2) + (bottomWidth/2) + config.labelOffset + 'px';; acum += (dimArray[i] || 0); } } }); var size = st.canvas.getSize(), margin = config.Margin; title = config.Title; subtitle = config.Subtitle; //y offset st.config.offsetY = -size.height/2 + margin.bottom + (config.showLabels && (config.labelOffset + config.Label.size)) + (subtitle.text? subtitle.size+subtitle.offset:0); st.config.offsetX = (margin.right - margin.left)/2; this.st = st; this.canvas = this.st.canvas; }, renderTitle: function() { var canvas = this.canvas, size = canvas.getSize(), config = this.config, margin = config.Margin, label = config.Label, title = config.Title; ctx = canvas.getCtx(); ctx.fillStyle = title.color; ctx.textAlign = 'left'; ctx.font = label.style + ' bold ' +' ' + title.size + 'px ' + label.family; if(label.type == 'Native') { ctx.fillText(title.text, -size.width/2+margin.left, -size.height/2+margin.top); } }, renderSubtitle: function() { var canvas = this.canvas, size = canvas.getSize(), config = this.config, margin = config.Margin, label = config.Label, subtitle = config.Subtitle; ctx = canvas.getCtx(); ctx.fillStyle = title.color; ctx.textAlign = 'left'; ctx.font = label.style + ' ' + subtitle.size + 'px ' + label.family; if(label.type == 'Native') { ctx.fillText(subtitle.text, -size.width/2+margin.left, size.height/2-margin.bottom-subtitle.size); } }, renderDropShadow: function() { var canvas = this.canvas, size = canvas.getSize(), config = this.config, margin = config.Margin, horz = config.orientation == 'horizontal', label = config.Label, title = config.Title, shadowThickness = 4, subtitle = config.Subtitle, ctx = canvas.getCtx(), minwidth = (size.width/8) * .25, marginHeight = (title.text? title.size + title.offset : 0) + (subtitle.text? subtitle.size + subtitle.offset : 0) + margin.top + margin.bottom, topMargin = (title.text? title.size + title.offset : 0) + margin.top, height = size[horz? 'width':'height'] - (horz? marginWidth:marginHeight) - (config.showLabels && (config.Label.size + config.labelOffset)), ratio = .65, topWidth = minwidth + ((height + (shadowThickness*4)) * ratio); topY = (-size.height/2) + topMargin - shadowThickness; bottomY = (-size.height/2) + topMargin + height + shadowThickness; bottomWidth = minwidth + shadowThickness; ctx.beginPath(); ctx.fillStyle = "rgba(0,0,0,.2)"; ctx.moveTo(0,topY); ctx.lineTo(-topWidth/2,topY); //top left ctx.lineTo(-bottomWidth/2,bottomY); // bottom left ctx.lineTo(bottomWidth/2,bottomY); // bottom right ctx.lineTo(topWidth/2,topY); // top right ctx.closePath(); ctx.fill(); }, renderBackground: function() { var canvas = this.canvas, config = this.config, backgroundColor = config.backgroundColor, size = canvas.getSize(), ctx = canvas.getCtx(); //ctx.globalCompositeOperation = "destination-over"; ctx.fillStyle = backgroundColor; ctx.fillRect(-size.width/2,-size.height/2,size.width,size.height); }, clear: function() { var canvas = this.canvas; var ctx = canvas.getCtx(), size = canvas.getSize(); ctx.fillStyle = "rgba(255,255,255,0)"; ctx.fillRect(-size.width/2,-size.height/2,size.width,size.height); ctx.clearRect(-size.width/2,-size.height/2,size.width,size.height); }, resizeGraph: function(json,width) { var canvas = this.canvas, size = canvas.getSize(), config = this.config, orgHeight = size.height; canvas.resize(width,orgHeight); if(typeof FlashCanvas == "undefined") { canvas.clear(); } else { this.clear();// hack for flashcanvas bug not properly clearing rectangle } this.loadJSON(json); }, loadJSON: function(json) { if(this.busy) return; this.busy = true; var prefix = $.time(), ch = [], st = this.st, name = $.splat(json.label), color = $.splat(json.color || this.colors), config = this.config, canvas = this.canvas, gradient = !!config.type.split(":")[1], animate = config.animate, title = config.Title, subtitle = config.Subtitle, renderBackground = config.renderBackground, horz = config.orientation == 'horizontal', that = this, colorLength = color.length, nameLength = name.length, totalValue = 0; for(var i=0, values=json.values, l=values.length; i<l; i++) { var val = values[i]; var valArray = $.splat(val.values); totalValue += parseFloat(valArray.sum()); } var nameArray = new Array(); var idArray = new Array(); var valArray = new Array(); var valuelabelArray = new Array(); var linkArray = new Array(); var titleArray = new Array(); var percentageArray = new Array(); for(var i=0, values=json.values, l=values.length; i<l; i++) { var val = values[i]; nameArray[i] = $.splat(val.label); idArray[i] = $.splat(prefix + val.label); valArray[i] = $.splat(val.values); valuelabelArray[i] = $.splat(val.valuelabels); linkArray[i] = $.splat(val.links); titleArray[i] = $.splat(val.titles); percentageArray[i] = (($.splat(val.values).sum()/totalValue) * 100).toFixed(1); var acum = 0; } nameArray.reverse(); valArray.reverse(); valuelabelArray.reverse(); linkArray.reverse(); titleArray.reverse(); percentageArray.reverse(); ch.push({ 'id': prefix + val.label, 'name': val.label, 'data': { 'value': valArray, '$idArray': idArray, '$linkArray': linkArray, '$titleArray': titleArray, '$valueArray': valArray, '$valuelabelArray': valuelabelArray, '$colorArray': color, '$colorMono': $.splat(color[i % colorLength]), '$stringArray': (typeof FlashCanvas == "undefined") ? nameArray: name.reverse(), '$gradient': gradient, '$config': config, '$percentageArray' : percentageArray, '$canvas': canvas, '$st': st }, 'children': [] }); var root = { 'id': prefix + '$root', 'name': '', 'data': { '$type': 'none', '$width': 1, '$height': 1 }, 'children': ch }; st.loadJSON(root); this.normalizeDims(); if(renderBackground) { this.renderBackground(); } if(!animate && title.text) { this.renderTitle(); } if(!animate && subtitle.text) { this.renderSubtitle(); } if(typeof FlashCanvas == "undefined") { this.renderDropShadow(); } st.compute(); st.select(st.root); if(animate) { if(horz) { st.fx.animate({ modes: ['node-property:width:dimArray'], duration:1500, onComplete: function() { that.busy = false; } }); } else { st.fx.animate({ modes: ['node-property:height:dimArray'], duration:1500, onComplete: function() { that.busy = false; } }); } } else { this.busy = false; } }, /* Method: updateJSON Use this method when updating values for the current JSON data. If the items specified by the JSON data already exist in the graph then their values will be updated. Parameters: json - (object) JSON data to be updated. The JSON format corresponds to the one described in <BarChart.loadJSON>. onComplete - (object) A callback object to be called when the animation transition when updating the data end. Example: (start code js) barChart.updateJSON(json, { onComplete: function() { alert('update complete!'); } }); (end code) */ updateJSON: function(json, onComplete) { if(this.busy) return; this.busy = true; var st = this.st; var graph = st.graph; var values = json.values; var animate = this.config.animate; var that = this; var horz = this.config.orientation == 'horizontal'; $.each(values, function(v) { var n = graph.getByName(v.label); if(n) { n.setData('valueArray', $.splat(v.values)); if(json.label) { n.setData('stringArray', $.splat(json.label)); } } }); this.normalizeDims(); st.compute(); st.select(st.root); if(animate) { if(horz) { st.fx.animate({ modes: ['node-property:width:dimArray'], duration:1500, onComplete: function() { that.busy = false; onComplete && onComplete.onComplete(); } }); } else { st.fx.animate({ modes: ['node-property:height:dimArray'], duration:1500, onComplete: function() { that.busy = false; onComplete && onComplete.onComplete(); } }); } } }, //adds the little brown bar when hovering the node select: function(id, name) { if(!this.config.hoveredColor) return; var s = this.selected; if(s.id != id || s.name != name) { s.id = id; s.name = name; s.color = this.config.hoveredColor; this.st.graph.eachNode(function(n) { if(id == n.id) { n.setData('border', s); } else { n.setData('border', false); } }); this.st.plot(); } }, /* Method: getLegend Returns an object containing as keys the legend names and as values hex strings with color values. Example: (start code js) var legend = barChart.getLegend(); (end code) */ getLegend: function() { var legend = new Array(); var name = new Array(); var color = new Array(); var n; this.st.graph.getNode(this.st.root).eachAdjacency(function(adj) { n = adj.nodeTo; }); var colors = n.getData('colorArray'), len = colors.length; $.each(n.getData('stringArray'), function(s, i) { color[i] = colors[i % len]; name[i] = s; }); legend['name'] = name; legend['color'] = color; return legend; }, /* Method: getMaxValue Returns the maximum accumulated value for the stacks. This method is used for normalizing the graph heights according to the canvas height. Example: (start code js) var ans = barChart.getMaxValue(); (end code) In some cases it could be useful to override this method to normalize heights for a group of BarCharts, like when doing small multiples. Example: (start code js) //will return 100 for all BarChart instances, //displaying all of them with the same scale $jit.BarChart.implement({ 'getMaxValue': function() { return 100; } }); (end code) */ getMaxValue: function() { var maxValue = 0, stacked = true; this.st.graph.eachNode(function(n) { var valArray = n.getData('valueArray'), acum = 0; if(!valArray) return; if(stacked) { $.each(valArray, function(v) { acum += +v; }); } else { acum = Math.max.apply(null, valArray); } maxValue = maxValue>acum? maxValue:acum; }); return maxValue; }, setBarType: function(type) { this.config.type = type; this.st.config.Node.type = 'funnelchart-' + type.split(':')[0]; }, normalizeDims: function() { //number of elements var root = this.st.graph.getNode(this.st.root), l=0; root.eachAdjacency(function() { l++; }); var maxValue = this.getMaxValue() || 1, size = this.st.canvas.getSize(), config = this.config, margin = config.Margin, title = config.Title, subtitle = config.Subtitle, marginWidth = margin.left + margin.right, marginHeight = (title.text? title.size + title.offset : 0) + (subtitle.text? subtitle.size + subtitle.offset : 0) + margin.top + margin.bottom, horz = config.orientation == 'horizontal', animate = config.animate, height = size[horz? 'width':'height'] - (horz? marginWidth:marginHeight) - (config.showLabels && (config.Label.size + config.labelOffset)), dim1 = horz? 'height':'width', dim2 = horz? 'width':'height'; minWidth = size.width/8; this.st.graph.eachNode(function(n) { var acum = 0, animateValue = []; $.each(n.getData('valueArray'), function(v) { acum += +v; animateValue.push(0); }); n.setData(dim1, minWidth); if(animate) { n.setData(dim2, acum * height / maxValue, 'end'); n.setData('dimArray', $.map(n.getData('valueArray'), function(n) { return n * height / maxValue; }), 'end'); var dimArray = n.getData('dimArray'); if(!dimArray) { n.setData('dimArray', animateValue); } } else { n.setData(dim2, acum * height / maxValue); n.setData('dimArray', $.map(n.getData('valueArray'), function(n) { return n * height / maxValue; })); } }); } }); /* * File: Options.PieChart.js * */ /* Object: Options.PieChart <PieChart> options. Other options included in the PieChart are <Options.Canvas>, <Options.Label>, <Options.Tips> and <Options.Events>. Syntax: (start code js) Options.PieChart = { animate: true, offset: 25, sliceOffset:0, labelOffset: 3, type: 'stacked', hoveredColor: '#9fd4ff', showLabels: true, resizeLabels: false, updateHeights: false }; (end code) Example: (start code js) var pie = new $jit.PieChart({ animate: true, sliceOffset: 5, type: 'stacked:gradient' }); (end code) Parameters: animate - (boolean) Default's *true*. Whether to add animated transitions when plotting/updating the visualization. offset - (number) Default's *25*. Adds margin between the visualization and the canvas. sliceOffset - (number) Default's *0*. Separation between the center of the canvas and each pie slice. labelOffset - (number) Default's *3*. Adds margin between the label and the default place where it should be drawn. type - (string) Default's *'stacked'*. Stack style. Posible values are 'stacked', 'stacked:gradient' to add gradients. hoveredColor - (boolean|string) Default's *'#9fd4ff'*. Sets the selected color for a hovered pie stack. showLabels - (boolean) Default's *true*. Display the name of the slots. resizeLabels - (boolean|number) Default's *false*. Resize the pie labels according to their stacked values. Set a number for *resizeLabels* to set a font size minimum. updateHeights - (boolean) Default's *false*. Only for mono-valued (most common) pie charts. Resize the height of the pie slices according to their current values. */ Options.PieChart = { $extend: true, animate: true, offset: 25, // page offset sliceOffset:0, labelOffset: 3, // label offset type: 'stacked', // gradient labelType: 'name', hoveredColor: '#9fd4ff', Events: { enable: false, onClick: $.empty }, Tips: { enable: false, onShow: $.empty, onHide: $.empty }, showLabels: true, resizeLabels: false, //only valid for mono-valued datasets updateHeights: false }; /* * Class: Layouts.Radial * * Implements a Radial Layout. * * Implemented By: * * <RGraph>, <Hypertree> * */ Layouts.Radial = new Class({ /* * Method: compute * * Computes nodes' positions. * * Parameters: * * property - _optional_ A <Graph.Node> position property to store the new * positions. Possible values are 'pos', 'end' or 'start'. * */ compute : function(property) { var prop = $.splat(property || [ 'current', 'start', 'end' ]); NodeDim.compute(this.graph, prop, this.config); this.graph.computeLevels(this.root, 0, "ignore"); var lengthFunc = this.createLevelDistanceFunc(); this.computeAngularWidths(prop); this.computePositions(prop, lengthFunc); }, /* * computePositions * * Performs the main algorithm for computing node positions. */ computePositions : function(property, getLength) { var propArray = property; var graph = this.graph; var root = graph.getNode(this.root); var parent = this.parent; var config = this.config; for ( var i=0, l=propArray.length; i < l; i++) { var pi = propArray[i]; root.setPos($P(0, 0), pi); root.setData('span', Math.PI * 2, pi); } root.angleSpan = { begin : 0, end : 2 * Math.PI }; graph.eachBFS(this.root, function(elem) { var angleSpan = elem.angleSpan.end - elem.angleSpan.begin; var angleInit = elem.angleSpan.begin; var len = getLength(elem); //Calculate the sum of all angular widths var totalAngularWidths = 0, subnodes = [], maxDim = {}; elem.eachSubnode(function(sib) { totalAngularWidths += sib._treeAngularWidth; //get max dim for ( var i=0, l=propArray.length; i < l; i++) { var pi = propArray[i], dim = sib.getData('dim', pi); maxDim[pi] = (pi in maxDim)? (dim > maxDim[pi]? dim : maxDim[pi]) : dim; } subnodes.push(sib); }, "ignore"); //Maintain children order //Second constraint for <http://bailando.sims.berkeley.edu/papers/infovis01.htm> if (parent && parent.id == elem.id && subnodes.length > 0 && subnodes[0].dist) { subnodes.sort(function(a, b) { return (a.dist >= b.dist) - (a.dist <= b.dist); }); } //Calculate nodes positions. for (var k = 0, ls=subnodes.length; k < ls; k++) { var child = subnodes[k]; if (!child._flag) { var angleProportion = child._treeAngularWidth / totalAngularWidths * angleSpan; var theta = angleInit + angleProportion / 2; for ( var i=0, l=propArray.length; i < l; i++) { var pi = propArray[i]; child.setPos($P(theta, len), pi); child.setData('span', angleProportion, pi); child.setData('dim-quotient', child.getData('dim', pi) / maxDim[pi], pi); } child.angleSpan = { begin : angleInit, end : angleInit + angleProportion }; angleInit += angleProportion; } } }, "ignore"); }, /* * Method: setAngularWidthForNodes * * Sets nodes angular widths. */ setAngularWidthForNodes : function(prop) { this.graph.eachBFS(this.root, function(elem, i) { var diamValue = elem.getData('angularWidth', prop[0]) || 5; elem._angularWidth = diamValue / i; }, "ignore"); }, /* * Method: setSubtreesAngularWidth * * Sets subtrees angular widths. */ setSubtreesAngularWidth : function() { var that = this; this.graph.eachNode(function(elem) { that.setSubtreeAngularWidth(elem); }, "ignore"); }, /* * Method: setSubtreeAngularWidth * * Sets the angular width for a subtree. */ setSubtreeAngularWidth : function(elem) { var that = this, nodeAW = elem._angularWidth, sumAW = 0; elem.eachSubnode(function(child) { that.setSubtreeAngularWidth(child); sumAW += child._treeAngularWidth; }, "ignore"); elem._treeAngularWidth = Math.max(nodeAW, sumAW); }, /* * Method: computeAngularWidths * * Computes nodes and subtrees angular widths. */ computeAngularWidths : function(prop) { this.setAngularWidthForNodes(prop); this.setSubtreesAngularWidth(); } }); /* * File: Sunburst.js */ /* Class: Sunburst A radial space filling tree visualization. Inspired by: Sunburst <http://www.cc.gatech.edu/gvu/ii/sunburst/>. Note: This visualization was built and engineered from scratch, taking only the paper as inspiration, and only shares some features with the visualization described in the paper. Implements: All <Loader> methods Constructor Options: Inherits options from - <Options.Canvas> - <Options.Controller> - <Options.Node> - <Options.Edge> - <Options.Label> - <Options.Events> - <Options.Tips> - <Options.NodeStyles> - <Options.Navigation> Additionally, there are other parameters and some default values changed interpolation - (string) Default's *linear*. Describes the way nodes are interpolated. Possible values are 'linear' and 'polar'. levelDistance - (number) Default's *100*. The distance between levels of the tree. Node.type - Described in <Options.Node>. Default's to *multipie*. Node.height - Described in <Options.Node>. Default's *0*. Edge.type - Described in <Options.Edge>. Default's *none*. Label.textAlign - Described in <Options.Label>. Default's *start*. Label.textBaseline - Described in <Options.Label>. Default's *middle*. Instance Properties: canvas - Access a <Canvas> instance. graph - Access a <Graph> instance. op - Access a <Sunburst.Op> instance. fx - Access a <Sunburst.Plot> instance. labels - Access a <Sunburst.Label> interface implementation. */ $jit.Sunburst = new Class({ Implements: [ Loader, Extras, Layouts.Radial ], initialize: function(controller) { var $Sunburst = $jit.Sunburst; var config = { interpolation: 'linear', levelDistance: 100, Node: { 'type': 'multipie', 'height':0 }, Edge: { 'type': 'none' }, Label: { textAlign: 'start', textBaseline: 'middle' } }; this.controller = this.config = $.merge(Options("Canvas", "Node", "Edge", "Fx", "Tips", "NodeStyles", "Events", "Navigation", "Controller", "Label"), config, controller); var canvasConfig = this.config; if(canvasConfig.useCanvas) { this.canvas = canvasConfig.useCanvas; this.config.labelContainer = this.canvas.id + '-label'; } else { if(canvasConfig.background) { canvasConfig.background = $.merge({ type: 'Fade', colorStop1: this.config.colorStop1, colorStop2: this.config.colorStop2 }, canvasConfig.background); } this.canvas = new Canvas(this, canvasConfig); this.config.labelContainer = (typeof canvasConfig.injectInto == 'string'? canvasConfig.injectInto : canvasConfig.injectInto.id) + '-label'; } this.graphOptions = { 'complex': false, 'Node': { 'selected': false, 'exist': true, 'drawn': true } }; this.graph = new Graph(this.graphOptions, this.config.Node, this.config.Edge); this.labels = new $Sunburst.Label[canvasConfig.Label.type](this); this.fx = new $Sunburst.Plot(this, $Sunburst); this.op = new $Sunburst.Op(this); this.json = null; this.root = null; this.rotated = null; this.busy = false; // initialize extras this.initializeExtras(); }, /* createLevelDistanceFunc Returns the levelDistance function used for calculating a node distance to its origin. This function returns a function that is computed per level and not per node, such that all nodes with the same depth will have the same distance to the origin. The resulting function gets the parent node as parameter and returns a float. */ createLevelDistanceFunc: function() { var ld = this.config.levelDistance; return function(elem) { return (elem._depth + 1) * ld; }; }, /* Method: refresh Computes positions and plots the tree. */ refresh: function() { this.compute(); this.plot(); }, /* reposition An alias for computing new positions to _endPos_ See also: <Sunburst.compute> */ reposition: function() { this.compute('end'); }, /* Method: rotate Rotates the graph so that the selected node is horizontal on the right. Parameters: node - (object) A <Graph.Node>. method - (string) Whether to perform an animation or just replot the graph. Possible values are "replot" or "animate". opt - (object) Configuration options merged with this visualization configuration options. See also: <Sunburst.rotateAngle> */ rotate: function(node, method, opt) { var theta = node.getPos(opt.property || 'current').getp(true).theta; this.rotated = node; this.rotateAngle(-theta, method, opt); }, /* Method: rotateAngle Rotates the graph of an angle theta. Parameters: node - (object) A <Graph.Node>. method - (string) Whether to perform an animation or just replot the graph. Possible values are "replot" or "animate". opt - (object) Configuration options merged with this visualization configuration options. See also: <Sunburst.rotate> */ rotateAngle: function(theta, method, opt) { var that = this; var options = $.merge(this.config, opt || {}, { modes: [ 'polar' ] }); var prop = opt.property || (method === "animate" ? 'end' : 'current'); if(method === 'animate') { this.fx.animation.pause(); } this.graph.eachNode(function(n) { var p = n.getPos(prop); p.theta += theta; if (p.theta < 0) { p.theta += Math.PI * 2; } }); if (method == 'animate') { this.fx.animate(options); } else if (method == 'replot') { this.fx.plot(); this.busy = false; } }, /* Method: plot Plots the Sunburst. This is a shortcut to *fx.plot*. */ plot: function() { this.fx.plot(); } }); $jit.Sunburst.$extend = true; (function(Sunburst) { /* Class: Sunburst.Op Custom extension of <Graph.Op>. Extends: All <Graph.Op> methods See also: <Graph.Op> */ Sunburst.Op = new Class( { Implements: Graph.Op }); /* Class: Sunburst.Plot Custom extension of <Graph.Plot>. Extends: All <Graph.Plot> methods See also: <Graph.Plot> */ Sunburst.Plot = new Class( { Implements: Graph.Plot }); /* Class: Sunburst.Label Custom extension of <Graph.Label>. Contains custom <Graph.Label.SVG>, <Graph.Label.HTML> and <Graph.Label.Native> extensions. Extends: All <Graph.Label> methods and subclasses. See also: <Graph.Label>, <Graph.Label.Native>, <Graph.Label.HTML>, <Graph.Label.SVG>. */ Sunburst.Label = {}; /* Sunburst.Label.Native Custom extension of <Graph.Label.Native>. Extends: All <Graph.Label.Native> methods See also: <Graph.Label.Native> */ Sunburst.Label.Native = new Class( { Implements: Graph.Label.Native, initialize: function(viz) { this.viz = viz; this.label = viz.config.Label; this.config = viz.config; }, renderLabel: function(canvas, node, controller) { var span = node.getData('span'); if(span < Math.PI /2 && Math.tan(span) * this.config.levelDistance * node._depth < 10) { return; } var ctx = canvas.getCtx(); var measure = ctx.measureText(node.name); if (node.id == this.viz.root) { var x = -measure.width / 2, y = 0, thetap = 0; var ld = 0; } else { var indent = 5; var ld = controller.levelDistance - indent; var clone = node.pos.clone(); clone.rho += indent; var p = clone.getp(true); var ct = clone.getc(true); var x = ct.x, y = ct.y; // get angle in degrees var pi = Math.PI; var cond = (p.theta > pi / 2 && p.theta < 3 * pi / 2); var thetap = cond ? p.theta + pi : p.theta; if (cond) { x -= Math.abs(Math.cos(p.theta) * measure.width); y += Math.sin(p.theta) * measure.width; } else if (node.id == this.viz.root) { x -= measure.width / 2; } } ctx.save(); ctx.translate(x, y); ctx.rotate(thetap); ctx.fillText(node.name, 0, 0); ctx.restore(); } }); /* Sunburst.Label.SVG Custom extension of <Graph.Label.SVG>. Extends: All <Graph.Label.SVG> methods See also: <Graph.Label.SVG> */ Sunburst.Label.SVG = new Class( { Implements: Graph.Label.SVG, initialize: function(viz) { this.viz = viz; }, /* placeLabel Overrides abstract method placeLabel in <Graph.Plot>. Parameters: tag - A DOM label element. node - A <Graph.Node>. controller - A configuration/controller object passed to the visualization. */ placeLabel: function(tag, node, controller) { var pos = node.pos.getc(true), viz = this.viz, canvas = this.viz.canvas; var radius = canvas.getSize(); var labelPos = { x: Math.round(pos.x + radius.width / 2), y: Math.round(pos.y + radius.height / 2) }; tag.setAttribute('x', labelPos.x); tag.setAttribute('y', labelPos.y); var bb = tag.getBBox(); if (bb) { // center the label var x = tag.getAttribute('x'); var y = tag.getAttribute('y'); // get polar coordinates var p = node.pos.getp(true); // get angle in degrees var pi = Math.PI; var cond = (p.theta > pi / 2 && p.theta < 3 * pi / 2); if (cond) { tag.setAttribute('x', x - bb.width); tag.setAttribute('y', y - bb.height); } else if (node.id == viz.root) { tag.setAttribute('x', x - bb.width / 2); } var thetap = cond ? p.theta + pi : p.theta; if(node._depth) tag.setAttribute('transform', 'rotate(' + thetap * 360 / (2 * pi) + ' ' + x + ' ' + y + ')'); } controller.onPlaceLabel(tag, node); } }); /* Sunburst.Label.HTML Custom extension of <Graph.Label.HTML>. Extends: All <Graph.Label.HTML> methods. See also: <Graph.Label.HTML> */ Sunburst.Label.HTML = new Class( { Implements: Graph.Label.HTML, initialize: function(viz) { this.viz = viz; }, /* placeLabel Overrides abstract method placeLabel in <Graph.Plot>. Parameters: tag - A DOM label element. node - A <Graph.Node>. controller - A configuration/controller object passed to the visualization. */ placeLabel: function(tag, node, controller) { var pos = node.pos.clone(), canvas = this.viz.canvas, height = node.getData('height'), ldist = ((height || node._depth == 0)? height : this.viz.config.levelDistance) /2, radius = canvas.getSize(); pos.rho += ldist; pos = pos.getc(true); var labelPos = { x: Math.round(pos.x + radius.width / 2), y: Math.round(pos.y + radius.height / 2) }; var style = tag.style; style.left = labelPos.x + 'px'; style.top = labelPos.y + 'px'; style.display = this.fitsInCanvas(labelPos, canvas) ? '' : 'none'; controller.onPlaceLabel(tag, node); } }); /* Class: Sunburst.Plot.NodeTypes This class contains a list of <Graph.Node> built-in types. Node types implemented are 'none', 'pie', 'multipie', 'gradient-pie' and 'gradient-multipie'. You can add your custom node types, customizing your visualization to the extreme. Example: (start code js) Sunburst.Plot.NodeTypes.implement({ 'mySpecialType': { 'render': function(node, canvas) { //print your custom node to canvas }, //optional 'contains': function(node, pos) { //return true if pos is inside the node or false otherwise } } }); (end code) */ Sunburst.Plot.NodeTypes = new Class( { 'none': { 'render': $.empty, 'contains': $.lambda(false), 'anglecontains': function(node, pos) { var span = node.getData('span') / 2, theta = node.pos.theta; var begin = theta - span, end = theta + span; if (begin < 0) begin += Math.PI * 2; var atan = Math.atan2(pos.y, pos.x); if (atan < 0) atan += Math.PI * 2; if (begin > end) { return (atan > begin && atan <= Math.PI * 2) || atan < end; } else { return atan > begin && atan < end; } }, 'anglecontainsgauge': function(node, pos) { var span = node.getData('span') / 2, theta = node.pos.theta; var config = node.getData('config'); var ld = this.config.levelDistance; var yOffset = pos.y-(ld/2); var begin = ((theta - span)/2)+Math.PI, end = ((theta + span)/2)+Math.PI; if (begin < 0) begin += Math.PI * 2; var atan = Math.atan2(yOffset, pos.x); if (atan < 0) atan += Math.PI * 2; if (begin > end) { return (atan > begin && atan <= Math.PI * 2) || atan < end; } else { return atan > begin && atan < end; } } }, 'pie': { 'render': function(node, canvas) { var span = node.getData('span') / 2, theta = node.pos.theta; var begin = theta - span, end = theta + span; var polarNode = node.pos.getp(true); var polar = new Polar(polarNode.rho, begin); var p1coord = polar.getc(true); polar.theta = end; var p2coord = polar.getc(true); var ctx = canvas.getCtx(); ctx.beginPath(); ctx.moveTo(0, 0); ctx.lineTo(p1coord.x, p1coord.y); ctx.moveTo(0, 0); ctx.lineTo(p2coord.x, p2coord.y); ctx.moveTo(0, 0); ctx.arc(0, 0, polarNode.rho * node.getData('dim-quotient'), begin, end, false); ctx.fill(); }, 'contains': function(node, pos) { if (this.nodeTypes['none'].anglecontains.call(this, node, pos)) { var rho = Math.sqrt(pos.x * pos.x + pos.y * pos.y); var ld = this.config.levelDistance, d = node._depth; return (rho <= ld * d); } return false; } }, 'multipie': { 'render': function(node, canvas) { var height = node.getData('height'); var ldist = height? height : this.config.levelDistance; var span = node.getData('span') / 2, theta = node.pos.theta; var begin = theta - span, end = theta + span; var polarNode = node.pos.getp(true); var polar = new Polar(polarNode.rho, begin); var p1coord = polar.getc(true); polar.theta = end; var p2coord = polar.getc(true); polar.rho += ldist; var p3coord = polar.getc(true); polar.theta = begin; var p4coord = polar.getc(true); var ctx = canvas.getCtx(); ctx.moveTo(0, 0); ctx.beginPath(); ctx.arc(0, 0, polarNode.rho, begin, end, false); ctx.arc(0, 0, polarNode.rho + ldist, end, begin, true); ctx.moveTo(p1coord.x, p1coord.y); ctx.lineTo(p4coord.x, p4coord.y); ctx.moveTo(p2coord.x, p2coord.y); ctx.lineTo(p3coord.x, p3coord.y); ctx.fill(); if (node.collapsed) { ctx.save(); ctx.lineWidth = 2; ctx.moveTo(0, 0); ctx.beginPath(); ctx.arc(0, 0, polarNode.rho + ldist + 5, end - 0.01, begin + 0.01, true); ctx.stroke(); ctx.restore(); } }, 'contains': function(node, pos) { if (this.nodeTypes['none'].anglecontains.call(this, node, pos)) { var rho = Math.sqrt(pos.x * pos.x + pos.y * pos.y); var height = node.getData('height'); var ldist = height? height : this.config.levelDistance; var ld = this.config.levelDistance, d = node._depth; return (rho >= ld * d) && (rho <= (ld * d + ldist)); } return false; } }, 'gradient-multipie': { 'render': function(node, canvas) { var ctx = canvas.getCtx(); var height = node.getData('height'); var ldist = height? height : this.config.levelDistance; var radialGradient = ctx.createRadialGradient(0, 0, node.getPos().rho, 0, 0, node.getPos().rho + ldist); var colorArray = $.hexToRgb(node.getData('color')), ans = []; $.each(colorArray, function(i) { ans.push(parseInt(i * 0.5, 10)); }); var endColor = $.rgbToHex(ans); radialGradient.addColorStop(0, endColor); radialGradient.addColorStop(1, node.getData('color')); ctx.fillStyle = radialGradient; this.nodeTypes['multipie'].render.call(this, node, canvas); }, 'contains': function(node, pos) { return this.nodeTypes['multipie'].contains.call(this, node, pos); } }, 'gradient-pie': { 'render': function(node, canvas) { var ctx = canvas.getCtx(); var radialGradient = ctx.createRadialGradient(0, 0, 0, 0, 0, node .getPos().rho); var colorArray = $.hexToRgb(node.getData('color')), ans = []; $.each(colorArray, function(i) { ans.push(parseInt(i * 0.5, 10)); }); var endColor = $.rgbToHex(ans); radialGradient.addColorStop(1, endColor); radialGradient.addColorStop(0, node.getData('color')); ctx.fillStyle = radialGradient; this.nodeTypes['pie'].render.call(this, node, canvas); }, 'contains': function(node, pos) { return this.nodeTypes['pie'].contains.call(this, node, pos); } } }); /* Class: Sunburst.Plot.EdgeTypes This class contains a list of <Graph.Adjacence> built-in types. Edge types implemented are 'none', 'line' and 'arrow'. You can add your custom edge types, customizing your visualization to the extreme. Example: (start code js) Sunburst.Plot.EdgeTypes.implement({ 'mySpecialType': { 'render': function(adj, canvas) { //print your custom edge to canvas }, //optional 'contains': function(adj, pos) { //return true if pos is inside the arc or false otherwise } } }); (end code) */ Sunburst.Plot.EdgeTypes = new Class({ 'none': $.empty, 'line': { 'render': function(adj, canvas) { var from = adj.nodeFrom.pos.getc(true), to = adj.nodeTo.pos.getc(true); this.edgeHelper.line.render(from, to, canvas); }, 'contains': function(adj, pos) { var from = adj.nodeFrom.pos.getc(true), to = adj.nodeTo.pos.getc(true); return this.edgeHelper.line.contains(from, to, pos, this.edge.epsilon); } }, 'arrow': { 'render': function(adj, canvas) { var from = adj.nodeFrom.pos.getc(true), to = adj.nodeTo.pos.getc(true), dim = adj.getData('dim'), direction = adj.data.$direction, inv = (direction && direction.length>1 && direction[0] != adj.nodeFrom.id); this.edgeHelper.arrow.render(from, to, dim, inv, canvas); }, 'contains': function(adj, pos) { var from = adj.nodeFrom.pos.getc(true), to = adj.nodeTo.pos.getc(true); return this.edgeHelper.arrow.contains(from, to, pos, this.edge.epsilon); } }, 'hyperline': { 'render': function(adj, canvas) { var from = adj.nodeFrom.pos.getc(), to = adj.nodeTo.pos.getc(), dim = Math.max(from.norm(), to.norm()); this.edgeHelper.hyperline.render(from.$scale(1/dim), to.$scale(1/dim), dim, canvas); }, 'contains': $.lambda(false) //TODO(nico): Implement this! } }); })($jit.Sunburst); /* * File: PieChart.js * */ $jit.Sunburst.Plot.NodeTypes.implement({ 'piechart-stacked' : { 'render' : function(node, canvas) { var pos = node.pos.getp(true), dimArray = node.getData('dimArray'), valueArray = node.getData('valueArray'), colorArray = node.getData('colorArray'), colorLength = colorArray.length, stringArray = node.getData('stringArray'), span = node.getData('span') / 2, theta = node.pos.theta, begin = theta - span, end = theta + span, polar = new Polar; var ctx = canvas.getCtx(), opt = {}, gradient = node.getData('gradient'), border = node.getData('border'), config = node.getData('config'), showLabels = config.showLabels, resizeLabels = config.resizeLabels, label = config.Label; var xpos = config.sliceOffset * Math.cos((begin + end) /2); var ypos = config.sliceOffset * Math.sin((begin + end) /2); if (colorArray && dimArray && stringArray) { for (var i=0, l=dimArray.length, acum=0, valAcum=0; i<l; i++) { var dimi = dimArray[i], colori = colorArray[i % colorLength]; if(dimi <= 0) continue; ctx.fillStyle = ctx.strokeStyle = colori; if(gradient && dimi) { var radialGradient = ctx.createRadialGradient(xpos, ypos, acum + config.sliceOffset, xpos, ypos, acum + dimi + config.sliceOffset); var colorRgb = $.hexToRgb(colori), ans = $.map(colorRgb, function(i) { return (i * 0.8) >> 0; }), endColor = $.rgbToHex(ans); radialGradient.addColorStop(0, colori); radialGradient.addColorStop(0.5, colori); radialGradient.addColorStop(1, endColor); ctx.fillStyle = radialGradient; } polar.rho = acum + config.sliceOffset; polar.theta = begin; var p1coord = polar.getc(true); polar.theta = end; var p2coord = polar.getc(true); polar.rho += dimi; var p3coord = polar.getc(true); polar.theta = begin; var p4coord = polar.getc(true); ctx.beginPath(); //fixing FF arc method + fill ctx.arc(xpos, ypos, acum + .01, begin, end, false); ctx.arc(xpos, ypos, acum + dimi + .01, end, begin, true); ctx.fill(); if(border && border.name == stringArray[i]) { opt.acum = acum; opt.dimValue = dimArray[i]; opt.begin = begin; opt.end = end; } acum += (dimi || 0); valAcum += (valueArray[i] || 0); } if(border) { ctx.save(); ctx.globalCompositeOperation = "source-over"; ctx.lineWidth = 2; ctx.strokeStyle = border.color; var s = begin < end? 1 : -1; ctx.beginPath(); //fixing FF arc method + fill ctx.arc(xpos, ypos, opt.acum + .01 + 1, opt.begin, opt.end, false); ctx.arc(xpos, ypos, opt.acum + opt.dimValue + .01 - 1, opt.end, opt.begin, true); ctx.closePath(); ctx.stroke(); ctx.restore(); } if(showLabels && label.type == 'Native') { ctx.save(); ctx.fillStyle = ctx.strokeStyle = label.color; var scale = resizeLabels? node.getData('normalizedDim') : 1, fontSize = (label.size * scale) >> 0; fontSize = fontSize < +resizeLabels? +resizeLabels : fontSize; ctx.font = label.style + ' ' + fontSize + 'px ' + label.family; ctx.textBaseline = 'middle'; ctx.textAlign = 'center'; polar.rho = acum + config.labelOffset + config.sliceOffset; polar.theta = node.pos.theta; var cart = polar.getc(true); ctx.fillText(node.name, cart.x, cart.y); ctx.restore(); } } }, 'contains': function(node, pos) { if (this.nodeTypes['none'].anglecontains.call(this, node, pos)) { var rho = Math.sqrt(pos.x * pos.x + pos.y * pos.y); var ld = this.config.levelDistance, d = node._depth; var config = node.getData('config'); if(rho <=ld * d + config.sliceOffset) { var dimArray = node.getData('dimArray'); for(var i=0,l=dimArray.length,acum=config.sliceOffset; i<l; i++) { var dimi = dimArray[i]; if(rho >= acum && rho <= acum + dimi) { return { name: node.getData('stringArray')[i], color: node.getData('colorArray')[i], value: node.getData('valueArray')[i], label: node.name }; } acum += dimi; } } return false; } return false; } }, 'piechart-basic' : { 'render' : function(node, canvas) { var pos = node.pos.getp(true), dimArray = node.getData('dimArray'), valueArray = node.getData('valueArray'), colorArray = node.getData('colorMono'), colorLength = colorArray.length, stringArray = node.getData('stringArray'), percentage = node.getData('percentage'), iteration = node.getData('iteration'), span = node.getData('span') / 2, theta = node.pos.theta, begin = theta - span, end = theta + span, polar = new Polar; var ctx = canvas.getCtx(), opt = {}, gradient = node.getData('gradient'), border = node.getData('border'), config = node.getData('config'), renderSubtitle = node.getData('renderSubtitle'), renderBackground = config.renderBackground, showLabels = config.showLabels, resizeLabels = config.resizeLabels, label = config.Label; var xpos = config.sliceOffset * Math.cos((begin + end) /2); var ypos = config.sliceOffset * Math.sin((begin + end) /2); //background rendering for IE if(iteration == 0 && typeof FlashCanvas != "undefined" && renderBackground) { backgroundColor = config.backgroundColor, size = canvas.getSize(); ctx.save(); ctx.fillStyle = backgroundColor; ctx.fillRect(-size.width/2,-size.height/2,size.width,size.height); //subtitle var margin = config.Margin, title = config.Title, subtitle = config.Subtitle; ctx.fillStyle = title.color; ctx.textAlign = 'left'; if(title.text != "") { ctx.font = label.style + ' bold ' +' ' + title.size + 'px ' + label.family; ctx.moveTo(0,0); if(label.type == 'Native') { ctx.fillText(title.text, -size.width/2 + margin.left, -size.height/2 + margin.top); } } if(subtitle.text != "") { ctx.font = label.style + ' ' + subtitle.size + 'px ' + label.family; if(label.type == 'Native') { ctx.fillText(subtitle.text, -size.width/2 + margin.left, size.height/2 - margin.bottom); } } ctx.restore(); } if (colorArray && dimArray && stringArray) { for (var i=0, l=dimArray.length, acum=0, valAcum=0; i<l; i++) { var dimi = dimArray[i], colori = colorArray[i % colorLength]; if(dimi <= 0) continue; ctx.fillStyle = ctx.strokeStyle = colori; polar.rho = acum + config.sliceOffset; polar.theta = begin; var p1coord = polar.getc(true); polar.theta = end; var p2coord = polar.getc(true); polar.rho += dimi; var p3coord = polar.getc(true); polar.theta = begin; var p4coord = polar.getc(true); if(typeof FlashCanvas == "undefined") { //drop shadow ctx.beginPath(); ctx.fillStyle = "rgba(0,0,0,.2)"; ctx.arc(xpos, ypos, acum + .01, begin, end, false); ctx.arc(xpos, ypos, acum + dimi+4 + .01, end, begin, true); ctx.fill(); if(gradient && dimi) { var radialGradient = ctx.createRadialGradient(xpos, ypos, acum + config.sliceOffset, xpos, ypos, acum + dimi + config.sliceOffset); var colorRgb = $.hexToRgb(colori), endColor = $.map(colorRgb, function(i) { return (i * 0.85) >> 0; }), endColor2 = $.map(colorRgb, function(i) { return (i * 0.7) >> 0; }); radialGradient.addColorStop(0, 'rgba('+colorRgb+',1)'); radialGradient.addColorStop(.7, 'rgba('+colorRgb+',1)'); radialGradient.addColorStop(.98, 'rgba('+endColor+',1)'); radialGradient.addColorStop(1, 'rgba('+endColor2+',1)'); ctx.fillStyle = radialGradient; } } //fixing FF arc method + fill ctx.beginPath(); ctx.arc(xpos, ypos, acum + .01, begin, end, false); ctx.arc(xpos, ypos, acum + dimi + .01, end, begin, true); ctx.fill(); if(border && border.name == stringArray[i]) { opt.acum = acum; opt.dimValue = dimArray[i]; opt.begin = begin; opt.end = end; opt.sliceValue = valueArray[i]; } acum += (dimi || 0); valAcum += (valueArray[i] || 0); } if(border) { ctx.save(); ctx.globalCompositeOperation = "source-over"; ctx.lineWidth = 2; ctx.strokeStyle = border.color; var s = begin < end? 1 : -1; ctx.beginPath(); //fixing FF arc method + fill ctx.arc(xpos, ypos, opt.acum + .01 + 1, opt.begin, opt.end, false); ctx.arc(xpos, ypos, opt.acum + opt.dimValue + .01 - 1, opt.end, opt.begin, true); ctx.closePath(); ctx.stroke(); ctx.restore(); } if(showLabels && label.type == 'Native') { ctx.save(); ctx.fillStyle = ctx.strokeStyle = label.color; var scale = resizeLabels? node.getData('normalizedDim') : 1, fontSize = (label.size * scale) >> 0; fontSize = fontSize < +resizeLabels? +resizeLabels : fontSize; ctx.font = label.style + ' ' + fontSize + 'px ' + label.family; ctx.textBaseline = 'middle'; ctx.textAlign = 'center'; pi = Math.PI; angle = theta * 360 / (2 * pi); polar.rho = acum + config.labelOffset + config.sliceOffset; polar.theta = node.pos.theta; var cart = polar.getc(true); if(((angle >= 225 && angle <= 315) || (angle <= 135 && angle >= 45)) && percentage <= 5) { } else { if(config.labelType == 'name') { ctx.fillText(node.name, cart.x, cart.y); } else { ctx.fillText(node.data.valuelabel, cart.x, cart.y); } } ctx.restore(); } } }, 'contains': function(node, pos) { if (this.nodeTypes['none'].anglecontains.call(this, node, pos)) { var rho = Math.sqrt(pos.x * pos.x + pos.y * pos.y); var ld = this.config.levelDistance, d = node._depth; var config = node.getData('config'); if(rho <=ld * d + config.sliceOffset) { var dimArray = node.getData('dimArray'); for(var i=0,l=dimArray.length,acum=config.sliceOffset; i<l; i++) { var dimi = dimArray[i]; if(rho >= acum && rho <= acum + dimi) { var url = Url.decode(node.getData('linkArray')[i]); return { name: node.getData('stringArray')[i], link: url, color: node.getData('colorArray')[i], value: node.getData('valueArray')[i], percentage: node.getData('percentage'), valuelabel: node.getData('valuelabelsArray')[i], label: node.name }; } acum += dimi; } } return false; } return false; } } }); /* Class: PieChart A visualization that displays stacked bar charts. Constructor Options: See <Options.PieChart>. */ $jit.PieChart = new Class({ sb: null, colors: ["#416D9C", "#70A35E", "#EBB056", "#C74243", "#83548B", "#909291", "#557EAA"], selected: {}, busy: false, initialize: function(opt) { this.controller = this.config = $.merge(Options("Canvas", "PieChart", "Label"), { Label: { type: 'Native' } }, opt); this.initializeViz(); }, initializeViz: function() { var config = this.config, that = this; var nodeType = config.type.split(":")[0]; var sb = new $jit.Sunburst({ injectInto: config.injectInto, useCanvas: config.useCanvas, withLabels: config.Label.type != 'Native', background: config.background, renderBackground: config.renderBackground, backgroundColor: config.backgroundColor, colorStop1: config.colorStop1, colorStop2: config.colorStop2, Label: { type: config.Label.type }, Node: { overridable: true, type: 'piechart-' + nodeType, width: 1, height: 1 }, Edge: { type: 'none' }, Tips: { enable: config.Tips.enable, type: 'Native', force: true, onShow: function(tip, node, contains) { var elem = contains; config.Tips.onShow(tip, elem, node); if(elem.link != 'undefined' && elem.link != '') { document.body.style.cursor = 'pointer'; } }, onHide: function() { document.body.style.cursor = 'default'; } }, Events: { enable: true, type: 'Native', onClick: function(node, eventInfo, evt) { if(!config.Events.enable) return; var elem = eventInfo.getContains(); config.Events.onClick(elem, eventInfo, evt); }, onMouseMove: function(node, eventInfo, evt) { if(!config.hoveredColor) return; if(node) { var elem = eventInfo.getContains(); that.select(node.id, elem.name, elem.index); } else { that.select(false, false, false); } } }, onCreateLabel: function(domElement, node) { var labelConf = config.Label; if(config.showLabels) { var style = domElement.style; style.fontSize = labelConf.size + 'px'; style.fontFamily = labelConf.family; style.color = labelConf.color; style.textAlign = 'center'; if(config.labelType == 'name') { domElement.innerHTML = node.name; } else { domElement.innerHTML = (node.data.valuelabel != undefined) ? node.data.valuelabel : ""; } domElement.style.width = '400px'; } }, onPlaceLabel: function(domElement, node) { if(!config.showLabels) return; var pos = node.pos.getp(true), dimArray = node.getData('dimArray'), span = node.getData('span') / 2, theta = node.pos.theta, begin = theta - span, end = theta + span, polar = new Polar; var showLabels = config.showLabels, resizeLabels = config.resizeLabels, label = config.Label; if (dimArray) { for (var i=0, l=dimArray.length, acum=0; i<l; i++) { acum += dimArray[i]; } var scale = resizeLabels? node.getData('normalizedDim') : 1, fontSize = (label.size * scale) >> 0; fontSize = fontSize < +resizeLabels? +resizeLabels : fontSize; domElement.style.fontSize = fontSize + 'px'; polar.rho = acum + config.labelOffset + config.sliceOffset; polar.theta = (begin + end) / 2; var pos = polar.getc(true); var radius = that.canvas.getSize(); var labelPos = { x: Math.round(pos.x + radius.width / 2), y: Math.round(pos.y + radius.height / 2) }; domElement.style.left = (labelPos.x - 200) + 'px'; domElement.style.top = labelPos.y + 'px'; } } }); var size = sb.canvas.getSize(), min = Math.min; sb.config.levelDistance = min(size.width, size.height)/2 - config.offset - config.sliceOffset; this.sb = sb; this.canvas = this.sb.canvas; this.canvas.getCtx().globalCompositeOperation = 'lighter'; }, renderBackground: function() { var canvas = this.canvas, config = this.config, backgroundColor = config.backgroundColor, size = canvas.getSize(), ctx = canvas.getCtx(); ctx.globalCompositeOperation = "destination-over"; ctx.fillStyle = backgroundColor; ctx.fillRect(-size.width/2,-size.height/2,size.width,size.height); }, renderTitle: function() { var canvas = this.canvas, size = canvas.getSize(), config = this.config, margin = config.Margin, radius = this.sb.config.levelDistance, title = config.Title, label = config.Label, subtitle = config.Subtitle; ctx = canvas.getCtx(); ctx.fillStyle = title.color; ctx.textAlign = 'left'; ctx.font = label.style + ' bold ' +' ' + title.size + 'px ' + label.family; ctx.moveTo(0,0); if(label.type == 'Native') { ctx.fillText(title.text, -size.width/2 + margin.left, -size.height/2 + margin.top); } }, renderSubtitle: function() { var canvas = this.canvas, size = canvas.getSize(), config = this.config, margin = config.Margin, radius = this.sb.config.levelDistance, title = config.Title, label = config.Label, subtitle = config.Subtitle; ctx = canvas.getCtx(); ctx.fillStyle = title.color; ctx.textAlign = 'left'; ctx.font = label.style + ' ' + subtitle.size + 'px ' + label.family; ctx.moveTo(0,0); if(label.type == 'Native') { ctx.fillText(subtitle.text, -size.width/2 + margin.left, size.height/2 - margin.bottom); } }, clear: function() { var canvas = this.canvas; var ctx = canvas.getCtx(), size = canvas.getSize(); ctx.fillStyle = "rgba(255,255,255,0)"; ctx.fillRect(-size.width/2,-size.height/2,size.width,size.height); ctx.clearRect(-size.width/2,-size.height/2,size.width,size.height); }, resizeGraph: function(json,width) { var canvas = this.canvas, size = canvas.getSize(), config = this.config, orgHeight = size.height; canvas.resize(width,orgHeight); if(typeof FlashCanvas == "undefined") { canvas.clear(); } else { this.clear();// hack for flashcanvas bug not properly clearing rectangle } this.loadJSON(json); }, /* Method: loadJSON Loads JSON data into the visualization. Parameters: json - The JSON data format. This format is described in <http://blog.thejit.org/2010/04/24/new-javascript-infovis-toolkit-visualizations/#json-data-format>. Example: (start code js) var pieChart = new $jit.PieChart(options); pieChart.loadJSON(json); (end code) */ loadJSON: function(json) { var prefix = $.time(), ch = [], sb = this.sb, name = $.splat(json.label), nameLength = name.length, color = $.splat(json.color || this.colors), colorLength = color.length, config = this.config, renderBackground = config.renderBackground, title = config.Title, subtitle = config.Subtitle, gradient = !!config.type.split(":")[1], animate = config.animate, mono = nameLength == 1; totalValue = 0; for(var i=0, values=json.values, l=values.length; i<l; i++) { var val = values[i]; var valArray = $.splat(val.values); totalValue += parseFloat(valArray.sum()); } for(var i=0, values=json.values, l=values.length; i<l; i++) { var val = values[i]; var valArray = $.splat(val.values); var percentage = (valArray.sum()/totalValue) * 100; var linkArray = $.splat(val.links); var valuelabelsArray = $.splat(val.valuelabels); ch.push({ 'id': prefix + val.label, 'name': val.label, 'data': { 'value': valArray, 'valuelabel': valuelabelsArray, '$linkArray': linkArray, '$valuelabelsArray': valuelabelsArray, '$valueArray': valArray, '$colorArray': mono? $.splat(color[i % colorLength]) : color, '$colorMono': $.splat(color[i % colorLength]), '$stringArray': name, '$gradient': gradient, '$config': config, '$iteration': i, '$percentage': percentage.toFixed(1), '$angularWidth': $.reduce(valArray, function(x,y){return x+y;}) }, 'children': [] }); } var root = { 'id': prefix + '$root', 'name': '', 'data': { '$type': 'none', '$width': 1, '$height': 1 }, 'children': ch }; sb.loadJSON(root); this.normalizeDims(); sb.refresh(); if(title.text != "") { this.renderTitle(); } if(subtitle.text != "") { this.renderSubtitle(); } if(renderBackground && typeof FlashCanvas == "undefined") { this.renderBackground(); } if(animate) { sb.fx.animate({ modes: ['node-property:dimArray'], duration:1500 }); } }, /* Method: updateJSON Use this method when updating values for the current JSON data. If the items specified by the JSON data already exist in the graph then their values will be updated. Parameters: json - (object) JSON data to be updated. The JSON format corresponds to the one described in <PieChart.loadJSON>. onComplete - (object) A callback object to be called when the animation transition when updating the data end. Example: (start code js) pieChart.updateJSON(json, { onComplete: function() { alert('update complete!'); } }); (end code) */ updateJSON: function(json, onComplete) { if(this.busy) return; this.busy = true; var sb = this.sb; var graph = sb.graph; var values = json.values; var animate = this.config.animate; var that = this; $.each(values, function(v) { var n = graph.getByName(v.label), vals = $.splat(v.values); if(n) { n.setData('valueArray', vals); n.setData('angularWidth', $.reduce(vals, function(x,y){return x+y;})); if(json.label) { n.setData('stringArray', $.splat(json.label)); } } }); this.normalizeDims(); if(animate) { sb.compute('end'); sb.fx.animate({ modes: ['node-property:dimArray:span', 'linear'], duration:1500, onComplete: function() { that.busy = false; onComplete && onComplete.onComplete(); } }); } else { sb.refresh(); } }, //adds the little brown bar when hovering the node select: function(id, name) { if(!this.config.hoveredColor) return; var s = this.selected; if(s.id != id || s.name != name) { s.id = id; s.name = name; s.color = this.config.hoveredColor; this.sb.graph.eachNode(function(n) { if(id == n.id) { n.setData('border', s); } else { n.setData('border', false); } }); this.sb.plot(); } }, /* Method: getLegend Returns an object containing as keys the legend names and as values hex strings with color values. Example: (start code js) var legend = pieChart.getLegend(); (end code) */ getLegend: function() { var legend = new Array(); var name = new Array(); var color = new Array(); var n; this.sb.graph.getNode(this.sb.root).eachAdjacency(function(adj) { n = adj.nodeTo; }); var colors = n.getData('colorArray'), len = colors.length; $.each(n.getData('stringArray'), function(s, i) { color[i] = colors[i % len]; name[i] = s; }); legend['name'] = name; legend['color'] = color; return legend; }, /* Method: getMaxValue Returns the maximum accumulated value for the stacks. This method is used for normalizing the graph heights according to the canvas height. Example: (start code js) var ans = pieChart.getMaxValue(); (end code) In some cases it could be useful to override this method to normalize heights for a group of PieCharts, like when doing small multiples. Example: (start code js) //will return 100 for all PieChart instances, //displaying all of them with the same scale $jit.PieChart.implement({ 'getMaxValue': function() { return 100; } }); (end code) */ getMaxValue: function() { var maxValue = 0; this.sb.graph.eachNode(function(n) { var valArray = n.getData('valueArray'), acum = 0; $.each(valArray, function(v) { acum += +v; }); maxValue = maxValue>acum? maxValue:acum; }); return maxValue; }, normalizeDims: function() { //number of elements var root = this.sb.graph.getNode(this.sb.root), l=0; root.eachAdjacency(function() { l++; }); var maxValue = this.getMaxValue() || 1, config = this.config, animate = config.animate, rho = this.sb.config.levelDistance; this.sb.graph.eachNode(function(n) { var acum = 0, animateValue = []; $.each(n.getData('valueArray'), function(v) { acum += +v; animateValue.push(1); }); var stat = (animateValue.length == 1) && !config.updateHeights; if(animate) { n.setData('dimArray', $.map(n.getData('valueArray'), function(n) { return stat? rho: (n * rho / maxValue); }), 'end'); var dimArray = n.getData('dimArray'); if(!dimArray) { n.setData('dimArray', animateValue); } } else { n.setData('dimArray', $.map(n.getData('valueArray'), function(n) { return stat? rho : (n * rho / maxValue); })); } n.setData('normalizedDim', acum / maxValue); }); } }); //Gauge Chart Options.GaugeChart = { $extend: true, animate: true, offset: 25, // page offset sliceOffset:0, labelOffset: 3, // label offset type: 'stacked', // gradient labelType: 'name', hoveredColor: '#9fd4ff', Events: { enable: false, onClick: $.empty }, Tips: { enable: false, onShow: $.empty, onHide: $.empty }, showLabels: true, resizeLabels: false, //only valid for mono-valued datasets updateHeights: false }; $jit.Sunburst.Plot.NodeTypes.implement({ 'gaugechart-basic' : { 'render' : function(node, canvas) { var pos = node.pos.getp(true), dimArray = node.getData('dimArray'), valueArray = node.getData('valueArray'), valuelabelsArray = node.getData('valuelabelsArray'), gaugeTarget = node.getData('gaugeTarget'), nodeIteration = node.getData('nodeIteration'), nodeLength = node.getData('nodeLength'), colorArray = node.getData('colorMono'), colorLength = colorArray.length, stringArray = node.getData('stringArray'), span = node.getData('span') / 2, theta = node.pos.theta, begin = ((theta - span)/2)+Math.PI, end = ((theta + span)/2)+Math.PI, polar = new Polar; var ctx = canvas.getCtx(), opt = {}, gradient = node.getData('gradient'), border = node.getData('border'), config = node.getData('config'), showLabels = config.showLabels, resizeLabels = config.resizeLabels, label = config.Label; var xpos = Math.cos((begin + end) /2); var ypos = Math.sin((begin + end) /2); if (colorArray && dimArray && stringArray && gaugeTarget != 0) { for (var i=0, l=dimArray.length, acum=0, valAcum=0; i<l; i++) { var dimi = dimArray[i], colori = colorArray[i % colorLength]; if(dimi <= 0) continue; ctx.fillStyle = ctx.strokeStyle = colori; if(gradient && dimi) { var radialGradient = ctx.createRadialGradient(xpos, (ypos + dimi/2), acum, xpos, (ypos + dimi/2), acum + dimi); var colorRgb = $.hexToRgb(colori), ans = $.map(colorRgb, function(i) { return (i * .8) >> 0; }), endColor = $.rgbToHex(ans); radialGradient.addColorStop(0, 'rgba('+colorRgb+',1)'); radialGradient.addColorStop(0.1, 'rgba('+colorRgb+',1)'); radialGradient.addColorStop(0.85, 'rgba('+colorRgb+',1)'); radialGradient.addColorStop(1, 'rgba('+ans+',1)'); ctx.fillStyle = radialGradient; } polar.rho = acum; polar.theta = begin; var p1coord = polar.getc(true); polar.theta = end; var p2coord = polar.getc(true); polar.rho += dimi; var p3coord = polar.getc(true); polar.theta = begin; var p4coord = polar.getc(true); ctx.beginPath(); //fixing FF arc method + fill ctx.arc(xpos, (ypos + dimi/2), (acum + dimi + .01) * .8, begin, end, false); ctx.arc(xpos, (ypos + dimi/2), (acum + dimi + .01), end, begin, true); ctx.fill(); acum += (dimi || 0); valAcum += (valueArray[i] || 0); } if(showLabels && label.type == 'Native') { ctx.save(); ctx.fillStyle = ctx.strokeStyle = label.color; ctx.font = label.style + ' ' + label.size + 'px ' + label.family; ctx.textBaseline = 'bottom'; ctx.textAlign = 'center'; polar.rho = acum * .65; polar.theta = begin; var cart = polar.getc(true); //changes y pos of first label if(nodeIteration == 1) { textY = cart.y - (label.size/2) + acum /2; } else { textY = cart.y + acum/2; } if(config.labelType == 'name') { ctx.fillText(node.name, cart.x, textY); } else { ctx.fillText(valuelabelsArray[0], cart.x, textY); } //adds final label if(nodeIteration == nodeLength) { polar.theta = end; var cart = polar.getc(true); if(config.labelType == 'name') { ctx.fillText(node.name, cart.x, cart.x, cart.y - (label.size/2) + acum/2); } else { ctx.fillText(valuelabelsArray[1], cart.x, cart.y - (label.size/2) + acum/2); } } ctx.restore(); } } }, 'contains': function(node, pos) { if (this.nodeTypes['none'].anglecontainsgauge.call(this, node, pos)) { var config = node.getData('config'); var ld = this.config.levelDistance , d = node._depth; var yOffset = pos.y - (ld/2); var xOffset = pos.x; var rho = Math.sqrt(xOffset * xOffset + yOffset * yOffset); if(rho <=parseInt(ld * d)) { var dimArray = node.getData('dimArray'); for(var i=0,l=dimArray.length,acum=config.sliceOffset; i<l; i++) { var dimi = dimArray[i]; if(rho >= ld * .8 && rho <= acum + dimi) { var url = Url.decode(node.getData('linkArray')[i]); return { name: node.getData('stringArray')[i], link: url, color: node.getData('colorArray')[i], value: node.getData('valueArray')[i], valuelabel: node.getData('valuelabelsArray')[0] + " - " + node.getData('valuelabelsArray')[1], label: node.name }; } acum += dimi; } } return false; } return false; } } }); /* Class: GaugeChart A visualization that displays gauge charts Constructor Options: See <Options.Gauge>. */ $jit.GaugeChart = new Class({ sb: null, colors: ["#416D9C", "#70A35E", "#EBB056", "#C74243", "#83548B", "#909291", "#557EAA"], selected: {}, busy: false, initialize: function(opt) { this.controller = this.config = $.merge(Options("Canvas", "GaugeChart", "Label"), { Label: { type: 'Native' } }, opt); this.initializeViz(); }, initializeViz: function() { var config = this.config, that = this; var nodeType = config.type.split(":")[0]; var sb = new $jit.Sunburst({ injectInto: config.injectInto, useCanvas: config.useCanvas, withLabels: config.Label.type != 'Native', background: config.background, renderBackground: config.renderBackground, backgroundColor: config.backgroundColor, colorStop1: config.colorStop1, colorStop2: config.colorStop2, Label: { type: config.Label.type }, Node: { overridable: true, type: 'gaugechart-' + nodeType, width: 1, height: 1 }, Edge: { type: 'none' }, Tips: { enable: config.Tips.enable, type: 'Native', force: true, onShow: function(tip, node, contains) { var elem = contains; config.Tips.onShow(tip, elem, node); if(elem.link != 'undefined' && elem.link != '') { document.body.style.cursor = 'pointer'; } }, onHide: function() { document.body.style.cursor = 'default'; } }, Events: { enable: true, type: 'Native', onClick: function(node, eventInfo, evt) { if(!config.Events.enable) return; var elem = eventInfo.getContains(); config.Events.onClick(elem, eventInfo, evt); } }, onCreateLabel: function(domElement, node) { var labelConf = config.Label; if(config.showLabels) { var style = domElement.style; style.fontSize = labelConf.size + 'px'; style.fontFamily = labelConf.family; style.color = labelConf.color; style.textAlign = 'center'; valuelabelsArray = node.getData('valuelabelsArray'), nodeIteration = node.getData('nodeIteration'), nodeLength = node.getData('nodeLength'), canvas = sb.canvas, prefix = $.time(); if(config.labelType == 'name') { domElement.innerHTML = node.name; } else { domElement.innerHTML = (valuelabelsArray[0] != undefined) ? valuelabelsArray[0] : ""; } domElement.style.width = '400px'; //adds final label if(nodeIteration == nodeLength && nodeLength != 0) { idLabel = canvas.id + "-label"; container = document.getElementById(idLabel); finalLabel = document.createElement('div'); finalLabelStyle = finalLabel.style; finalLabel.id = prefix + "finalLabel"; finalLabelStyle.position = "absolute"; finalLabelStyle.width = "400px"; finalLabelStyle.left = "0px"; container.appendChild(finalLabel); if(config.labelType == 'name') { finalLabel.innerHTML = node.name; } else { finalLabel.innerHTML = (valuelabelsArray[1] != undefined) ? valuelabelsArray[1] : ""; } } } }, onPlaceLabel: function(domElement, node) { if(!config.showLabels) return; var pos = node.pos.getp(true), dimArray = node.getData('dimArray'), nodeIteration = node.getData('nodeIteration'), nodeLength = node.getData('nodeLength'), span = node.getData('span') / 2, theta = node.pos.theta, begin = ((theta - span)/2)+Math.PI, end = ((theta + span)/2)+Math.PI, polar = new Polar; var showLabels = config.showLabels, resizeLabels = config.resizeLabels, label = config.Label, radiusOffset = sb.config.levelDistance; if (dimArray) { for (var i=0, l=dimArray.length, acum=0; i<l; i++) { acum += dimArray[i]; } var scale = resizeLabels? node.getData('normalizedDim') : 1, fontSize = (label.size * scale) >> 0; fontSize = fontSize < +resizeLabels? +resizeLabels : fontSize; domElement.style.fontSize = fontSize + 'px'; polar.rho = acum * .65; polar.theta = begin; var pos = polar.getc(true); var radius = that.canvas.getSize(); var labelPos = { x: Math.round(pos.x + radius.width / 2), y: Math.round(pos.y + (radius.height / 2) + radiusOffset/2) }; domElement.style.left = (labelPos.x - 200) + 'px'; domElement.style.top = labelPos.y + 'px'; //reposition first label if(nodeIteration == 1) { domElement.style.top = labelPos.y - label.size + 'px'; } //position final label if(nodeIteration == nodeLength && nodeLength != 0) { polar.theta = end; var final = polar.getc(true); var finalPos = { x: Math.round(final.x + radius.width / 2), y: Math.round(final.y + (radius.height / 2) + radiusOffset/2) }; finalLabel.style.left = (finalPos.x - 200) + "px"; finalLabel.style.top = finalPos.y - label.size + "px"; } } } }); this.sb = sb; this.canvas = this.sb.canvas; var size = sb.canvas.getSize(), min = Math.min; sb.config.levelDistance = min(size.width, size.height)/2 - config.offset - config.sliceOffset; }, renderBackground: function() { var canvas = this.sb.canvas, config = this.config, style = config.gaugeStyle, ctx = canvas.getCtx(), size = canvas.getSize(), radius = this.sb.config.levelDistance, startAngle = (Math.PI/180)*1, endAngle = (Math.PI/180)*179; //background border ctx.fillStyle = style.borderColor; ctx.beginPath(); ctx.arc(0,radius/2,radius+4,startAngle,endAngle, true); ctx.fill(); var radialGradient = ctx.createRadialGradient(0,radius/2,0,0,radius/2,radius); radialGradient.addColorStop(0, '#ffffff'); radialGradient.addColorStop(0.3, style.backgroundColor); radialGradient.addColorStop(0.6, style.backgroundColor); radialGradient.addColorStop(1, '#FFFFFF'); ctx.fillStyle = radialGradient; //background startAngle = (Math.PI/180)*0; endAngle = (Math.PI/180)*180; ctx.beginPath(); ctx.arc(0,radius/2,radius,startAngle,endAngle, true); ctx.fill(); }, renderNeedle: function(gaugePosition,target) { var canvas = this.sb.canvas, config = this.config, style = config.gaugeStyle, ctx = canvas.getCtx(), size = canvas.getSize(), radius = this.sb.config.levelDistance; gaugeCenter = (radius/2); startAngle = 0; endAngle = (Math.PI/180)*180; // needle ctx.fillStyle = style.needleColor; var segments = 180/target; needleAngle = gaugePosition * segments; ctx.translate(0, gaugeCenter); ctx.save(); ctx.rotate(needleAngle * Math.PI / 180); ctx.beginPath(); ctx.moveTo(0,0); ctx.lineTo(0,-4); ctx.lineTo(-radius*.9,-1); ctx.lineTo(-radius*.9,1); ctx.lineTo(0,4); ctx.lineTo(0,0); ctx.closePath(); ctx.fill(); ctx.restore(); // stroke needle ctx.lineWidth = 1; ctx.strokeStyle = '#aa0000'; ctx.save(); ctx.rotate(needleAngle * Math.PI / 180); ctx.beginPath(); ctx.moveTo(0,0); ctx.lineTo(0,-4); ctx.lineTo(-radius*.8,-1); ctx.lineTo(-radius*.8,1); ctx.lineTo(0,4); ctx.lineTo(0,0); ctx.closePath(); ctx.stroke(); ctx.restore(); //needle cap ctx.fillStyle = "#000000"; ctx.lineWidth = style.borderSize; ctx.strokeStyle = style.borderColor; var radialGradient = ctx.createRadialGradient(0,style.borderSize,0,0,style.borderSize,radius*.2); radialGradient.addColorStop(0, '#666666'); radialGradient.addColorStop(0.8, '#444444'); radialGradient.addColorStop(1, 'rgba(0,0,0,0)'); ctx.fillStyle = radialGradient; ctx.translate(0,5); ctx.save(); ctx.beginPath(); ctx.arc(0,0,radius*.2,startAngle,endAngle, true); ctx.fill(); ctx.restore(); }, renderTicks: function(values) { var canvas = this.sb.canvas, config = this.config, style = config.gaugeStyle, ctx = canvas.getCtx(), size = canvas.getSize(), radius = this.sb.config.levelDistance, gaugeCenter = (radius/2); ctx.strokeStyle = style.borderColor; ctx.lineWidth = 5; ctx.lineCap = "round"; for(var i=0, total = 0, l=values.length; i<l; i++) { var val = values[i]; if(val.label != 'GaugePosition') { total += (parseInt(val.values) || 0); } } for(var i=0, acum = 0, l=values.length; i<l-1; i++) { var val = values[i]; if(val.label != 'GaugePosition') { acum += (parseInt(val.values) || 0); var segments = 180/total; angle = acum * segments; //alert(acum); ctx.save(); ctx.translate(0, gaugeCenter); ctx.beginPath(); ctx.rotate(angle * (Math.PI/180)); ctx.moveTo(-radius,0); ctx.lineTo(-radius*.75,0); ctx.stroke(); ctx.restore(); } } }, renderPositionLabel: function(position) { var canvas = this.sb.canvas, config = this.config, label = config.Label, style = config.gaugeStyle, ctx = canvas.getCtx(), size = canvas.getSize(), radius = this.sb.config.levelDistance, gaugeCenter = (radius/2); ctx.textBaseline = 'middle'; ctx.textAlign = 'center'; ctx.font = style.positionFontSize + 'px ' + label.family; ctx.fillStyle = "#ffffff"; ctx.lineWidth = 2; height = style.positionFontSize + 10, cornerRadius = 8, idLabel = canvas.id + "-label"; container = document.getElementById(idLabel); if(label.type == 'Native') { var m = ctx.measureText(position), width = m.width + 40; } else { var width = 70; } $.roundedRect(ctx,-width/2,0,width,height,cornerRadius,"fill"); $.roundedRect(ctx,-width/2,0,width,height,cornerRadius,"stroke"); if(label.type == 'Native') { ctx.fillStyle = label.color; ctx.fillText(position, 0, (height/2) + style.positionOffset); } else { var labelDiv = document.createElement('div'); labelDivStyle = labelDiv.style; labelDivStyle.color = label.color; labelDivStyle.fontSize = style.positionFontSize + "px"; labelDivStyle.position = "absolute"; labelDivStyle.width = width + "px"; labelDivStyle.left = (size.width/2) - (width/2) + "px"; labelDivStyle.top = (size.height/2) + style.positionOffset + "px"; labelDiv.innerHTML = position; container.appendChild(labelDiv); } }, renderSubtitle: function() { var canvas = this.canvas, size = canvas.getSize(), config = this.config, margin = config.Margin, radius = this.sb.config.levelDistance, title = config.Title, label = config.Label, subtitle = config.Subtitle; ctx = canvas.getCtx(); ctx.fillStyle = title.color; ctx.textAlign = 'left'; ctx.font = label.style + ' ' + subtitle.size + 'px ' + label.family; ctx.moveTo(0,0); if(label.type == 'Native') { ctx.fillText(subtitle.text, -radius - 4, subtitle.size + subtitle.offset + (radius/2)); } }, renderChartBackground: function() { var canvas = this.canvas, config = this.config, backgroundColor = config.backgroundColor, size = canvas.getSize(), ctx = canvas.getCtx(); //ctx.globalCompositeOperation = "destination-over"; ctx.fillStyle = backgroundColor; ctx.fillRect(-size.width/2,-size.height/2,size.width,size.height); }, clear: function() { var canvas = this.canvas; var ctx = canvas.getCtx(), size = canvas.getSize(); ctx.fillStyle = "rgba(255,255,255,0)"; ctx.fillRect(-size.width/2,-size.height/2,size.width,size.height); ctx.clearRect(-size.width/2,-size.height/2,size.width,size.height); }, resizeGraph: function(json,width) { var canvas = this.canvas, size = canvas.getSize(), orgHeight = size.height; canvas.resize(width,orgHeight); if(typeof FlashCanvas == "undefined") { canvas.clear(); } else { this.clear();// hack for flashcanvas bug not properly clearing rectangle } this.loadJSON(json); }, loadJSON: function(json) { var prefix = $.time(), ch = [], sb = this.sb, name = $.splat(json.label), nameLength = name.length, color = $.splat(json.color || this.colors), colorLength = color.length, config = this.config, renderBackground = config.renderBackground, gradient = !!config.type.split(":")[1], animate = config.animate, mono = nameLength == 1; var props = $.splat(json.properties)[0]; for(var i=0, values=json.values, l=values.length; i<l; i++) { var val = values[i]; if(val.label != 'GaugePosition') { var valArray = $.splat(val.values); var linkArray = (val.links == "undefined" || val.links == undefined) ? new Array() : $.splat(val.links); var valuelabelsArray = $.splat(val.valuelabels); ch.push({ 'id': prefix + val.label, 'name': val.label, 'data': { 'value': valArray, 'valuelabel': valuelabelsArray, '$linkArray': linkArray, '$valuelabelsArray': valuelabelsArray, '$valueArray': valArray, '$nodeIteration': i, '$nodeLength': l-1, '$colorArray': mono? $.splat(color[i % colorLength]) : color, '$colorMono': $.splat(color[i % colorLength]), '$stringArray': name, '$gradient': gradient, '$config': config, '$gaugeTarget': props['gaugeTarget'], '$angularWidth': $.reduce(valArray, function(x,y){return x+y;}) }, 'children': [] }); } else { var gaugePosition = val.gvalue; var gaugePositionLabel = val.gvaluelabel; } } var root = { 'id': prefix + '$root', 'name': '', 'data': { '$type': 'none', '$width': 1, '$height': 1 }, 'children': ch }; sb.loadJSON(root); if(renderBackground) { this.renderChartBackground(); } this.renderBackground(); this.renderSubtitle(); this.normalizeDims(); sb.refresh(); if(animate) { sb.fx.animate({ modes: ['node-property:dimArray'], duration:1500 }); } this.renderPositionLabel(gaugePositionLabel); if (props['gaugeTarget'] != 0) { this.renderTicks(json.values); this.renderNeedle(gaugePosition,props['gaugeTarget']); } }, updateJSON: function(json, onComplete) { if(this.busy) return; this.busy = true; var sb = this.sb; var graph = sb.graph; var values = json.values; var animate = this.config.animate; var that = this; $.each(values, function(v) { var n = graph.getByName(v.label), vals = $.splat(v.values); if(n) { n.setData('valueArray', vals); n.setData('angularWidth', $.reduce(vals, function(x,y){return x+y;})); if(json.label) { n.setData('stringArray', $.splat(json.label)); } } }); this.normalizeDims(); if(animate) { sb.compute('end'); sb.fx.animate({ modes: ['node-property:dimArray:span', 'linear'], duration:1500, onComplete: function() { that.busy = false; onComplete && onComplete.onComplete(); } }); } else { sb.refresh(); } }, //adds the little brown bar when hovering the node select: function(id, name) { if(!this.config.hoveredColor) return; var s = this.selected; if(s.id != id || s.name != name) { s.id = id; s.name = name; s.color = this.config.hoveredColor; this.sb.graph.eachNode(function(n) { if(id == n.id) { n.setData('border', s); } else { n.setData('border', false); } }); this.sb.plot(); } }, /* Method: getLegend Returns an object containing as keys the legend names and as values hex strings with color values. Example: (start code js) var legend = pieChart.getLegend(); (end code) */ getLegend: function() { var legend = new Array(); var name = new Array(); var color = new Array(); var n; this.sb.graph.getNode(this.sb.root).eachAdjacency(function(adj) { n = adj.nodeTo; }); var colors = n.getData('colorArray'), len = colors.length; $.each(n.getData('stringArray'), function(s, i) { color[i] = colors[i % len]; name[i] = s; }); legend['name'] = name; legend['color'] = color; return legend; }, /* Method: getMaxValue Returns the maximum accumulated value for the stacks. This method is used for normalizing the graph heights according to the canvas height. Example: (start code js) var ans = pieChart.getMaxValue(); (end code) In some cases it could be useful to override this method to normalize heights for a group of PieCharts, like when doing small multiples. Example: (start code js) //will return 100 for all PieChart instances, //displaying all of them with the same scale $jit.PieChart.implement({ 'getMaxValue': function() { return 100; } }); (end code) */ getMaxValue: function() { var maxValue = 0; this.sb.graph.eachNode(function(n) { var valArray = n.getData('valueArray'), acum = 0; $.each(valArray, function(v) { acum += +v; }); maxValue = maxValue>acum? maxValue:acum; }); return maxValue; }, normalizeDims: function() { //number of elements var root = this.sb.graph.getNode(this.sb.root), l=0; root.eachAdjacency(function() { l++; }); var maxValue = this.getMaxValue() || 1, config = this.config, animate = config.animate, rho = this.sb.config.levelDistance; this.sb.graph.eachNode(function(n) { var acum = 0, animateValue = []; $.each(n.getData('valueArray'), function(v) { acum += +v; animateValue.push(1); }); var stat = (animateValue.length == 1) && !config.updateHeights; if(animate) { n.setData('dimArray', $.map(n.getData('valueArray'), function(n) { return stat? rho: (n * rho / maxValue); }), 'end'); var dimArray = n.getData('dimArray'); if(!dimArray) { n.setData('dimArray', animateValue); } } else { n.setData('dimArray', $.map(n.getData('valueArray'), function(n) { return stat? rho : (n * rho / maxValue); })); } n.setData('normalizedDim', acum / maxValue); }); } }); /* * Class: Layouts.TM * * Implements TreeMaps layouts (SliceAndDice, Squarified, Strip). * * Implemented By: * * <TM> * */ Layouts.TM = {}; Layouts.TM.SliceAndDice = new Class({ compute: function(prop) { var root = this.graph.getNode(this.clickedNode && this.clickedNode.id || this.root); this.controller.onBeforeCompute(root); var size = this.canvas.getSize(), config = this.config, width = size.width, height = size.height; this.graph.computeLevels(this.root, 0, "ignore"); //set root position and dimensions root.getPos(prop).setc(-width/2, -height/2); root.setData('width', width, prop); root.setData('height', height + config.titleHeight, prop); this.computePositions(root, root, this.layout.orientation, prop); this.controller.onAfterCompute(root); }, computePositions: function(par, ch, orn, prop) { //compute children areas var totalArea = 0; par.eachSubnode(function(n) { totalArea += n.getData('area', prop); }); var config = this.config, offst = config.offset, width = par.getData('width', prop), height = par.getData('height', prop) - config.titleHeight, fact = par == ch? 1: (ch.getData('area', prop) / totalArea); var otherSize, size, dim, pos, pos2, posth, pos2th; var horizontal = (orn == "h"); if(horizontal) { orn = 'v'; otherSize = height; size = width * fact; dim = 'height'; pos = 'y'; pos2 = 'x'; posth = config.titleHeight; pos2th = 0; } else { orn = 'h'; otherSize = height * fact; size = width; dim = 'width'; pos = 'x'; pos2 = 'y'; posth = 0; pos2th = config.titleHeight; } var cpos = ch.getPos(prop); ch.setData('width', size, prop); ch.setData('height', otherSize, prop); var offsetSize = 0, tm = this; ch.eachSubnode(function(n) { var p = n.getPos(prop); p[pos] = offsetSize + cpos[pos] + posth; p[pos2] = cpos[pos2] + pos2th; tm.computePositions(ch, n, orn, prop); offsetSize += n.getData(dim, prop); }); } }); Layouts.TM.Area = { /* Method: compute Called by loadJSON to calculate recursively all node positions and lay out the tree. Parameters: json - A JSON tree. See also <Loader.loadJSON>. coord - A coordinates object specifying width, height, left and top style properties. */ compute: function(prop) { prop = prop || "current"; var root = this.graph.getNode(this.clickedNode && this.clickedNode.id || this.root); this.controller.onBeforeCompute(root); var config = this.config, size = this.canvas.getSize(), width = size.width, height = size.height, offst = config.offset, offwdth = width - offst, offhght = height - offst; this.graph.computeLevels(this.root, 0, "ignore"); //set root position and dimensions root.getPos(prop).setc(-width/2, -height/2); root.setData('width', width, prop); root.setData('height', height, prop); //create a coordinates object var coord = { 'top': -height/2 + config.titleHeight, 'left': -width/2, 'width': offwdth, 'height': offhght - config.titleHeight }; this.computePositions(root, coord, prop); this.controller.onAfterCompute(root); }, /* Method: computeDim Computes dimensions and positions of a group of nodes according to a custom layout row condition. Parameters: tail - An array of nodes. initElem - An array of nodes (containing the initial node to be laid). w - A fixed dimension where nodes will be layed out. coord - A coordinates object specifying width, height, left and top style properties. comp - A custom comparison function */ computeDim: function(tail, initElem, w, coord, comp, prop) { if(tail.length + initElem.length == 1) { var l = (tail.length == 1)? tail : initElem; this.layoutLast(l, w, coord, prop); return; } if(tail.length >= 2 && initElem.length == 0) { initElem = [tail.shift()]; } if(tail.length == 0) { if(initElem.length > 0) this.layoutRow(initElem, w, coord, prop); return; } var c = tail[0]; if(comp(initElem, w) >= comp([c].concat(initElem), w)) { this.computeDim(tail.slice(1), initElem.concat([c]), w, coord, comp, prop); } else { var newCoords = this.layoutRow(initElem, w, coord, prop); this.computeDim(tail, [], newCoords.dim, newCoords, comp, prop); } }, /* Method: worstAspectRatio Calculates the worst aspect ratio of a group of rectangles. See also: <http://en.wikipedia.org/wiki/Aspect_ratio> Parameters: ch - An array of nodes. w - The fixed dimension where rectangles are being laid out. Returns: The worst aspect ratio. */ worstAspectRatio: function(ch, w) { if(!ch || ch.length == 0) return Number.MAX_VALUE; var areaSum = 0, maxArea = 0, minArea = Number.MAX_VALUE; for(var i=0, l=ch.length; i<l; i++) { var area = ch[i]._area; areaSum += area; minArea = minArea < area? minArea : area; maxArea = maxArea > area? maxArea : area; } var sqw = w * w, sqAreaSum = areaSum * areaSum; return Math.max(sqw * maxArea / sqAreaSum, sqAreaSum / (sqw * minArea)); }, /* Method: avgAspectRatio Calculates the average aspect ratio of a group of rectangles. See also: <http://en.wikipedia.org/wiki/Aspect_ratio> Parameters: ch - An array of nodes. w - The fixed dimension where rectangles are being laid out. Returns: The average aspect ratio. */ avgAspectRatio: function(ch, w) { if(!ch || ch.length == 0) return Number.MAX_VALUE; var arSum = 0; for(var i=0, l=ch.length; i<l; i++) { var area = ch[i]._area; var h = area / w; arSum += w > h? w / h : h / w; } return arSum / l; }, /* layoutLast Performs the layout of the last computed sibling. Parameters: ch - An array of nodes. w - A fixed dimension where nodes will be layed out. coord - A coordinates object specifying width, height, left and top style properties. */ layoutLast: function(ch, w, coord, prop) { var child = ch[0]; child.getPos(prop).setc(coord.left, coord.top); child.setData('width', coord.width, prop); child.setData('height', coord.height, prop); } }; Layouts.TM.Squarified = new Class({ Implements: Layouts.TM.Area, computePositions: function(node, coord, prop) { var config = this.config; if (coord.width >= coord.height) this.layout.orientation = 'h'; else this.layout.orientation = 'v'; var ch = node.getSubnodes([1, 1], "ignore"); if(ch.length > 0) { this.processChildrenLayout(node, ch, coord, prop); for(var i=0, l=ch.length; i<l; i++) { var chi = ch[i]; var offst = config.offset, height = chi.getData('height', prop) - offst - config.titleHeight, width = chi.getData('width', prop) - offst; var chipos = chi.getPos(prop); coord = { 'width': width, 'height': height, 'top': chipos.y + config.titleHeight, 'left': chipos.x }; this.computePositions(chi, coord, prop); } } }, /* Method: processChildrenLayout Computes children real areas and other useful parameters for performing the Squarified algorithm. Parameters: par - The parent node of the json subtree. ch - An Array of nodes coord - A coordinates object specifying width, height, left and top style properties. */ processChildrenLayout: function(par, ch, coord, prop) { //compute children real areas var parentArea = coord.width * coord.height; var i, l=ch.length, totalChArea=0, chArea = []; for(i=0; i<l; i++) { chArea[i] = parseFloat(ch[i].getData('area', prop)); totalChArea += chArea[i]; } for(i=0; i<l; i++) { ch[i]._area = parentArea * chArea[i] / totalChArea; } var minimumSideValue = this.layout.horizontal()? coord.height : coord.width; ch.sort(function(a, b) { var diff = b._area - a._area; return diff? diff : (b.id == a.id? 0 : (b.id < a.id? 1 : -1)); }); var initElem = [ch[0]]; var tail = ch.slice(1); this.squarify(tail, initElem, minimumSideValue, coord, prop); }, /* Method: squarify Performs an heuristic method to calculate div elements sizes in order to have a good aspect ratio. Parameters: tail - An array of nodes. initElem - An array of nodes, containing the initial node to be laid out. w - A fixed dimension where nodes will be laid out. coord - A coordinates object specifying width, height, left and top style properties. */ squarify: function(tail, initElem, w, coord, prop) { this.computeDim(tail, initElem, w, coord, this.worstAspectRatio, prop); }, /* Method: layoutRow Performs the layout of an array of nodes. Parameters: ch - An array of nodes. w - A fixed dimension where nodes will be laid out. coord - A coordinates object specifying width, height, left and top style properties. */ layoutRow: function(ch, w, coord, prop) { if(this.layout.horizontal()) { return this.layoutV(ch, w, coord, prop); } else { return this.layoutH(ch, w, coord, prop); } }, layoutV: function(ch, w, coord, prop) { var totalArea = 0, rnd = function(x) { return x; }; $.each(ch, function(elem) { totalArea += elem._area; }); var width = rnd(totalArea / w), top = 0; for(var i=0, l=ch.length; i<l; i++) { var h = rnd(ch[i]._area / width); var chi = ch[i]; chi.getPos(prop).setc(coord.left, coord.top + top); chi.setData('width', width, prop); chi.setData('height', h, prop); top += h; } var ans = { 'height': coord.height, 'width': coord.width - width, 'top': coord.top, 'left': coord.left + width }; //take minimum side value. ans.dim = Math.min(ans.width, ans.height); if(ans.dim != ans.height) this.layout.change(); return ans; }, layoutH: function(ch, w, coord, prop) { var totalArea = 0; $.each(ch, function(elem) { totalArea += elem._area; }); var height = totalArea / w, top = coord.top, left = 0; for(var i=0, l=ch.length; i<l; i++) { var chi = ch[i]; var w = chi._area / height; chi.getPos(prop).setc(coord.left + left, top); chi.setData('width', w, prop); chi.setData('height', height, prop); left += w; } var ans = { 'height': coord.height - height, 'width': coord.width, 'top': coord.top + height, 'left': coord.left }; ans.dim = Math.min(ans.width, ans.height); if(ans.dim != ans.width) this.layout.change(); return ans; } }); Layouts.TM.Strip = new Class({ Implements: Layouts.TM.Area, /* Method: compute Called by loadJSON to calculate recursively all node positions and lay out the tree. Parameters: json - A JSON subtree. See also <Loader.loadJSON>. coord - A coordinates object specifying width, height, left and top style properties. */ computePositions: function(node, coord, prop) { var ch = node.getSubnodes([1, 1], "ignore"), config = this.config; if(ch.length > 0) { this.processChildrenLayout(node, ch, coord, prop); for(var i=0, l=ch.length; i<l; i++) { var chi = ch[i]; var offst = config.offset, height = chi.getData('height', prop) - offst - config.titleHeight, width = chi.getData('width', prop) - offst; var chipos = chi.getPos(prop); coord = { 'width': width, 'height': height, 'top': chipos.y + config.titleHeight, 'left': chipos.x }; this.computePositions(chi, coord, prop); } } }, /* Method: processChildrenLayout Computes children real areas and other useful parameters for performing the Strip algorithm. Parameters: par - The parent node of the json subtree. ch - An Array of nodes coord - A coordinates object specifying width, height, left and top style properties. */ processChildrenLayout: function(par, ch, coord, prop) { //compute children real areas var parentArea = coord.width * coord.height; var i, l=ch.length, totalChArea=0, chArea = []; for(i=0; i<l; i++) { chArea[i] = +ch[i].getData('area', prop); totalChArea += chArea[i]; } for(i=0; i<l; i++) { ch[i]._area = parentArea * chArea[i] / totalChArea; } var side = this.layout.horizontal()? coord.width : coord.height; var initElem = [ch[0]]; var tail = ch.slice(1); this.stripify(tail, initElem, side, coord, prop); }, /* Method: stripify Performs an heuristic method to calculate div elements sizes in order to have a good compromise between aspect ratio and order. Parameters: tail - An array of nodes. initElem - An array of nodes. w - A fixed dimension where nodes will be layed out. coord - A coordinates object specifying width, height, left and top style properties. */ stripify: function(tail, initElem, w, coord, prop) { this.computeDim(tail, initElem, w, coord, this.avgAspectRatio, prop); }, /* Method: layoutRow Performs the layout of an array of nodes. Parameters: ch - An array of nodes. w - A fixed dimension where nodes will be laid out. coord - A coordinates object specifying width, height, left and top style properties. */ layoutRow: function(ch, w, coord, prop) { if(this.layout.horizontal()) { return this.layoutH(ch, w, coord, prop); } else { return this.layoutV(ch, w, coord, prop); } }, layoutV: function(ch, w, coord, prop) { var totalArea = 0; $.each(ch, function(elem) { totalArea += elem._area; }); var width = totalArea / w, top = 0; for(var i=0, l=ch.length; i<l; i++) { var chi = ch[i]; var h = chi._area / width; chi.getPos(prop).setc(coord.left, coord.top + (w - h - top)); chi.setData('width', width, prop); chi.setData('height', h, prop); top += h; } return { 'height': coord.height, 'width': coord.width - width, 'top': coord.top, 'left': coord.left + width, 'dim': w }; }, layoutH: function(ch, w, coord, prop) { var totalArea = 0; $.each(ch, function(elem) { totalArea += elem._area; }); var height = totalArea / w, top = coord.height - height, left = 0; for(var i=0, l=ch.length; i<l; i++) { var chi = ch[i]; var s = chi._area / height; chi.getPos(prop).setc(coord.left + left, coord.top + top); chi.setData('width', s, prop); chi.setData('height', height, prop); left += s; } return { 'height': coord.height - height, 'width': coord.width, 'top': coord.top, 'left': coord.left, 'dim': w }; } }); /* * Class: Layouts.Icicle * * Implements the icicle tree layout. * * Implemented By: * * <Icicle> * */ Layouts.Icicle = new Class({ /* * Method: compute * * Called by loadJSON to calculate all node positions. * * Parameters: * * posType - The nodes' position to compute. Either "start", "end" or * "current". Defaults to "current". */ compute: function(posType) { posType = posType || "current"; var root = this.graph.getNode(this.root), config = this.config, size = this.canvas.getSize(), width = size.width, height = size.height, offset = config.offset, levelsToShow = config.constrained ? config.levelsToShow : Number.MAX_VALUE; this.controller.onBeforeCompute(root); Graph.Util.computeLevels(this.graph, root.id, 0, "ignore"); var treeDepth = 0; Graph.Util.eachLevel(root, 0, false, function (n, d) { if(d > treeDepth) treeDepth = d; }); var startNode = this.graph.getNode(this.clickedNode && this.clickedNode.id || root.id); var maxDepth = Math.min(treeDepth, levelsToShow-1); var initialDepth = startNode._depth; if(this.layout.horizontal()) { this.computeSubtree(startNode, -width/2, -height/2, width/(maxDepth+1), height, initialDepth, maxDepth, posType); } else { this.computeSubtree(startNode, -width/2, -height/2, width, height/(maxDepth+1), initialDepth, maxDepth, posType); } }, computeSubtree: function (root, x, y, width, height, initialDepth, maxDepth, posType) { root.getPos(posType).setc(x, y); root.setData('width', width, posType); root.setData('height', height, posType); var nodeLength, prevNodeLength = 0, totalDim = 0; var children = Graph.Util.getSubnodes(root, [1, 1]); // next level from this node if(!children.length) return; $.each(children, function(e) { totalDim += e.getData('dim'); }); for(var i=0, l=children.length; i < l; i++) { if(this.layout.horizontal()) { nodeLength = height * children[i].getData('dim') / totalDim; this.computeSubtree(children[i], x+width, y, width, nodeLength, initialDepth, maxDepth, posType); y += nodeLength; } else { nodeLength = width * children[i].getData('dim') / totalDim; this.computeSubtree(children[i], x, y+height, nodeLength, height, initialDepth, maxDepth, posType); x += nodeLength; } } } }); /* * File: Icicle.js * */ /* Class: Icicle Icicle space filling visualization. Implements: All <Loader> methods Constructor Options: Inherits options from - <Options.Canvas> - <Options.Controller> - <Options.Node> - <Options.Edge> - <Options.Label> - <Options.Events> - <Options.Tips> - <Options.NodeStyles> - <Options.Navigation> Additionally, there are other parameters and some default values changed orientation - (string) Default's *h*. Whether to set horizontal or vertical layouts. Possible values are 'h' and 'v'. offset - (number) Default's *2*. Boxes offset. constrained - (boolean) Default's *false*. Whether to show the entire tree when loaded or just the number of levels specified by _levelsToShow_. levelsToShow - (number) Default's *3*. The number of levels to show for a subtree. This number is relative to the selected node. animate - (boolean) Default's *false*. Whether to animate transitions. Node.type - Described in <Options.Node>. Default's *rectangle*. Label.type - Described in <Options.Label>. Default's *Native*. duration - Described in <Options.Fx>. Default's *700*. fps - Described in <Options.Fx>. Default's *45*. Instance Properties: canvas - Access a <Canvas> instance. graph - Access a <Graph> instance. op - Access a <Icicle.Op> instance. fx - Access a <Icicle.Plot> instance. labels - Access a <Icicle.Label> interface implementation. */ $jit.Icicle = new Class({ Implements: [ Loader, Extras, Layouts.Icicle ], layout: { orientation: "h", vertical: function(){ return this.orientation == "v"; }, horizontal: function(){ return this.orientation == "h"; }, change: function(){ this.orientation = this.vertical()? "h" : "v"; } }, initialize: function(controller) { var config = { animate: false, orientation: "h", offset: 2, levelsToShow: Number.MAX_VALUE, constrained: false, Node: { type: 'rectangle', overridable: true }, Edge: { type: 'none' }, Label: { type: 'Native' }, duration: 700, fps: 45 }; var opts = Options("Canvas", "Node", "Edge", "Fx", "Tips", "NodeStyles", "Events", "Navigation", "Controller", "Label"); this.controller = this.config = $.merge(opts, config, controller); this.layout.orientation = this.config.orientation; var canvasConfig = this.config; if (canvasConfig.useCanvas) { this.canvas = canvasConfig.useCanvas; this.config.labelContainer = this.canvas.id + '-label'; } else { this.canvas = new Canvas(this, canvasConfig); this.config.labelContainer = (typeof canvasConfig.injectInto == 'string'? canvasConfig.injectInto : canvasConfig.injectInto.id) + '-label'; } this.graphOptions = { 'complex': true, 'Node': { 'selected': false, 'exist': true, 'drawn': true } }; this.graph = new Graph( this.graphOptions, this.config.Node, this.config.Edge, this.config.Label); this.labels = new $jit.Icicle.Label[this.config.Label.type](this); this.fx = new $jit.Icicle.Plot(this, $jit.Icicle); this.op = new $jit.Icicle.Op(this); this.group = new $jit.Icicle.Group(this); this.clickedNode = null; this.initializeExtras(); }, /* Method: refresh Computes positions and plots the tree. */ refresh: function(){ var labelType = this.config.Label.type; if(labelType != 'Native') { var that = this; this.graph.eachNode(function(n) { that.labels.hideLabel(n, false); }); } this.compute(); this.plot(); }, /* Method: plot Plots the Icicle visualization. This is a shortcut to *fx.plot*. */ plot: function(){ this.fx.plot(this.config); }, /* Method: enter Sets the node as root. Parameters: node - (object) A <Graph.Node>. */ enter: function (node) { if (this.busy) return; this.busy = true; var that = this, config = this.config; var callback = { onComplete: function() { //compute positions of newly inserted nodes if(config.request) that.compute(); if(config.animate) { that.graph.nodeList.setDataset(['current', 'end'], { 'alpha': [1, 0] //fade nodes }); Graph.Util.eachSubgraph(node, function(n) { n.setData('alpha', 1, 'end'); }, "ignore"); that.fx.animate({ duration: 500, modes:['node-property:alpha'], onComplete: function() { that.clickedNode = node; that.compute('end'); that.fx.animate({ modes:['linear', 'node-property:width:height'], duration: 1000, onComplete: function() { that.busy = false; that.clickedNode = node; } }); } }); } else { that.clickedNode = node; that.busy = false; that.refresh(); } } }; if(config.request) { this.requestNodes(clickedNode, callback); } else { callback.onComplete(); } }, /* Method: out Sets the parent node of the current selected node as root. */ out: function(){ if(this.busy) return; var that = this, GUtil = Graph.Util, config = this.config, graph = this.graph, parents = GUtil.getParents(graph.getNode(this.clickedNode && this.clickedNode.id || this.root)), parent = parents[0], clickedNode = parent, previousClickedNode = this.clickedNode; this.busy = true; this.events.hoveredNode = false; if(!parent) { this.busy = false; return; } //final plot callback callback = { onComplete: function() { that.clickedNode = parent; if(config.request) { that.requestNodes(parent, { onComplete: function() { that.compute(); that.plot(); that.busy = false; } }); } else { that.compute(); that.plot(); that.busy = false; } } }; //animate node positions if(config.animate) { this.clickedNode = clickedNode; this.compute('end'); //animate the visible subtree only this.clickedNode = previousClickedNode; this.fx.animate({ modes:['linear', 'node-property:width:height'], duration: 1000, onComplete: function() { //animate the parent subtree that.clickedNode = clickedNode; //change nodes alpha graph.nodeList.setDataset(['current', 'end'], { 'alpha': [0, 1] }); GUtil.eachSubgraph(previousClickedNode, function(node) { node.setData('alpha', 1); }, "ignore"); that.fx.animate({ duration: 500, modes:['node-property:alpha'], onComplete: function() { callback.onComplete(); } }); } }); } else { callback.onComplete(); } }, requestNodes: function(node, onComplete){ var handler = $.merge(this.controller, onComplete), levelsToShow = this.config.constrained ? this.config.levelsToShow : Number.MAX_VALUE; if (handler.request) { var leaves = [], d = node._depth; Graph.Util.eachLevel(node, 0, levelsToShow, function(n){ if (n.drawn && !Graph.Util.anySubnode(n)) { leaves.push(n); n._level = n._depth - d; if (this.config.constrained) n._level = levelsToShow - n._level; } }); this.group.requestNodes(leaves, handler); } else { handler.onComplete(); } } }); /* Class: Icicle.Op Custom extension of <Graph.Op>. Extends: All <Graph.Op> methods See also: <Graph.Op> */ $jit.Icicle.Op = new Class({ Implements: Graph.Op }); /* * Performs operations on group of nodes. */ $jit.Icicle.Group = new Class({ initialize: function(viz){ this.viz = viz; this.canvas = viz.canvas; this.config = viz.config; }, /* * Calls the request method on the controller to request a subtree for each node. */ requestNodes: function(nodes, controller){ var counter = 0, len = nodes.length, nodeSelected = {}; var complete = function(){ controller.onComplete(); }; var viz = this.viz; if (len == 0) complete(); for(var i = 0; i < len; i++) { nodeSelected[nodes[i].id] = nodes[i]; controller.request(nodes[i].id, nodes[i]._level, { onComplete: function(nodeId, data){ if (data && data.children) { data.id = nodeId; viz.op.sum(data, { type: 'nothing' }); } if (++counter == len) { Graph.Util.computeLevels(viz.graph, viz.root, 0); complete(); } } }); } } }); /* Class: Icicle.Plot Custom extension of <Graph.Plot>. Extends: All <Graph.Plot> methods See also: <Graph.Plot> */ $jit.Icicle.Plot = new Class({ Implements: Graph.Plot, plot: function(opt, animating){ opt = opt || this.viz.controller; var viz = this.viz, graph = viz.graph, root = graph.getNode(viz.clickedNode && viz.clickedNode.id || viz.root), initialDepth = root._depth; viz.canvas.clear(); this.plotTree(root, $.merge(opt, { 'withLabels': true, 'hideLabels': false, 'plotSubtree': function(root, node) { return !viz.config.constrained || (node._depth - initialDepth < viz.config.levelsToShow); } }), animating); } }); /* Class: Icicle.Label Custom extension of <Graph.Label>. Contains custom <Graph.Label.SVG>, <Graph.Label.HTML> and <Graph.Label.Native> extensions. Extends: All <Graph.Label> methods and subclasses. See also: <Graph.Label>, <Graph.Label.Native>, <Graph.Label.HTML>, <Graph.Label.SVG>. */ $jit.Icicle.Label = {}; /* Icicle.Label.Native Custom extension of <Graph.Label.Native>. Extends: All <Graph.Label.Native> methods See also: <Graph.Label.Native> */ $jit.Icicle.Label.Native = new Class({ Implements: Graph.Label.Native, renderLabel: function(canvas, node, controller) { var ctx = canvas.getCtx(), width = node.getData('width'), height = node.getData('height'), size = node.getLabelData('size'), m = ctx.measureText(node.name); // Guess as much as possible if the label will fit in the node if(height < (size * 1.5) || width < m.width) return; var pos = node.pos.getc(true); ctx.fillText(node.name, pos.x + width / 2, pos.y + height / 2); } }); /* Icicle.Label.SVG Custom extension of <Graph.Label.SVG>. Extends: All <Graph.Label.SVG> methods See also: <Graph.Label.SVG> */ $jit.Icicle.Label.SVG = new Class( { Implements: Graph.Label.SVG, initialize: function(viz){ this.viz = viz; }, /* placeLabel Overrides abstract method placeLabel in <Graph.Plot>. Parameters: tag - A DOM label element. node - A <Graph.Node>. controller - A configuration/controller object passed to the visualization. */ placeLabel: function(tag, node, controller){ var pos = node.pos.getc(true), canvas = this.viz.canvas; var radius = canvas.getSize(); var labelPos = { x: Math.round(pos.x + radius.width / 2), y: Math.round(pos.y + radius.height / 2) }; tag.setAttribute('x', labelPos.x); tag.setAttribute('y', labelPos.y); controller.onPlaceLabel(tag, node); } }); /* Icicle.Label.HTML Custom extension of <Graph.Label.HTML>. Extends: All <Graph.Label.HTML> methods. See also: <Graph.Label.HTML> */ $jit.Icicle.Label.HTML = new Class( { Implements: Graph.Label.HTML, initialize: function(viz){ this.viz = viz; }, /* placeLabel Overrides abstract method placeLabel in <Graph.Plot>. Parameters: tag - A DOM label element. node - A <Graph.Node>. controller - A configuration/controller object passed to the visualization. */ placeLabel: function(tag, node, controller){ var pos = node.pos.getc(true), canvas = this.viz.canvas; var radius = canvas.getSize(); var labelPos = { x: Math.round(pos.x + radius.width / 2), y: Math.round(pos.y + radius.height / 2) }; var style = tag.style; style.left = labelPos.x + 'px'; style.top = labelPos.y + 'px'; style.display = ''; controller.onPlaceLabel(tag, node); } }); /* Class: Icicle.Plot.NodeTypes This class contains a list of <Graph.Node> built-in types. Node types implemented are 'none', 'rectangle'. You can add your custom node types, customizing your visualization to the extreme. Example: (start code js) Icicle.Plot.NodeTypes.implement({ 'mySpecialType': { 'render': function(node, canvas) { //print your custom node to canvas }, //optional 'contains': function(node, pos) { //return true if pos is inside the node or false otherwise } } }); (end code) */ $jit.Icicle.Plot.NodeTypes = new Class( { 'none': { 'render': $.empty }, 'rectangle': { 'render': function(node, canvas, animating) { var config = this.viz.config; var offset = config.offset; var width = node.getData('width'); var height = node.getData('height'); var border = node.getData('border'); var pos = node.pos.getc(true); var posx = pos.x + offset / 2, posy = pos.y + offset / 2; var ctx = canvas.getCtx(); if(width - offset < 2 || height - offset < 2) return; if(config.cushion) { var color = node.getData('color'); var lg = ctx.createRadialGradient(posx + (width - offset)/2, posy + (height - offset)/2, 1, posx + (width-offset)/2, posy + (height-offset)/2, width < height? height : width); var colorGrad = $.rgbToHex($.map($.hexToRgb(color), function(r) { return r * 0.3 >> 0; })); lg.addColorStop(0, color); lg.addColorStop(1, colorGrad); ctx.fillStyle = lg; } if (border) { ctx.strokeStyle = border; ctx.lineWidth = 3; } ctx.fillRect(posx, posy, Math.max(0, width - offset), Math.max(0, height - offset)); border && ctx.strokeRect(pos.x, pos.y, width, height); }, 'contains': function(node, pos) { if(this.viz.clickedNode && !$jit.Graph.Util.isDescendantOf(node, this.viz.clickedNode.id)) return false; var npos = node.pos.getc(true), width = node.getData('width'), height = node.getData('height'); return this.nodeHelper.rectangle.contains({x: npos.x + width/2, y: npos.y + height/2}, pos, width, height); } } }); $jit.Icicle.Plot.EdgeTypes = new Class( { 'none': $.empty }); /* * File: Layouts.ForceDirected.js * */ /* * Class: Layouts.ForceDirected * * Implements a Force Directed Layout. * * Implemented By: * * <ForceDirected> * * Credits: * * Marcus Cobden <http://marcuscobden.co.uk> * */ Layouts.ForceDirected = new Class({ getOptions: function(random) { var s = this.canvas.getSize(); var w = s.width, h = s.height; //count nodes var count = 0; this.graph.eachNode(function(n) { count++; }); var k2 = w * h / count, k = Math.sqrt(k2); var l = this.config.levelDistance; return { width: w, height: h, tstart: w * 0.1, nodef: function(x) { return k2 / (x || 1); }, edgef: function(x) { return /* x * x / k; */ k * (x - l); } }; }, compute: function(property, incremental) { var prop = $.splat(property || ['current', 'start', 'end']); var opt = this.getOptions(); NodeDim.compute(this.graph, prop, this.config); this.graph.computeLevels(this.root, 0, "ignore"); this.graph.eachNode(function(n) { $.each(prop, function(p) { var pos = n.getPos(p); if(pos.equals(Complex.KER)) { pos.x = opt.width/5 * (Math.random() - 0.5); pos.y = opt.height/5 * (Math.random() - 0.5); } //initialize disp vector n.disp = {}; $.each(prop, function(p) { n.disp[p] = $C(0, 0); }); }); }); this.computePositions(prop, opt, incremental); }, computePositions: function(property, opt, incremental) { var times = this.config.iterations, i = 0, that = this; if(incremental) { (function iter() { for(var total=incremental.iter, j=0; j<total; j++) { opt.t = opt.tstart * (1 - i++/(times -1)); that.computePositionStep(property, opt); if(i >= times) { incremental.onComplete(); return; } } incremental.onStep(Math.round(i / (times -1) * 100)); setTimeout(iter, 1); })(); } else { for(; i < times; i++) { opt.t = opt.tstart * (1 - i/(times -1)); this.computePositionStep(property, opt); } } }, computePositionStep: function(property, opt) { var graph = this.graph; var min = Math.min, max = Math.max; var dpos = $C(0, 0); //calculate repulsive forces graph.eachNode(function(v) { //initialize disp $.each(property, function(p) { v.disp[p].x = 0; v.disp[p].y = 0; }); graph.eachNode(function(u) { if(u.id != v.id) { $.each(property, function(p) { var vp = v.getPos(p), up = u.getPos(p); dpos.x = vp.x - up.x; dpos.y = vp.y - up.y; var norm = dpos.norm() || 1; v.disp[p].$add(dpos .$scale(opt.nodef(norm) / norm)); }); } }); }); //calculate attractive forces var T = !!graph.getNode(this.root).visited; graph.eachNode(function(node) { node.eachAdjacency(function(adj) { var nodeTo = adj.nodeTo; if(!!nodeTo.visited === T) { $.each(property, function(p) { var vp = node.getPos(p), up = nodeTo.getPos(p); dpos.x = vp.x - up.x; dpos.y = vp.y - up.y; var norm = dpos.norm() || 1; node.disp[p].$add(dpos.$scale(-opt.edgef(norm) / norm)); nodeTo.disp[p].$add(dpos.$scale(-1)); }); } }); node.visited = !T; }); //arrange positions to fit the canvas var t = opt.t, w2 = opt.width / 2, h2 = opt.height / 2; graph.eachNode(function(u) { $.each(property, function(p) { var disp = u.disp[p]; var norm = disp.norm() || 1; var p = u.getPos(p); p.$add($C(disp.x * min(Math.abs(disp.x), t) / norm, disp.y * min(Math.abs(disp.y), t) / norm)); p.x = min(w2, max(-w2, p.x)); p.y = min(h2, max(-h2, p.y)); }); }); } }); /* * File: ForceDirected.js */ /* Class: ForceDirected A visualization that lays graphs using a Force-Directed layout algorithm. Inspired by: Force-Directed Drawing Algorithms (Stephen G. Kobourov) <http://www.cs.brown.edu/~rt/gdhandbook/chapters/force-directed.pdf> Implements: All <Loader> methods Constructor Options: Inherits options from - <Options.Canvas> - <Options.Controller> - <Options.Node> - <Options.Edge> - <Options.Label> - <Options.Events> - <Options.Tips> - <Options.NodeStyles> - <Options.Navigation> Additionally, there are two parameters levelDistance - (number) Default's *50*. The natural length desired for the edges. iterations - (number) Default's *50*. The number of iterations for the spring layout simulation. Depending on the browser's speed you could set this to a more 'interesting' number, like *200*. Instance Properties: canvas - Access a <Canvas> instance. graph - Access a <Graph> instance. op - Access a <ForceDirected.Op> instance. fx - Access a <ForceDirected.Plot> instance. labels - Access a <ForceDirected.Label> interface implementation. */ $jit.ForceDirected = new Class( { Implements: [ Loader, Extras, Layouts.ForceDirected ], initialize: function(controller) { var $ForceDirected = $jit.ForceDirected; var config = { iterations: 50, levelDistance: 50 }; this.controller = this.config = $.merge(Options("Canvas", "Node", "Edge", "Fx", "Tips", "NodeStyles", "Events", "Navigation", "Controller", "Label"), config, controller); var canvasConfig = this.config; if(canvasConfig.useCanvas) { this.canvas = canvasConfig.useCanvas; this.config.labelContainer = this.canvas.id + '-label'; } else { if(canvasConfig.background) { canvasConfig.background = $.merge({ type: 'Circles' }, canvasConfig.background); } this.canvas = new Canvas(this, canvasConfig); this.config.labelContainer = (typeof canvasConfig.injectInto == 'string'? canvasConfig.injectInto : canvasConfig.injectInto.id) + '-label'; } this.graphOptions = { 'complex': true, 'Node': { 'selected': false, 'exist': true, 'drawn': true } }; this.graph = new Graph(this.graphOptions, this.config.Node, this.config.Edge); this.labels = new $ForceDirected.Label[canvasConfig.Label.type](this); this.fx = new $ForceDirected.Plot(this, $ForceDirected); this.op = new $ForceDirected.Op(this); this.json = null; this.busy = false; // initialize extras this.initializeExtras(); }, /* Method: refresh Computes positions and plots the tree. */ refresh: function() { this.compute(); this.plot(); }, reposition: function() { this.compute('end'); }, /* Method: computeIncremental Performs the Force Directed algorithm incrementally. Description: ForceDirected algorithms can perform many computations and lead to JavaScript taking too much time to complete. This method splits the algorithm into smaller parts allowing the user to track the evolution of the algorithm and avoiding browser messages such as "This script is taking too long to complete". Parameters: opt - (object) The object properties are described below iter - (number) Default's *20*. Split the algorithm into pieces of _iter_ iterations. For example, if the _iterations_ configuration property of your <ForceDirected> class is 100, then you could set _iter_ to 20 to split the main algorithm into 5 smaller pieces. property - (string) Default's *end*. Whether to update starting, current or ending node positions. Possible values are 'end', 'start', 'current'. You can also set an array of these properties. If you'd like to keep the current node positions but to perform these computations for final animation positions then you can just choose 'end'. onStep - (function) A callback function called when each "small part" of the algorithm completed. This function gets as first formal parameter a percentage value. onComplete - A callback function called when the algorithm completed. Example: In this example I calculate the end positions and then animate the graph to those positions (start code js) var fd = new $jit.ForceDirected(...); fd.computeIncremental({ iter: 20, property: 'end', onStep: function(perc) { Log.write("loading " + perc + "%"); }, onComplete: function() { Log.write("done"); fd.animate(); } }); (end code) In this example I calculate all positions and (re)plot the graph (start code js) var fd = new ForceDirected(...); fd.computeIncremental({ iter: 20, property: ['end', 'start', 'current'], onStep: function(perc) { Log.write("loading " + perc + "%"); }, onComplete: function() { Log.write("done"); fd.plot(); } }); (end code) */ computeIncremental: function(opt) { opt = $.merge( { iter: 20, property: 'end', onStep: $.empty, onComplete: $.empty }, opt || {}); this.config.onBeforeCompute(this.graph.getNode(this.root)); this.compute(opt.property, opt); }, /* Method: plot Plots the ForceDirected graph. This is a shortcut to *fx.plot*. */ plot: function() { this.fx.plot(); }, /* Method: animate Animates the graph from the current positions to the 'end' node positions. */ animate: function(opt) { this.fx.animate($.merge( { modes: [ 'linear' ] }, opt || {})); } }); $jit.ForceDirected.$extend = true; (function(ForceDirected) { /* Class: ForceDirected.Op Custom extension of <Graph.Op>. Extends: All <Graph.Op> methods See also: <Graph.Op> */ ForceDirected.Op = new Class( { Implements: Graph.Op }); /* Class: ForceDirected.Plot Custom extension of <Graph.Plot>. Extends: All <Graph.Plot> methods See also: <Graph.Plot> */ ForceDirected.Plot = new Class( { Implements: Graph.Plot }); /* Class: ForceDirected.Label Custom extension of <Graph.Label>. Contains custom <Graph.Label.SVG>, <Graph.Label.HTML> and <Graph.Label.Native> extensions. Extends: All <Graph.Label> methods and subclasses. See also: <Graph.Label>, <Graph.Label.Native>, <Graph.Label.HTML>, <Graph.Label.SVG>. */ ForceDirected.Label = {}; /* ForceDirected.Label.Native Custom extension of <Graph.Label.Native>. Extends: All <Graph.Label.Native> methods See also: <Graph.Label.Native> */ ForceDirected.Label.Native = new Class( { Implements: Graph.Label.Native }); /* ForceDirected.Label.SVG Custom extension of <Graph.Label.SVG>. Extends: All <Graph.Label.SVG> methods See also: <Graph.Label.SVG> */ ForceDirected.Label.SVG = new Class( { Implements: Graph.Label.SVG, initialize: function(viz) { this.viz = viz; }, /* placeLabel Overrides abstract method placeLabel in <Graph.Label>. Parameters: tag - A DOM label element. node - A <Graph.Node>. controller - A configuration/controller object passed to the visualization. */ placeLabel: function(tag, node, controller) { var pos = node.pos.getc(true), canvas = this.viz.canvas, ox = canvas.translateOffsetX, oy = canvas.translateOffsetY, sx = canvas.scaleOffsetX, sy = canvas.scaleOffsetY, radius = canvas.getSize(); var labelPos = { x: Math.round(pos.x * sx + ox + radius.width / 2), y: Math.round(pos.y * sy + oy + radius.height / 2) }; tag.setAttribute('x', labelPos.x); tag.setAttribute('y', labelPos.y); controller.onPlaceLabel(tag, node); } }); /* ForceDirected.Label.HTML Custom extension of <Graph.Label.HTML>. Extends: All <Graph.Label.HTML> methods. See also: <Graph.Label.HTML> */ ForceDirected.Label.HTML = new Class( { Implements: Graph.Label.HTML, initialize: function(viz) { this.viz = viz; }, /* placeLabel Overrides abstract method placeLabel in <Graph.Plot>. Parameters: tag - A DOM label element. node - A <Graph.Node>. controller - A configuration/controller object passed to the visualization. */ placeLabel: function(tag, node, controller) { var pos = node.pos.getc(true), canvas = this.viz.canvas, ox = canvas.translateOffsetX, oy = canvas.translateOffsetY, sx = canvas.scaleOffsetX, sy = canvas.scaleOffsetY, radius = canvas.getSize(); var labelPos = { x: Math.round(pos.x * sx + ox + radius.width / 2), y: Math.round(pos.y * sy + oy + radius.height / 2) }; var style = tag.style; style.left = labelPos.x + 'px'; style.top = labelPos.y + 'px'; style.display = this.fitsInCanvas(labelPos, canvas) ? '' : 'none'; controller.onPlaceLabel(tag, node); } }); /* Class: ForceDirected.Plot.NodeTypes This class contains a list of <Graph.Node> built-in types. Node types implemented are 'none', 'circle', 'triangle', 'rectangle', 'star', 'ellipse' and 'square'. You can add your custom node types, customizing your visualization to the extreme. Example: (start code js) ForceDirected.Plot.NodeTypes.implement({ 'mySpecialType': { 'render': function(node, canvas) { //print your custom node to canvas }, //optional 'contains': function(node, pos) { //return true if pos is inside the node or false otherwise } } }); (end code) */ ForceDirected.Plot.NodeTypes = new Class({ 'none': { 'render': $.empty, 'contains': $.lambda(false) }, 'circle': { 'render': function(node, canvas){ var pos = node.pos.getc(true), dim = node.getData('dim'); this.nodeHelper.circle.render('fill', pos, dim, canvas); }, 'contains': function(node, pos){ var npos = node.pos.getc(true), dim = node.getData('dim'); return this.nodeHelper.circle.contains(npos, pos, dim); } }, 'ellipse': { 'render': function(node, canvas){ var pos = node.pos.getc(true), width = node.getData('width'), height = node.getData('height'); this.nodeHelper.ellipse.render('fill', pos, width, height, canvas); }, // TODO(nico): be more precise... 'contains': function(node, pos){ var npos = node.pos.getc(true), width = node.getData('width'), height = node.getData('height'); return this.nodeHelper.ellipse.contains(npos, pos, width, height); } }, 'square': { 'render': function(node, canvas){ var pos = node.pos.getc(true), dim = node.getData('dim'); this.nodeHelper.square.render('fill', pos, dim, canvas); }, 'contains': function(node, pos){ var npos = node.pos.getc(true), dim = node.getData('dim'); return this.nodeHelper.square.contains(npos, pos, dim); } }, 'rectangle': { 'render': function(node, canvas){ var pos = node.pos.getc(true), width = node.getData('width'), height = node.getData('height'); this.nodeHelper.rectangle.render('fill', pos, width, height, canvas); }, 'contains': function(node, pos){ var npos = node.pos.getc(true), width = node.getData('width'), height = node.getData('height'); return this.nodeHelper.rectangle.contains(npos, pos, width, height); } }, 'triangle': { 'render': function(node, canvas){ var pos = node.pos.getc(true), dim = node.getData('dim'); this.nodeHelper.triangle.render('fill', pos, dim, canvas); }, 'contains': function(node, pos) { var npos = node.pos.getc(true), dim = node.getData('dim'); return this.nodeHelper.triangle.contains(npos, pos, dim); } }, 'star': { 'render': function(node, canvas){ var pos = node.pos.getc(true), dim = node.getData('dim'); this.nodeHelper.star.render('fill', pos, dim, canvas); }, 'contains': function(node, pos) { var npos = node.pos.getc(true), dim = node.getData('dim'); return this.nodeHelper.star.contains(npos, pos, dim); } } }); /* Class: ForceDirected.Plot.EdgeTypes This class contains a list of <Graph.Adjacence> built-in types. Edge types implemented are 'none', 'line' and 'arrow'. You can add your custom edge types, customizing your visualization to the extreme. Example: (start code js) ForceDirected.Plot.EdgeTypes.implement({ 'mySpecialType': { 'render': function(adj, canvas) { //print your custom edge to canvas }, //optional 'contains': function(adj, pos) { //return true if pos is inside the arc or false otherwise } } }); (end code) */ ForceDirected.Plot.EdgeTypes = new Class({ 'none': $.empty, 'line': { 'render': function(adj, canvas) { var from = adj.nodeFrom.pos.getc(true), to = adj.nodeTo.pos.getc(true); this.edgeHelper.line.render(from, to, canvas); }, 'contains': function(adj, pos) { var from = adj.nodeFrom.pos.getc(true), to = adj.nodeTo.pos.getc(true); return this.edgeHelper.line.contains(from, to, pos, this.edge.epsilon); } }, 'arrow': { 'render': function(adj, canvas) { var from = adj.nodeFrom.pos.getc(true), to = adj.nodeTo.pos.getc(true), dim = adj.getData('dim'), direction = adj.data.$direction, inv = (direction && direction.length>1 && direction[0] != adj.nodeFrom.id); this.edgeHelper.arrow.render(from, to, dim, inv, canvas); }, 'contains': function(adj, pos) { var from = adj.nodeFrom.pos.getc(true), to = adj.nodeTo.pos.getc(true); return this.edgeHelper.arrow.contains(from, to, pos, this.edge.epsilon); } } }); })($jit.ForceDirected); /* * File: Treemap.js * */ $jit.TM = {}; var TM = $jit.TM; $jit.TM.$extend = true; /* Class: TM.Base Abstract class providing base functionality for <TM.Squarified>, <TM.Strip> and <TM.SliceAndDice> visualizations. Implements: All <Loader> methods Constructor Options: Inherits options from - <Options.Canvas> - <Options.Controller> - <Options.Node> - <Options.Edge> - <Options.Label> - <Options.Events> - <Options.Tips> - <Options.NodeStyles> - <Options.Navigation> Additionally, there are other parameters and some default values changed orientation - (string) Default's *h*. Whether to set horizontal or vertical layouts. Possible values are 'h' and 'v'. titleHeight - (number) Default's *13*. The height of the title rectangle for inner (non-leaf) nodes. offset - (number) Default's *2*. Boxes offset. constrained - (boolean) Default's *false*. Whether to show the entire tree when loaded or just the number of levels specified by _levelsToShow_. levelsToShow - (number) Default's *3*. The number of levels to show for a subtree. This number is relative to the selected node. animate - (boolean) Default's *false*. Whether to animate transitions. Node.type - Described in <Options.Node>. Default's *rectangle*. duration - Described in <Options.Fx>. Default's *700*. fps - Described in <Options.Fx>. Default's *45*. Instance Properties: canvas - Access a <Canvas> instance. graph - Access a <Graph> instance. op - Access a <TM.Op> instance. fx - Access a <TM.Plot> instance. labels - Access a <TM.Label> interface implementation. Inspired by: Squarified Treemaps (Mark Bruls, Kees Huizing, and Jarke J. van Wijk) <http://www.win.tue.nl/~vanwijk/stm.pdf> Tree visualization with tree-maps: 2-d space-filling approach (Ben Shneiderman) <http://hcil.cs.umd.edu/trs/91-03/91-03.html> Note: This visualization was built and engineered from scratch, taking only the paper as inspiration, and only shares some features with the visualization described in the paper. */ TM.Base = { layout: { orientation: "h", vertical: function(){ return this.orientation == "v"; }, horizontal: function(){ return this.orientation == "h"; }, change: function(){ this.orientation = this.vertical()? "h" : "v"; } }, initialize: function(controller){ var config = { orientation: "h", titleHeight: 13, offset: 2, levelsToShow: 0, constrained: false, animate: false, Node: { type: 'rectangle', overridable: true, //we all know why this is not zero, //right, Firefox? width: 3, height: 3, color: '#444' }, Label: { textAlign: 'center', textBaseline: 'top' }, Edge: { type: 'none' }, duration: 700, fps: 45 }; this.controller = this.config = $.merge(Options("Canvas", "Node", "Edge", "Fx", "Controller", "Tips", "NodeStyles", "Events", "Navigation", "Label"), config, controller); this.layout.orientation = this.config.orientation; var canvasConfig = this.config; if (canvasConfig.useCanvas) { this.canvas = canvasConfig.useCanvas; this.config.labelContainer = this.canvas.id + '-label'; } else { if(canvasConfig.background) { canvasConfig.background = $.merge({ type: 'Circles' }, canvasConfig.background); } this.canvas = new Canvas(this, canvasConfig); this.config.labelContainer = (typeof canvasConfig.injectInto == 'string'? canvasConfig.injectInto : canvasConfig.injectInto.id) + '-label'; } this.graphOptions = { 'complex': true, 'Node': { 'selected': false, 'exist': true, 'drawn': true } }; this.graph = new Graph(this.graphOptions, this.config.Node, this.config.Edge); this.labels = new TM.Label[canvasConfig.Label.type](this); this.fx = new TM.Plot(this); this.op = new TM.Op(this); this.group = new TM.Group(this); this.geom = new TM.Geom(this); this.clickedNode = null; this.busy = false; // initialize extras this.initializeExtras(); }, /* Method: refresh Computes positions and plots the tree. */ refresh: function(){ if(this.busy) return; this.busy = true; var that = this; if(this.config.animate) { this.compute('end'); this.config.levelsToShow > 0 && this.geom.setRightLevelToShow(this.graph.getNode(this.clickedNode && this.clickedNode.id || this.root)); this.fx.animate($.merge(this.config, { modes: ['linear', 'node-property:width:height'], onComplete: function() { that.busy = false; } })); } else { var labelType = this.config.Label.type; if(labelType != 'Native') { var that = this; this.graph.eachNode(function(n) { that.labels.hideLabel(n, false); }); } this.busy = false; this.compute(); this.config.levelsToShow > 0 && this.geom.setRightLevelToShow(this.graph.getNode(this.clickedNode && this.clickedNode.id || this.root)); this.plot(); } }, /* Method: plot Plots the TreeMap. This is a shortcut to *fx.plot*. */ plot: function(){ this.fx.plot(); }, /* Method: leaf Returns whether the node is a leaf. Parameters: n - (object) A <Graph.Node>. */ leaf: function(n){ return n.getSubnodes([ 1, 1 ], "ignore").length == 0; }, /* Method: enter Sets the node as root. Parameters: n - (object) A <Graph.Node>. */ enter: function(n){ if(this.busy) return; this.busy = true; var that = this, config = this.config, graph = this.graph, clickedNode = n, previousClickedNode = this.clickedNode; var callback = { onComplete: function() { //ensure that nodes are shown for that level if(config.levelsToShow > 0) { that.geom.setRightLevelToShow(n); } //compute positions of newly inserted nodes if(config.levelsToShow > 0 || config.request) that.compute(); if(config.animate) { //fade nodes graph.nodeList.setData('alpha', 0, 'end'); n.eachSubgraph(function(n) { n.setData('alpha', 1, 'end'); }, "ignore"); that.fx.animate({ duration: 500, modes:['node-property:alpha'], onComplete: function() { //compute end positions that.clickedNode = clickedNode; that.compute('end'); //animate positions //TODO(nico) commenting this line didn't seem to throw errors... that.clickedNode = previousClickedNode; that.fx.animate({ modes:['linear', 'node-property:width:height'], duration: 1000, onComplete: function() { that.busy = false; //TODO(nico) check comment above that.clickedNode = clickedNode; } }); } }); } else { that.busy = false; that.clickedNode = n; that.refresh(); } } }; if(config.request) { this.requestNodes(clickedNode, callback); } else { callback.onComplete(); } }, /* Method: out Sets the parent node of the current selected node as root. */ out: function(){ if(this.busy) return; this.busy = true; this.events.hoveredNode = false; var that = this, config = this.config, graph = this.graph, parents = graph.getNode(this.clickedNode && this.clickedNode.id || this.root).getParents(), parent = parents[0], clickedNode = parent, previousClickedNode = this.clickedNode; //if no parents return if(!parent) { this.busy = false; return; } //final plot callback callback = { onComplete: function() { that.clickedNode = parent; if(config.request) { that.requestNodes(parent, { onComplete: function() { that.compute(); that.plot(); that.busy = false; } }); } else { that.compute(); that.plot(); that.busy = false; } } }; //prune tree if (config.levelsToShow > 0) this.geom.setRightLevelToShow(parent); //animate node positions if(config.animate) { this.clickedNode = clickedNode; this.compute('end'); //animate the visible subtree only this.clickedNode = previousClickedNode; this.fx.animate({ modes:['linear', 'node-property:width:height'], duration: 1000, onComplete: function() { //animate the parent subtree that.clickedNode = clickedNode; //change nodes alpha graph.eachNode(function(n) { n.setDataset(['current', 'end'], { 'alpha': [0, 1] }); }, "ignore"); previousClickedNode.eachSubgraph(function(node) { node.setData('alpha', 1); }, "ignore"); that.fx.animate({ duration: 500, modes:['node-property:alpha'], onComplete: function() { callback.onComplete(); } }); } }); } else { callback.onComplete(); } }, requestNodes: function(node, onComplete){ var handler = $.merge(this.controller, onComplete), lev = this.config.levelsToShow; if (handler.request) { var leaves = [], d = node._depth; node.eachLevel(0, lev, function(n){ var nodeLevel = lev - (n._depth - d); if (n.drawn && !n.anySubnode() && nodeLevel > 0) { leaves.push(n); n._level = nodeLevel; } }); this.group.requestNodes(leaves, handler); } else { handler.onComplete(); } } }; /* Class: TM.Op Custom extension of <Graph.Op>. Extends: All <Graph.Op> methods See also: <Graph.Op> */ TM.Op = new Class({ Implements: Graph.Op, initialize: function(viz){ this.viz = viz; } }); //extend level methods of Graph.Geom TM.Geom = new Class({ Implements: Graph.Geom, getRightLevelToShow: function() { return this.viz.config.levelsToShow; }, setRightLevelToShow: function(node) { var level = this.getRightLevelToShow(), fx = this.viz.labels; node.eachLevel(0, level+1, function(n) { var d = n._depth - node._depth; if(d > level) { n.drawn = false; n.exist = false; n.ignore = true; fx.hideLabel(n, false); } else { n.drawn = true; n.exist = true; delete n.ignore; } }); node.drawn = true; delete node.ignore; } }); /* Performs operations on group of nodes. */ TM.Group = new Class( { initialize: function(viz){ this.viz = viz; this.canvas = viz.canvas; this.config = viz.config; }, /* Calls the request method on the controller to request a subtree for each node. */ requestNodes: function(nodes, controller){ var counter = 0, len = nodes.length, nodeSelected = {}; var complete = function(){ controller.onComplete(); }; var viz = this.viz; if (len == 0) complete(); for ( var i = 0; i < len; i++) { nodeSelected[nodes[i].id] = nodes[i]; controller.request(nodes[i].id, nodes[i]._level, { onComplete: function(nodeId, data){ if (data && data.children) { data.id = nodeId; viz.op.sum(data, { type: 'nothing' }); } if (++counter == len) { viz.graph.computeLevels(viz.root, 0); complete(); } } }); } } }); /* Class: TM.Plot Custom extension of <Graph.Plot>. Extends: All <Graph.Plot> methods See also: <Graph.Plot> */ TM.Plot = new Class({ Implements: Graph.Plot, initialize: function(viz){ this.viz = viz; this.config = viz.config; this.node = this.config.Node; this.edge = this.config.Edge; this.animation = new Animation; this.nodeTypes = new TM.Plot.NodeTypes; this.edgeTypes = new TM.Plot.EdgeTypes; this.labels = viz.labels; }, plot: function(opt, animating){ var viz = this.viz, graph = viz.graph; viz.canvas.clear(); this.plotTree(graph.getNode(viz.clickedNode && viz.clickedNode.id || viz.root), $.merge(viz.config, opt || {}, { 'withLabels': true, 'hideLabels': false, 'plotSubtree': function(n, ch){ return n.anySubnode("exist"); } }), animating); } }); /* Class: TM.Label Custom extension of <Graph.Label>. Contains custom <Graph.Label.SVG>, <Graph.Label.HTML> and <Graph.Label.Native> extensions. Extends: All <Graph.Label> methods and subclasses. See also: <Graph.Label>, <Graph.Label.Native>, <Graph.Label.HTML>, <Graph.Label.SVG>. */ TM.Label = {}; /* TM.Label.Native Custom extension of <Graph.Label.Native>. Extends: All <Graph.Label.Native> methods See also: <Graph.Label.Native> */ TM.Label.Native = new Class({ Implements: Graph.Label.Native, initialize: function(viz) { this.config = viz.config; this.leaf = viz.leaf; }, renderLabel: function(canvas, node, controller){ if(!this.leaf(node) && !this.config.titleHeight) return; var pos = node.pos.getc(true), ctx = canvas.getCtx(), width = node.getData('width'), height = node.getData('height'), x = pos.x + width/2, y = pos.y; ctx.fillText(node.name, x, y, width); } }); /* TM.Label.SVG Custom extension of <Graph.Label.SVG>. Extends: All <Graph.Label.SVG> methods See also: <Graph.Label.SVG> */ TM.Label.SVG = new Class( { Implements: Graph.Label.SVG, initialize: function(viz){ this.viz = viz; this.leaf = viz.leaf; this.config = viz.config; }, /* placeLabel Overrides abstract method placeLabel in <Graph.Plot>. Parameters: tag - A DOM label element. node - A <Graph.Node>. controller - A configuration/controller object passed to the visualization. */ placeLabel: function(tag, node, controller){ var pos = node.pos.getc(true), canvas = this.viz.canvas, ox = canvas.translateOffsetX, oy = canvas.translateOffsetY, sx = canvas.scaleOffsetX, sy = canvas.scaleOffsetY, radius = canvas.getSize(); var labelPos = { x: Math.round(pos.x * sx + ox + radius.width / 2), y: Math.round(pos.y * sy + oy + radius.height / 2) }; tag.setAttribute('x', labelPos.x); tag.setAttribute('y', labelPos.y); if(!this.leaf(node) && !this.config.titleHeight) { tag.style.display = 'none'; } controller.onPlaceLabel(tag, node); } }); /* TM.Label.HTML Custom extension of <Graph.Label.HTML>. Extends: All <Graph.Label.HTML> methods. See also: <Graph.Label.HTML> */ TM.Label.HTML = new Class( { Implements: Graph.Label.HTML, initialize: function(viz){ this.viz = viz; this.leaf = viz.leaf; this.config = viz.config; }, /* placeLabel Overrides abstract method placeLabel in <Graph.Plot>. Parameters: tag - A DOM label element. node - A <Graph.Node>. controller - A configuration/controller object passed to the visualization. */ placeLabel: function(tag, node, controller){ var pos = node.pos.getc(true), canvas = this.viz.canvas, ox = canvas.translateOffsetX, oy = canvas.translateOffsetY, sx = canvas.scaleOffsetX, sy = canvas.scaleOffsetY, radius = canvas.getSize(); var labelPos = { x: Math.round(pos.x * sx + ox + radius.width / 2), y: Math.round(pos.y * sy + oy + radius.height / 2) }; var style = tag.style; style.left = labelPos.x + 'px'; style.top = labelPos.y + 'px'; style.width = node.getData('width') * sx + 'px'; style.height = node.getData('height') * sy + 'px'; style.zIndex = node._depth * 100; style.display = ''; if(!this.leaf(node) && !this.config.titleHeight) { tag.style.display = 'none'; } controller.onPlaceLabel(tag, node); } }); /* Class: TM.Plot.NodeTypes This class contains a list of <Graph.Node> built-in types. Node types implemented are 'none', 'rectangle'. You can add your custom node types, customizing your visualization to the extreme. Example: (start code js) TM.Plot.NodeTypes.implement({ 'mySpecialType': { 'render': function(node, canvas) { //print your custom node to canvas }, //optional 'contains': function(node, pos) { //return true if pos is inside the node or false otherwise } } }); (end code) */ TM.Plot.NodeTypes = new Class( { 'none': { 'render': $.empty }, 'rectangle': { 'render': function(node, canvas, animating){ var leaf = this.viz.leaf(node), config = this.config, offst = config.offset, titleHeight = config.titleHeight, pos = node.pos.getc(true), width = node.getData('width'), height = node.getData('height'), border = node.getData('border'), ctx = canvas.getCtx(), posx = pos.x + offst / 2, posy = pos.y + offst / 2; if(width <= offst || height <= offst) return; if (leaf) { if(config.cushion) { var lg = ctx.createRadialGradient(posx + (width-offst)/2, posy + (height-offst)/2, 1, posx + (width-offst)/2, posy + (height-offst)/2, width < height? height : width); var color = node.getData('color'); var colorGrad = $.rgbToHex($.map($.hexToRgb(color), function(r) { return r * 0.2 >> 0; })); lg.addColorStop(0, color); lg.addColorStop(1, colorGrad); ctx.fillStyle = lg; } ctx.fillRect(posx, posy, width - offst, height - offst); if(border) { ctx.save(); ctx.strokeStyle = border; ctx.strokeRect(posx, posy, width - offst, height - offst); ctx.restore(); } } else if(titleHeight > 0){ ctx.fillRect(pos.x + offst / 2, pos.y + offst / 2, width - offst, titleHeight - offst); if(border) { ctx.save(); ctx.strokeStyle = border; ctx.strokeRect(pos.x + offst / 2, pos.y + offst / 2, width - offst, height - offst); ctx.restore(); } } }, 'contains': function(node, pos) { if(this.viz.clickedNode && !node.isDescendantOf(this.viz.clickedNode.id) || node.ignore) return false; var npos = node.pos.getc(true), width = node.getData('width'), leaf = this.viz.leaf(node), height = leaf? node.getData('height') : this.config.titleHeight; return this.nodeHelper.rectangle.contains({x: npos.x + width/2, y: npos.y + height/2}, pos, width, height); } } }); TM.Plot.EdgeTypes = new Class( { 'none': $.empty }); /* Class: TM.SliceAndDice A slice and dice TreeMap visualization. Implements: All <TM.Base> methods and properties. */ TM.SliceAndDice = new Class( { Implements: [ Loader, Extras, TM.Base, Layouts.TM.SliceAndDice ] }); /* Class: TM.Squarified A squarified TreeMap visualization. Implements: All <TM.Base> methods and properties. */ TM.Squarified = new Class( { Implements: [ Loader, Extras, TM.Base, Layouts.TM.Squarified ] }); /* Class: TM.Strip A strip TreeMap visualization. Implements: All <TM.Base> methods and properties. */ TM.Strip = new Class( { Implements: [ Loader, Extras, TM.Base, Layouts.TM.Strip ] }); /* * File: RGraph.js * */ /* Class: RGraph A radial graph visualization with advanced animations. Inspired by: Animated Exploration of Dynamic Graphs with Radial Layout (Ka-Ping Yee, Danyel Fisher, Rachna Dhamija, Marti Hearst) <http://bailando.sims.berkeley.edu/papers/infovis01.htm> Note: This visualization was built and engineered from scratch, taking only the paper as inspiration, and only shares some features with the visualization described in the paper. Implements: All <Loader> methods Constructor Options: Inherits options from - <Options.Canvas> - <Options.Controller> - <Options.Node> - <Options.Edge> - <Options.Label> - <Options.Events> - <Options.Tips> - <Options.NodeStyles> - <Options.Navigation> Additionally, there are other parameters and some default values changed interpolation - (string) Default's *linear*. Describes the way nodes are interpolated. Possible values are 'linear' and 'polar'. levelDistance - (number) Default's *100*. The distance between levels of the tree. Instance Properties: canvas - Access a <Canvas> instance. graph - Access a <Graph> instance. op - Access a <RGraph.Op> instance. fx - Access a <RGraph.Plot> instance. labels - Access a <RGraph.Label> interface implementation. */ $jit.RGraph = new Class( { Implements: [ Loader, Extras, Layouts.Radial ], initialize: function(controller){ var $RGraph = $jit.RGraph; var config = { interpolation: 'linear', levelDistance: 100 }; this.controller = this.config = $.merge(Options("Canvas", "Node", "Edge", "Fx", "Controller", "Tips", "NodeStyles", "Events", "Navigation", "Label"), config, controller); var canvasConfig = this.config; if(canvasConfig.useCanvas) { this.canvas = canvasConfig.useCanvas; this.config.labelContainer = this.canvas.id + '-label'; } else { if(canvasConfig.background) { canvasConfig.background = $.merge({ type: 'Circles' }, canvasConfig.background); } this.canvas = new Canvas(this, canvasConfig); this.config.labelContainer = (typeof canvasConfig.injectInto == 'string'? canvasConfig.injectInto : canvasConfig.injectInto.id) + '-label'; } this.graphOptions = { 'complex': false, 'Node': { 'selected': false, 'exist': true, 'drawn': true } }; this.graph = new Graph(this.graphOptions, this.config.Node, this.config.Edge); this.labels = new $RGraph.Label[canvasConfig.Label.type](this); this.fx = new $RGraph.Plot(this, $RGraph); this.op = new $RGraph.Op(this); this.json = null; this.root = null; this.busy = false; this.parent = false; // initialize extras this.initializeExtras(); }, /* createLevelDistanceFunc Returns the levelDistance function used for calculating a node distance to its origin. This function returns a function that is computed per level and not per node, such that all nodes with the same depth will have the same distance to the origin. The resulting function gets the parent node as parameter and returns a float. */ createLevelDistanceFunc: function(){ var ld = this.config.levelDistance; return function(elem){ return (elem._depth + 1) * ld; }; }, /* Method: refresh Computes positions and plots the tree. */ refresh: function(){ this.compute(); this.plot(); }, reposition: function(){ this.compute('end'); }, /* Method: plot Plots the RGraph. This is a shortcut to *fx.plot*. */ plot: function(){ this.fx.plot(); }, /* getNodeAndParentAngle Returns the _parent_ of the given node, also calculating its angle span. */ getNodeAndParentAngle: function(id){ var theta = false; var n = this.graph.getNode(id); var ps = n.getParents(); var p = (ps.length > 0)? ps[0] : false; if (p) { var posParent = p.pos.getc(), posChild = n.pos.getc(); var newPos = posParent.add(posChild.scale(-1)); theta = Math.atan2(newPos.y, newPos.x); if (theta < 0) theta += 2 * Math.PI; } return { parent: p, theta: theta }; }, /* tagChildren Enumerates the children in order to maintain child ordering (second constraint of the paper). */ tagChildren: function(par, id){ if (par.angleSpan) { var adjs = []; par.eachAdjacency(function(elem){ adjs.push(elem.nodeTo); }, "ignore"); var len = adjs.length; for ( var i = 0; i < len && id != adjs[i].id; i++) ; for ( var j = (i + 1) % len, k = 0; id != adjs[j].id; j = (j + 1) % len) { adjs[j].dist = k++; } } }, /* Method: onClick Animates the <RGraph> to center the node specified by *id*. Parameters: id - A <Graph.Node> id. opt - (optional|object) An object containing some extra properties described below hideLabels - (boolean) Default's *true*. Hide labels when performing the animation. Example: (start code js) rgraph.onClick('someid'); //or also... rgraph.onClick('someid', { hideLabels: false }); (end code) */ onClick: function(id, opt){ if (this.root != id && !this.busy) { this.busy = true; this.root = id; that = this; this.controller.onBeforeCompute(this.graph.getNode(id)); var obj = this.getNodeAndParentAngle(id); // second constraint this.tagChildren(obj.parent, id); this.parent = obj.parent; this.compute('end'); // first constraint var thetaDiff = obj.theta - obj.parent.endPos.theta; this.graph.eachNode(function(elem){ elem.endPos.set(elem.endPos.getp().add($P(thetaDiff, 0))); }); var mode = this.config.interpolation; opt = $.merge( { onComplete: $.empty }, opt || {}); this.fx.animate($.merge( { hideLabels: true, modes: [ mode ] }, opt, { onComplete: function(){ that.busy = false; opt.onComplete(); } })); } } }); $jit.RGraph.$extend = true; (function(RGraph){ /* Class: RGraph.Op Custom extension of <Graph.Op>. Extends: All <Graph.Op> methods See also: <Graph.Op> */ RGraph.Op = new Class( { Implements: Graph.Op }); /* Class: RGraph.Plot Custom extension of <Graph.Plot>. Extends: All <Graph.Plot> methods See also: <Graph.Plot> */ RGraph.Plot = new Class( { Implements: Graph.Plot }); /* Object: RGraph.Label Custom extension of <Graph.Label>. Contains custom <Graph.Label.SVG>, <Graph.Label.HTML> and <Graph.Label.Native> extensions. Extends: All <Graph.Label> methods and subclasses. See also: <Graph.Label>, <Graph.Label.Native>, <Graph.Label.HTML>, <Graph.Label.SVG>. */ RGraph.Label = {}; /* RGraph.Label.Native Custom extension of <Graph.Label.Native>. Extends: All <Graph.Label.Native> methods See also: <Graph.Label.Native> */ RGraph.Label.Native = new Class( { Implements: Graph.Label.Native }); /* RGraph.Label.SVG Custom extension of <Graph.Label.SVG>. Extends: All <Graph.Label.SVG> methods See also: <Graph.Label.SVG> */ RGraph.Label.SVG = new Class( { Implements: Graph.Label.SVG, initialize: function(viz){ this.viz = viz; }, /* placeLabel Overrides abstract method placeLabel in <Graph.Plot>. Parameters: tag - A DOM label element. node - A <Graph.Node>. controller - A configuration/controller object passed to the visualization. */ placeLabel: function(tag, node, controller){ var pos = node.pos.getc(true), canvas = this.viz.canvas, ox = canvas.translateOffsetX, oy = canvas.translateOffsetY, sx = canvas.scaleOffsetX, sy = canvas.scaleOffsetY, radius = canvas.getSize(); var labelPos = { x: Math.round(pos.x * sx + ox + radius.width / 2), y: Math.round(pos.y * sy + oy + radius.height / 2) }; tag.setAttribute('x', labelPos.x); tag.setAttribute('y', labelPos.y); controller.onPlaceLabel(tag, node); } }); /* RGraph.Label.HTML Custom extension of <Graph.Label.HTML>. Extends: All <Graph.Label.HTML> methods. See also: <Graph.Label.HTML> */ RGraph.Label.HTML = new Class( { Implements: Graph.Label.HTML, initialize: function(viz){ this.viz = viz; }, /* placeLabel Overrides abstract method placeLabel in <Graph.Plot>. Parameters: tag - A DOM label element. node - A <Graph.Node>. controller - A configuration/controller object passed to the visualization. */ placeLabel: function(tag, node, controller){ var pos = node.pos.getc(true), canvas = this.viz.canvas, ox = canvas.translateOffsetX, oy = canvas.translateOffsetY, sx = canvas.scaleOffsetX, sy = canvas.scaleOffsetY, radius = canvas.getSize(); var labelPos = { x: Math.round(pos.x * sx + ox + radius.width / 2), y: Math.round(pos.y * sy + oy + radius.height / 2) }; var style = tag.style; style.left = labelPos.x + 'px'; style.top = labelPos.y + 'px'; style.display = this.fitsInCanvas(labelPos, canvas)? '' : 'none'; controller.onPlaceLabel(tag, node); } }); /* Class: RGraph.Plot.NodeTypes This class contains a list of <Graph.Node> built-in types. Node types implemented are 'none', 'circle', 'triangle', 'rectangle', 'star', 'ellipse' and 'square'. You can add your custom node types, customizing your visualization to the extreme. Example: (start code js) RGraph.Plot.NodeTypes.implement({ 'mySpecialType': { 'render': function(node, canvas) { //print your custom node to canvas }, //optional 'contains': function(node, pos) { //return true if pos is inside the node or false otherwise } } }); (end code) */ RGraph.Plot.NodeTypes = new Class({ 'none': { 'render': $.empty, 'contains': $.lambda(false) }, 'circle': { 'render': function(node, canvas){ var pos = node.pos.getc(true), dim = node.getData('dim'); this.nodeHelper.circle.render('fill', pos, dim, canvas); }, 'contains': function(node, pos){ var npos = node.pos.getc(true), dim = node.getData('dim'); return this.nodeHelper.circle.contains(npos, pos, dim); } }, 'ellipse': { 'render': function(node, canvas){ var pos = node.pos.getc(true), width = node.getData('width'), height = node.getData('height'); this.nodeHelper.ellipse.render('fill', pos, width, height, canvas); }, // TODO(nico): be more precise... 'contains': function(node, pos){ var npos = node.pos.getc(true), width = node.getData('width'), height = node.getData('height'); return this.nodeHelper.ellipse.contains(npos, pos, width, height); } }, 'square': { 'render': function(node, canvas){ var pos = node.pos.getc(true), dim = node.getData('dim'); this.nodeHelper.square.render('fill', pos, dim, canvas); }, 'contains': function(node, pos){ var npos = node.pos.getc(true), dim = node.getData('dim'); return this.nodeHelper.square.contains(npos, pos, dim); } }, 'rectangle': { 'render': function(node, canvas){ var pos = node.pos.getc(true), width = node.getData('width'), height = node.getData('height'); this.nodeHelper.rectangle.render('fill', pos, width, height, canvas); }, 'contains': function(node, pos){ var npos = node.pos.getc(true), width = node.getData('width'), height = node.getData('height'); return this.nodeHelper.rectangle.contains(npos, pos, width, height); } }, 'triangle': { 'render': function(node, canvas){ var pos = node.pos.getc(true), dim = node.getData('dim'); this.nodeHelper.triangle.render('fill', pos, dim, canvas); }, 'contains': function(node, pos) { var npos = node.pos.getc(true), dim = node.getData('dim'); return this.nodeHelper.triangle.contains(npos, pos, dim); } }, 'star': { 'render': function(node, canvas){ var pos = node.pos.getc(true), dim = node.getData('dim'); this.nodeHelper.star.render('fill', pos, dim, canvas); }, 'contains': function(node, pos) { var npos = node.pos.getc(true), dim = node.getData('dim'); return this.nodeHelper.star.contains(npos, pos, dim); } } }); /* Class: RGraph.Plot.EdgeTypes This class contains a list of <Graph.Adjacence> built-in types. Edge types implemented are 'none', 'line' and 'arrow'. You can add your custom edge types, customizing your visualization to the extreme. Example: (start code js) RGraph.Plot.EdgeTypes.implement({ 'mySpecialType': { 'render': function(adj, canvas) { //print your custom edge to canvas }, //optional 'contains': function(adj, pos) { //return true if pos is inside the arc or false otherwise } } }); (end code) */ RGraph.Plot.EdgeTypes = new Class({ 'none': $.empty, 'line': { 'render': function(adj, canvas) { var from = adj.nodeFrom.pos.getc(true), to = adj.nodeTo.pos.getc(true); this.edgeHelper.line.render(from, to, canvas); }, 'contains': function(adj, pos) { var from = adj.nodeFrom.pos.getc(true), to = adj.nodeTo.pos.getc(true); return this.edgeHelper.line.contains(from, to, pos, this.edge.epsilon); } }, 'arrow': { 'render': function(adj, canvas) { var from = adj.nodeFrom.pos.getc(true), to = adj.nodeTo.pos.getc(true), dim = adj.getData('dim'), direction = adj.data.$direction, inv = (direction && direction.length>1 && direction[0] != adj.nodeFrom.id); this.edgeHelper.arrow.render(from, to, dim, inv, canvas); }, 'contains': function(adj, pos) { var from = adj.nodeFrom.pos.getc(true), to = adj.nodeTo.pos.getc(true); return this.edgeHelper.arrow.contains(from, to, pos, this.edge.epsilon); } } }); })($jit.RGraph); /* * File: Hypertree.js * */ /* Complex A multi-purpose Complex Class with common methods. Extended for the Hypertree. */ /* moebiusTransformation Calculates a moebius transformation for this point / complex. For more information go to: http://en.wikipedia.org/wiki/Moebius_transformation. Parameters: c - An initialized Complex instance representing a translation Vector. */ Complex.prototype.moebiusTransformation = function(c) { var num = this.add(c); var den = c.$conjugate().$prod(this); den.x++; return num.$div(den); }; /* moebiusTransformation Calculates a moebius transformation for the hyperbolic tree. <http://en.wikipedia.org/wiki/Moebius_transformation> Parameters: graph - A <Graph> instance. pos - A <Complex>. prop - A property array. theta - Rotation angle. startPos - _optional_ start position. */ Graph.Util.moebiusTransformation = function(graph, pos, prop, startPos, flags) { this.eachNode(graph, function(elem) { for ( var i = 0; i < prop.length; i++) { var p = pos[i].scale(-1), property = startPos ? startPos : prop[i]; elem.getPos(prop[i]).set(elem.getPos(property).getc().moebiusTransformation(p)); } }, flags); }; /* Class: Hypertree A Hyperbolic Tree/Graph visualization. Inspired by: A Focus+Context Technique Based on Hyperbolic Geometry for Visualizing Large Hierarchies (John Lamping, Ramana Rao, and Peter Pirolli). <http://www.cs.tau.ac.il/~asharf/shrek/Projects/HypBrowser/startree-chi95.pdf> Note: This visualization was built and engineered from scratch, taking only the paper as inspiration, and only shares some features with the Hypertree described in the paper. Implements: All <Loader> methods Constructor Options: Inherits options from - <Options.Canvas> - <Options.Controller> - <Options.Node> - <Options.Edge> - <Options.Label> - <Options.Events> - <Options.Tips> - <Options.NodeStyles> - <Options.Navigation> Additionally, there are other parameters and some default values changed radius - (string|number) Default's *auto*. The radius of the disc to plot the <Hypertree> in. 'auto' will take the smaller value from the width and height canvas dimensions. You can also set this to a custom value, for example *250*. offset - (number) Default's *0*. A number in the range [0, 1) that will be substracted to each node position to make a more compact <Hypertree>. This will avoid placing nodes too far from each other when a there's a selected node. fps - Described in <Options.Fx>. It's default value has been changed to *35*. duration - Described in <Options.Fx>. It's default value has been changed to *1500*. Edge.type - Described in <Options.Edge>. It's default value has been changed to *hyperline*. Instance Properties: canvas - Access a <Canvas> instance. graph - Access a <Graph> instance. op - Access a <Hypertree.Op> instance. fx - Access a <Hypertree.Plot> instance. labels - Access a <Hypertree.Label> interface implementation. */ $jit.Hypertree = new Class( { Implements: [ Loader, Extras, Layouts.Radial ], initialize: function(controller) { var $Hypertree = $jit.Hypertree; var config = { radius: "auto", offset: 0, Edge: { type: 'hyperline' }, duration: 1500, fps: 35 }; this.controller = this.config = $.merge(Options("Canvas", "Node", "Edge", "Fx", "Tips", "NodeStyles", "Events", "Navigation", "Controller", "Label"), config, controller); var canvasConfig = this.config; if(canvasConfig.useCanvas) { this.canvas = canvasConfig.useCanvas; this.config.labelContainer = this.canvas.id + '-label'; } else { if(canvasConfig.background) { canvasConfig.background = $.merge({ type: 'Circles' }, canvasConfig.background); } this.canvas = new Canvas(this, canvasConfig); this.config.labelContainer = (typeof canvasConfig.injectInto == 'string'? canvasConfig.injectInto : canvasConfig.injectInto.id) + '-label'; } this.graphOptions = { 'complex': false, 'Node': { 'selected': false, 'exist': true, 'drawn': true } }; this.graph = new Graph(this.graphOptions, this.config.Node, this.config.Edge); this.labels = new $Hypertree.Label[canvasConfig.Label.type](this); this.fx = new $Hypertree.Plot(this, $Hypertree); this.op = new $Hypertree.Op(this); this.json = null; this.root = null; this.busy = false; // initialize extras this.initializeExtras(); }, /* createLevelDistanceFunc Returns the levelDistance function used for calculating a node distance to its origin. This function returns a function that is computed per level and not per node, such that all nodes with the same depth will have the same distance to the origin. The resulting function gets the parent node as parameter and returns a float. */ createLevelDistanceFunc: function() { // get max viz. length. var r = this.getRadius(); // get max depth. var depth = 0, max = Math.max, config = this.config; this.graph.eachNode(function(node) { depth = max(node._depth, depth); }, "ignore"); depth++; // node distance generator var genDistFunc = function(a) { return function(node) { node.scale = r; var d = node._depth + 1; var acum = 0, pow = Math.pow; while (d) { acum += pow(a, d--); } return acum - config.offset; }; }; // estimate better edge length. for ( var i = 0.51; i <= 1; i += 0.01) { var valSeries = (1 - Math.pow(i, depth)) / (1 - i); if (valSeries >= 2) { return genDistFunc(i - 0.01); } } return genDistFunc(0.75); }, /* Method: getRadius Returns the current radius of the visualization. If *config.radius* is *auto* then it calculates the radius by taking the smaller size of the <Canvas> widget. See also: <Canvas.getSize> */ getRadius: function() { var rad = this.config.radius; if (rad !== "auto") { return rad; } var s = this.canvas.getSize(); return Math.min(s.width, s.height) / 2; }, /* Method: refresh Computes positions and plots the tree. Parameters: reposition - (optional|boolean) Set this to *true* to force all positions (current, start, end) to match. */ refresh: function(reposition) { if (reposition) { this.reposition(); this.graph.eachNode(function(node) { node.startPos.rho = node.pos.rho = node.endPos.rho; node.startPos.theta = node.pos.theta = node.endPos.theta; }); } else { this.compute(); } this.plot(); }, /* reposition Computes nodes' positions and restores the tree to its previous position. For calculating nodes' positions the root must be placed on its origin. This method does this and then attemps to restore the hypertree to its previous position. */ reposition: function() { this.compute('end'); var vector = this.graph.getNode(this.root).pos.getc().scale(-1); Graph.Util.moebiusTransformation(this.graph, [ vector ], [ 'end' ], 'end', "ignore"); this.graph.eachNode(function(node) { if (node.ignore) { node.endPos.rho = node.pos.rho; node.endPos.theta = node.pos.theta; } }); }, /* Method: plot Plots the <Hypertree>. This is a shortcut to *fx.plot*. */ plot: function() { this.fx.plot(); }, /* Method: onClick Animates the <Hypertree> to center the node specified by *id*. Parameters: id - A <Graph.Node> id. opt - (optional|object) An object containing some extra properties described below hideLabels - (boolean) Default's *true*. Hide labels when performing the animation. Example: (start code js) ht.onClick('someid'); //or also... ht.onClick('someid', { hideLabels: false }); (end code) */ onClick: function(id, opt) { var pos = this.graph.getNode(id).pos.getc(true); this.move(pos, opt); }, /* Method: move Translates the tree to the given position. Parameters: pos - (object) A *x, y* coordinate object where x, y in [0, 1), to move the tree to. opt - This object has been defined in <Hypertree.onClick> Example: (start code js) ht.move({ x: 0, y: 0.7 }, { hideLabels: false }); (end code) */ move: function(pos, opt) { var versor = $C(pos.x, pos.y); if (this.busy === false && versor.norm() < 1) { this.busy = true; var root = this.graph.getClosestNodeToPos(versor), that = this; this.graph.computeLevels(root.id, 0); this.controller.onBeforeCompute(root); opt = $.merge( { onComplete: $.empty }, opt || {}); this.fx.animate($.merge( { modes: [ 'moebius' ], hideLabels: true }, opt, { onComplete: function() { that.busy = false; opt.onComplete(); } }), versor); } } }); $jit.Hypertree.$extend = true; (function(Hypertree) { /* Class: Hypertree.Op Custom extension of <Graph.Op>. Extends: All <Graph.Op> methods See also: <Graph.Op> */ Hypertree.Op = new Class( { Implements: Graph.Op }); /* Class: Hypertree.Plot Custom extension of <Graph.Plot>. Extends: All <Graph.Plot> methods See also: <Graph.Plot> */ Hypertree.Plot = new Class( { Implements: Graph.Plot }); /* Object: Hypertree.Label Custom extension of <Graph.Label>. Contains custom <Graph.Label.SVG>, <Graph.Label.HTML> and <Graph.Label.Native> extensions. Extends: All <Graph.Label> methods and subclasses. See also: <Graph.Label>, <Graph.Label.Native>, <Graph.Label.HTML>, <Graph.Label.SVG>. */ Hypertree.Label = {}; /* Hypertree.Label.Native Custom extension of <Graph.Label.Native>. Extends: All <Graph.Label.Native> methods See also: <Graph.Label.Native> */ Hypertree.Label.Native = new Class( { Implements: Graph.Label.Native, initialize: function(viz) { this.viz = viz; }, renderLabel: function(canvas, node, controller) { var ctx = canvas.getCtx(); var coord = node.pos.getc(true); var s = this.viz.getRadius(); ctx.fillText(node.name, coord.x * s, coord.y * s); } }); /* Hypertree.Label.SVG Custom extension of <Graph.Label.SVG>. Extends: All <Graph.Label.SVG> methods See also: <Graph.Label.SVG> */ Hypertree.Label.SVG = new Class( { Implements: Graph.Label.SVG, initialize: function(viz) { this.viz = viz; }, /* placeLabel Overrides abstract method placeLabel in <Graph.Plot>. Parameters: tag - A DOM label element. node - A <Graph.Node>. controller - A configuration/controller object passed to the visualization. */ placeLabel: function(tag, node, controller) { var pos = node.pos.getc(true), canvas = this.viz.canvas, ox = canvas.translateOffsetX, oy = canvas.translateOffsetY, sx = canvas.scaleOffsetX, sy = canvas.scaleOffsetY, radius = canvas.getSize(), r = this.viz.getRadius(); var labelPos = { x: Math.round((pos.x * sx) * r + ox + radius.width / 2), y: Math.round((pos.y * sy) * r + oy + radius.height / 2) }; tag.setAttribute('x', labelPos.x); tag.setAttribute('y', labelPos.y); controller.onPlaceLabel(tag, node); } }); /* Hypertree.Label.HTML Custom extension of <Graph.Label.HTML>. Extends: All <Graph.Label.HTML> methods. See also: <Graph.Label.HTML> */ Hypertree.Label.HTML = new Class( { Implements: Graph.Label.HTML, initialize: function(viz) { this.viz = viz; }, /* placeLabel Overrides abstract method placeLabel in <Graph.Plot>. Parameters: tag - A DOM label element. node - A <Graph.Node>. controller - A configuration/controller object passed to the visualization. */ placeLabel: function(tag, node, controller) { var pos = node.pos.getc(true), canvas = this.viz.canvas, ox = canvas.translateOffsetX, oy = canvas.translateOffsetY, sx = canvas.scaleOffsetX, sy = canvas.scaleOffsetY, radius = canvas.getSize(), r = this.viz.getRadius(); var labelPos = { x: Math.round((pos.x * sx) * r + ox + radius.width / 2), y: Math.round((pos.y * sy) * r + oy + radius.height / 2) }; var style = tag.style; style.left = labelPos.x + 'px'; style.top = labelPos.y + 'px'; style.display = this.fitsInCanvas(labelPos, canvas) ? '' : 'none'; controller.onPlaceLabel(tag, node); } }); /* Class: Hypertree.Plot.NodeTypes This class contains a list of <Graph.Node> built-in types. Node types implemented are 'none', 'circle', 'triangle', 'rectangle', 'star', 'ellipse' and 'square'. You can add your custom node types, customizing your visualization to the extreme. Example: (start code js) Hypertree.Plot.NodeTypes.implement({ 'mySpecialType': { 'render': function(node, canvas) { //print your custom node to canvas }, //optional 'contains': function(node, pos) { //return true if pos is inside the node or false otherwise } } }); (end code) */ Hypertree.Plot.NodeTypes = new Class({ 'none': { 'render': $.empty, 'contains': $.lambda(false) }, 'circle': { 'render': function(node, canvas) { var nconfig = this.node, dim = node.getData('dim'), p = node.pos.getc(); dim = nconfig.transform? dim * (1 - p.squaredNorm()) : dim; p.$scale(node.scale); if (dim > 0.2) { this.nodeHelper.circle.render('fill', p, dim, canvas); } }, 'contains': function(node, pos) { var dim = node.getData('dim'), npos = node.pos.getc().$scale(node.scale); return this.nodeHelper.circle.contains(npos, pos, dim); } }, 'ellipse': { 'render': function(node, canvas) { var pos = node.pos.getc().$scale(node.scale), width = node.getData('width'), height = node.getData('height'); this.nodeHelper.ellipse.render('fill', pos, width, height, canvas); }, 'contains': function(node, pos) { var width = node.getData('width'), height = node.getData('height'), npos = node.pos.getc().$scale(node.scale); return this.nodeHelper.circle.contains(npos, pos, width, height); } }, 'square': { 'render': function(node, canvas) { var nconfig = this.node, dim = node.getData('dim'), p = node.pos.getc(); dim = nconfig.transform? dim * (1 - p.squaredNorm()) : dim; p.$scale(node.scale); if (dim > 0.2) { this.nodeHelper.square.render('fill', p, dim, canvas); } }, 'contains': function(node, pos) { var dim = node.getData('dim'), npos = node.pos.getc().$scale(node.scale); return this.nodeHelper.square.contains(npos, pos, dim); } }, 'rectangle': { 'render': function(node, canvas) { var nconfig = this.node, width = node.getData('width'), height = node.getData('height'), pos = node.pos.getc(); width = nconfig.transform? width * (1 - pos.squaredNorm()) : width; height = nconfig.transform? height * (1 - pos.squaredNorm()) : height; pos.$scale(node.scale); if (width > 0.2 && height > 0.2) { this.nodeHelper.rectangle.render('fill', pos, width, height, canvas); } }, 'contains': function(node, pos) { var width = node.getData('width'), height = node.getData('height'), npos = node.pos.getc().$scale(node.scale); return this.nodeHelper.square.contains(npos, pos, width, height); } }, 'triangle': { 'render': function(node, canvas) { var nconfig = this.node, dim = node.getData('dim'), p = node.pos.getc(); dim = nconfig.transform? dim * (1 - p.squaredNorm()) : dim; p.$scale(node.scale); if (dim > 0.2) { this.nodeHelper.triangle.render('fill', p, dim, canvas); } }, 'contains': function(node, pos) { var dim = node.getData('dim'), npos = node.pos.getc().$scale(node.scale); return this.nodeHelper.triangle.contains(npos, pos, dim); } }, 'star': { 'render': function(node, canvas) { var nconfig = this.node, dim = node.getData('dim'), p = node.pos.getc(); dim = nconfig.transform? dim * (1 - p.squaredNorm()) : dim; p.$scale(node.scale); if (dim > 0.2) { this.nodeHelper.star.render('fill', p, dim, canvas); } }, 'contains': function(node, pos) { var dim = node.getData('dim'), npos = node.pos.getc().$scale(node.scale); return this.nodeHelper.star.contains(npos, pos, dim); } } }); /* Class: Hypertree.Plot.EdgeTypes This class contains a list of <Graph.Adjacence> built-in types. Edge types implemented are 'none', 'line', 'arrow' and 'hyperline'. You can add your custom edge types, customizing your visualization to the extreme. Example: (start code js) Hypertree.Plot.EdgeTypes.implement({ 'mySpecialType': { 'render': function(adj, canvas) { //print your custom edge to canvas }, //optional 'contains': function(adj, pos) { //return true if pos is inside the arc or false otherwise } } }); (end code) */ Hypertree.Plot.EdgeTypes = new Class({ 'none': $.empty, 'line': { 'render': function(adj, canvas) { var from = adj.nodeFrom.pos.getc(true), to = adj.nodeTo.pos.getc(true), r = adj.nodeFrom.scale; this.edgeHelper.line.render({x:from.x*r, y:from.y*r}, {x:to.x*r, y:to.y*r}, canvas); }, 'contains': function(adj, pos) { var from = adj.nodeFrom.pos.getc(true), to = adj.nodeTo.pos.getc(true), r = adj.nodeFrom.scale; this.edgeHelper.line.contains({x:from.x*r, y:from.y*r}, {x:to.x*r, y:to.y*r}, pos, this.edge.epsilon); } }, 'arrow': { 'render': function(adj, canvas) { var from = adj.nodeFrom.pos.getc(true), to = adj.nodeTo.pos.getc(true), r = adj.nodeFrom.scale, dim = adj.getData('dim'), direction = adj.data.$direction, inv = (direction && direction.length>1 && direction[0] != adj.nodeFrom.id); this.edgeHelper.arrow.render({x:from.x*r, y:from.y*r}, {x:to.x*r, y:to.y*r}, dim, inv, canvas); }, 'contains': function(adj, pos) { var from = adj.nodeFrom.pos.getc(true), to = adj.nodeTo.pos.getc(true), r = adj.nodeFrom.scale; this.edgeHelper.arrow.contains({x:from.x*r, y:from.y*r}, {x:to.x*r, y:to.y*r}, pos, this.edge.epsilon); } }, 'hyperline': { 'render': function(adj, canvas) { var from = adj.nodeFrom.pos.getc(), to = adj.nodeTo.pos.getc(), dim = this.viz.getRadius(); this.edgeHelper.hyperline.render(from, to, dim, canvas); }, 'contains': $.lambda(false) } }); })($jit.Hypertree); })();
import React from 'react'; import Anchor from './Anchor'; import Subtitle from './Subtitle'; import Title from './Title'; import Wrapper from './Wrapper'; function Header() { return ( <Wrapper> <Title>Random Quote Machine</Title> <Subtitle> Welcome! Enjoy these cool random quotes below - using the{' '} <Anchor>Forismatic API.</Anchor> </Subtitle> </Wrapper> ); } export default Header;
function trim(sString) { sTrimmedString = ""; if (sString != "") { var iStart = 0; var iEnd = sString.length - 1; var sWhitespace = " \t\f\n\r"; while (sWhitespace.indexOf(sString.charAt(iStart)) != -1) { iStart++; if (iStart > iEnd) break; } // If the string not just whitespace if (iStart <= iEnd) { while (sWhitespace.indexOf(sString.charAt(iEnd)) != -1) iEnd--; sTrimmedString = sString.substring(iStart,++iEnd); } } return sTrimmedString; } function trim_final(sString) { var iStart = 0; var i = 0; var fTrimmedString = ""; var iEnd = sString.length - 1; var sWhitespace = " \t\f\n\r"; for(iStart=0;iStart <= iEnd;iStart++) { if(sWhitespace.indexOf(sString.charAt(iStart)) != -1) { i++; } else { i = 0; } if(i <2) { fTrimmedString = fTrimmedString + sString.charAt(iStart); } } return fTrimmedString; } // milind_pingale@hotmail.com function check_space(sString) { if (sString != "") { var iStart = 0; var iEnd = sString.length - 1; var sWhitespace = " \t\f\n\r"; for(iStart=0;iStart <= iEnd;iStart++) { if(sWhitespace.indexOf(sString.charAt(iStart)) != -1) { alert("Remove white space from title, title must be single word"); return false; } } return true; } } //check numeric value for float function check_float(sString) { if(!sString.match(/^[0-9]*[\.]{0,1}[0-9]{0,2}$/i)) { return false; } else { if(sString.length == 0) return false; else return true; } } //check numeric value integer function check_integer(sString) { if(!sString.match(/^[0-9]*$/i)) { return false; } else { if(sString.length == 0) return false; else return true; } } function isValidEmail(str) { var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/; if(reg.test(str) == false) { return false; } return true; }
// ---------------------------------------------------------------------------- // File Developer: Peter Pak // Description: Script for accounts UI to use usernames instead of emails // ---------------------------------------------------------------------------- // Package Imports ------------------------------------------------------------ import { Accounts } from 'meteor/accounts-base'; // ---------------------------------------------------------------------------- Accounts.ui.config({ passwordSignupFields: 'USERNAME_ONLY', });
import mongoose from '../db/mongoose'; export default mongoose.model('Product', new mongoose.Schema({ id: {type: Number, required: true}, name: {type: String, required: true}, brand: {type: String, required: true}, price: {type: Number, required: true, min: 0}, reviews: [{ author: {type: String}, review: {type: String} }], lastModifiedDate: {type: Date, default: Date.now} }));
/** * Implement Gatsby's SSR (Server Side Rendering) APIs in this file. * * See: https://www.gatsbyjs.org/docs/ssr-apis/ */ // You can delete this file if you're not using it import React from 'react' import { renderToString } from 'react-dom/server' import { ServerStyleSheet } from 'styled-components' import ThemeProvider from './src/store/providers/themeProvider' export const replaceRenderer = ({ bodyComponent, replaceBodyHTMLString, setHeadComponents, }) => { // React Context in SSR/build const ConnectedBody = () => <ThemeProvider>{bodyComponent}</ThemeProvider> replaceBodyHTMLString(renderToString(<ConnectedBody />)) // Add styled-components in SSR/build const sheet = new ServerStyleSheet() const bodyHTML = renderToString(sheet.collectStyles(<ConnectedBody />)) const styleElement = sheet.getStyleElement() setHeadComponents(styleElement) }
module.exports = { rules: { // enforce line breaks after opening and before closing array brackets // https://eslint.org/docs/rules/array-bracket-newline // TODO: enable? semver-major 'array-bracket-newline': ['off', 'consistent'], // object option alternative: { multiline: true, minItems: 3 } // enforce line breaks between array elements // https://eslint.org/docs/rules/array-element-newline // TODO: enable? semver-major 'array-element-newline': ['off', { multiline: true, minItems: 3 }], // enforce spacing inside array brackets 'array-bracket-spacing': ['error', 'never'], // enforce spacing inside single-line blocks // https://eslint.org/docs/rules/block-spacing 'block-spacing': ['error', 'always'], // enforce one true brace style 'brace-style': ['error', '1tbs', { allowSingleLine: true }], // require camel case names camelcase: ['error', { properties: 'never', ignoreDestructuring: false }], // enforce or disallow capitalization of the first letter of a comment // https://eslint.org/docs/rules/capitalized-comments 'capitalized-comments': ['off', 'never', { line: { ignorePattern: '.*', ignoreInlineComments: true, ignoreConsecutiveComments: true, }, block: { ignorePattern: '.*', ignoreInlineComments: true, ignoreConsecutiveComments: true, }, }], // require trailing commas in multiline object literals 'comma-dangle': ['error', { arrays: 'always-multiline', objects: 'always-multiline', imports: 'always-multiline', exports: 'always-multiline', functions: 'always-multiline', }], // enforce spacing before and after comma 'comma-spacing': ['error', { before: false, after: true }], // enforce one true comma style 'comma-style': ['error', 'last', { exceptions: { ArrayExpression: false, ArrayPattern: false, ArrowFunctionExpression: false, CallExpression: false, FunctionDeclaration: false, FunctionExpression: false, ImportDeclaration: false, ObjectExpression: false, ObjectPattern: false, VariableDeclaration: false, NewExpression: false, } }], // disallow padding inside computed properties 'computed-property-spacing': ['error', 'never'], // enforces consistent naming when capturing the current execution context 'consistent-this': 'off', // enforce newline at the end of file, with no multiple empty lines 'eol-last': ['error', 'always'], // https://eslint.org/docs/rules/function-call-argument-newline // TODO: enable, semver-minor, once eslint v6.2 is required (which is a major) 'function-call-argument-newline': ['off', 'consistent'], // enforce spacing between functions and their invocations // https://eslint.org/docs/rules/func-call-spacing 'func-call-spacing': ['error', 'never'], // requires function names to match the name of the variable or property to which they are // assigned // https://eslint.org/docs/rules/func-name-matching 'func-name-matching': ['off', 'always', { includeCommonJSModuleExports: false, considerPropertyDescriptor: true, }], // require function expressions to have a name // https://eslint.org/docs/rules/func-names 'func-names': 'warn', // enforces use of function declarations or expressions // https://eslint.org/docs/rules/func-style // TODO: enable 'func-style': ['off', 'expression'], // enforce consistent line breaks inside function parentheses // https://eslint.org/docs/rules/function-paren-newline 'function-paren-newline': ['error', 'consistent'], // Blacklist certain identifiers to prevent them being used // https://eslint.org/docs/rules/id-blacklist 'id-blacklist': 'off', // this option enforces minimum and maximum identifier lengths // (variable names, property names etc.) 'id-length': 'off', // require identifiers to match the provided regular expression 'id-match': 'off', // Enforce the location of arrow function bodies with implicit returns // https://eslint.org/docs/rules/implicit-arrow-linebreak 'implicit-arrow-linebreak': ['error', 'beside'], // this option sets a specific tab width for your code // https://eslint.org/docs/rules/indent indent: ['error', 2, { SwitchCase: 1, VariableDeclarator: 1, outerIIFEBody: 1, // MemberExpression: null, FunctionDeclaration: { parameters: 1, body: 1 }, FunctionExpression: { parameters: 1, body: 1 }, CallExpression: { arguments: 1 }, ArrayExpression: 1, ObjectExpression: 1, ImportDeclaration: 1, flatTernaryExpressions: false, // list derived from https://github.com/benjamn/ast-types/blob/HEAD/def/jsx.js ignoredNodes: ['JSXElement', 'JSXElement > *', 'JSXAttribute', 'JSXIdentifier', 'JSXNamespacedName', 'JSXMemberExpression', 'JSXSpreadAttribute', 'JSXExpressionContainer', 'JSXOpeningElement', 'JSXClosingElement', 'JSXFragment', 'JSXOpeningFragment', 'JSXClosingFragment', 'JSXText', 'JSXEmptyExpression', 'JSXSpreadChild'], ignoreComments: false }], // specify whether double or single quotes should be used in JSX attributes // https://eslint.org/docs/rules/jsx-quotes 'jsx-quotes': ['off', 'prefer-double'], // enforces spacing between keys and values in object literal properties 'key-spacing': ['error', { beforeColon: false, afterColon: true }], // require a space before & after certain keywords 'keyword-spacing': ['error', { before: true, after: true, overrides: { return: { after: true }, throw: { after: true }, case: { after: true } } }], // enforce position of line comments // https://eslint.org/docs/rules/line-comment-position // TODO: enable? 'line-comment-position': ['off', { position: 'above', ignorePattern: '', applyDefaultPatterns: true, }], // disallow mixed 'LF' and 'CRLF' as linebreaks // https://eslint.org/docs/rules/linebreak-style 'linebreak-style': ['error', 'unix'], // require or disallow an empty line between class members // https://eslint.org/docs/rules/lines-between-class-members 'lines-between-class-members': ['error', 'always', { exceptAfterSingleLine: false }], // enforces empty lines around comments 'lines-around-comment': 'off', // require or disallow newlines around directives // https://eslint.org/docs/rules/lines-around-directive 'lines-around-directive': ['error', { before: 'always', after: 'always', }], // specify the maximum depth that blocks can be nested 'max-depth': ['off', 4], // specify the maximum length of a line in your program // https://eslint.org/docs/rules/max-len 'max-len': ['error', 100, 2, { ignoreUrls: true, ignoreComments: false, ignoreRegExpLiterals: true, ignoreStrings: true, ignoreTemplateLiterals: true, }], // specify the max number of lines in a file // https://eslint.org/docs/rules/max-lines 'max-lines': ['off', { max: 300, skipBlankLines: true, skipComments: true }], // enforce a maximum function length // https://eslint.org/docs/rules/max-lines-per-function 'max-lines-per-function': ['off', { max: 50, skipBlankLines: true, skipComments: true, IIFEs: true, }], // specify the maximum depth callbacks can be nested 'max-nested-callbacks': 'off', // limits the number of parameters that can be used in the function declaration. 'max-params': ['off', 3], // specify the maximum number of statement allowed in a function 'max-statements': ['off', 10], // restrict the number of statements per line // https://eslint.org/docs/rules/max-statements-per-line 'max-statements-per-line': ['off', { max: 1 }], // enforce a particular style for multiline comments // https://eslint.org/docs/rules/multiline-comment-style 'multiline-comment-style': ['off', 'starred-block'], // require multiline ternary // https://eslint.org/docs/rules/multiline-ternary // TODO: enable? 'multiline-ternary': ['off', 'never'], // require a capital letter for constructors 'new-cap': ['error', { newIsCap: true, newIsCapExceptions: [], capIsNew: false, capIsNewExceptions: ['Immutable.Map', 'Immutable.Set', 'Immutable.List'], }], // disallow the omission of parentheses when invoking a constructor with no arguments // https://eslint.org/docs/rules/new-parens 'new-parens': 'error', // allow/disallow an empty newline after var statement 'newline-after-var': 'off', // https://eslint.org/docs/rules/newline-before-return 'newline-before-return': 'off', // enforces new line after each method call in the chain to make it // more readable and easy to maintain // https://eslint.org/docs/rules/newline-per-chained-call 'newline-per-chained-call': ['error', { ignoreChainWithDepth: 4 }], // disallow use of the Array constructor 'no-array-constructor': 'error', // disallow use of bitwise operators // https://eslint.org/docs/rules/no-bitwise 'no-bitwise': 'error', // disallow use of the continue statement // https://eslint.org/docs/rules/no-continue 'no-continue': 'error', // disallow comments inline after code 'no-inline-comments': 'off', // disallow if as the only statement in an else block // https://eslint.org/docs/rules/no-lonely-if 'no-lonely-if': 'error', // disallow un-paren'd mixes of different operators // https://eslint.org/docs/rules/no-mixed-operators 'no-mixed-operators': ['error', { // the list of arthmetic groups disallows mixing `%` and `**` // with other arithmetic operators. groups: [ ['%', '**'], ['%', '+'], ['%', '-'], ['%', '*'], ['%', '/'], ['/', '*'], ['&', '|', '<<', '>>', '>>>'], ['==', '!=', '===', '!=='], ['&&', '||'], ], allowSamePrecedence: false }], // disallow mixed spaces and tabs for indentation 'no-mixed-spaces-and-tabs': 'error', // disallow use of chained assignment expressions // https://eslint.org/docs/rules/no-multi-assign 'no-multi-assign': ['error'], // disallow multiple empty lines, only one newline at the end, and no new lines at the beginning // https://eslint.org/docs/rules/no-multiple-empty-lines 'no-multiple-empty-lines': ['error', { max: 2, maxBOF: 1, maxEOF: 0 }], // disallow negated conditions // https://eslint.org/docs/rules/no-negated-condition 'no-negated-condition': 'off', // disallow nested ternary expressions 'no-nested-ternary': 'error', // disallow use of the Object constructor 'no-new-object': 'error', // disallow use of unary operators, ++ and -- // https://eslint.org/docs/rules/no-plusplus 'no-plusplus': 'error', // disallow certain syntax forms // https://eslint.org/docs/rules/no-restricted-syntax 'no-restricted-syntax': [ 'error', { selector: 'ForInStatement', message: 'for..in loops iterate over the entire prototype chain, which is virtually never what you want. Use Object.{keys,values,entries}, and iterate over the resulting array.', }, { selector: 'ForOfStatement', message: 'iterators/generators require regenerator-runtime, which is too heavyweight for this guide to allow them. Separately, loops should be avoided in favor of array iterations.', }, { selector: 'LabeledStatement', message: 'Labels are a form of GOTO; using them makes code confusing and hard to maintain and understand.', }, { selector: 'WithStatement', message: '`with` is disallowed in strict mode because it makes code impossible to predict and optimize.', }, ], // disallow space between function identifier and application 'no-spaced-func': 'error', // disallow tab characters entirely 'no-tabs': 'error', // disallow the use of ternary operators 'no-ternary': 'off', // disallow trailing whitespace at the end of lines 'no-trailing-spaces': ['error', { skipBlankLines: false, ignoreComments: false, }], // disallow dangling underscores in identifiers // https://eslint.org/docs/rules/no-underscore-dangle 'no-underscore-dangle': ['error', { allow: [], allowAfterThis: false, allowAfterSuper: false, enforceInMethodNames: true, }], // disallow the use of Boolean literals in conditional expressions // also, prefer `a || b` over `a ? a : b` // https://eslint.org/docs/rules/no-unneeded-ternary 'no-unneeded-ternary': ['error', { defaultAssignment: false }], // disallow whitespace before properties // https://eslint.org/docs/rules/no-whitespace-before-property 'no-whitespace-before-property': 'error', // enforce the location of single-line statements // https://eslint.org/docs/rules/nonblock-statement-body-position 'nonblock-statement-body-position': ['error', 'beside', { overrides: {} }], // require padding inside curly braces 'object-curly-spacing': ['error', 'always'], // enforce line breaks between braces // https://eslint.org/docs/rules/object-curly-newline 'object-curly-newline': ['error', { ObjectExpression: { minProperties: 4, multiline: true, consistent: true }, ObjectPattern: { minProperties: 4, multiline: true, consistent: true }, ImportDeclaration: { minProperties: 4, multiline: true, consistent: true }, ExportDeclaration: { minProperties: 4, multiline: true, consistent: true }, }], // enforce "same line" or "multiple line" on object properties. // https://eslint.org/docs/rules/object-property-newline 'object-property-newline': ['error', { allowAllPropertiesOnSameLine: true, }], // allow just one var statement per function 'one-var': ['error', 'never'], // require a newline around variable declaration // https://eslint.org/docs/rules/one-var-declaration-per-line 'one-var-declaration-per-line': ['error', 'always'], // require assignment operator shorthand where possible or prohibit it entirely // https://eslint.org/docs/rules/operator-assignment 'operator-assignment': ['error', 'always'], // Requires operator at the beginning of the line in multiline statements // https://eslint.org/docs/rules/operator-linebreak 'operator-linebreak': ['error', 'before', { overrides: { '=': 'none' } }], // disallow padding within blocks 'padded-blocks': ['error', { blocks: 'never', classes: 'never', switches: 'never', }, { allowSingleLineBlocks: true, }], // Require or disallow padding lines between statements // https://eslint.org/docs/rules/padding-line-between-statements 'padding-line-between-statements': 'off', // Disallow the use of Math.pow in favor of the ** operator // https://eslint.org/docs/rules/prefer-exponentiation-operator // TODO: enable, semver-major when eslint 5 is dropped 'prefer-exponentiation-operator': 'off', // Prefer use of an object spread over Object.assign // https://eslint.org/docs/rules/prefer-object-spread 'prefer-object-spread': 'error', // require quotes around object literal property names // https://eslint.org/docs/rules/quote-props.html 'quote-props': ['error', 'as-needed', { keywords: false, unnecessary: true, numbers: false }], // specify whether double or single quotes should be used quotes: ['error', 'single', { avoidEscape: true }], // do not require jsdoc // https://eslint.org/docs/rules/require-jsdoc 'require-jsdoc': 'off', // require or disallow use of semicolons instead of ASI semi: ['error', 'always'], // enforce spacing before and after semicolons 'semi-spacing': ['error', { before: false, after: true }], // Enforce location of semicolons // https://eslint.org/docs/rules/semi-style 'semi-style': ['error', 'last'], // requires object keys to be sorted 'sort-keys': ['off', 'asc', { caseSensitive: false, natural: true }], // sort variables within the same declaration block 'sort-vars': 'off', // require or disallow space before blocks 'space-before-blocks': 'error', // require or disallow space before function opening parenthesis // https://eslint.org/docs/rules/space-before-function-paren 'space-before-function-paren': ['error', { anonymous: 'always', named: 'never', asyncArrow: 'always' }], // require or disallow spaces inside parentheses 'space-in-parens': ['error', 'never'], // require spaces around operators 'space-infix-ops': 'error', // Require or disallow spaces before/after unary operators // https://eslint.org/docs/rules/space-unary-ops 'space-unary-ops': ['error', { words: true, nonwords: false, overrides: { }, }], // require or disallow a space immediately following the // or /* in a comment // https://eslint.org/docs/rules/spaced-comment 'spaced-comment': ['error', 'always', { line: { exceptions: ['-', '+'], markers: ['=', '!', '/'], // space here to support sprockets directives, slash for TS /// comments }, block: { exceptions: ['-', '+'], markers: ['=', '!', ':', '::'], // space here to support sprockets directives and flow comment types balanced: true, } }], // Enforce spacing around colons of switch statements // https://eslint.org/docs/rules/switch-colon-spacing 'switch-colon-spacing': ['error', { after: true, before: false }], // Require or disallow spacing between template tags and their literals // https://eslint.org/docs/rules/template-tag-spacing 'template-tag-spacing': ['error', 'never'], // require or disallow the Unicode Byte Order Mark // https://eslint.org/docs/rules/unicode-bom 'unicode-bom': ['error', 'never'], // require regex literals to be wrapped in parentheses 'wrap-regex': 'off' } };
/* Copyright 2019 OmiseGO Pte Ltd Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ const erc20abi = require('human-standard-token-abi') const { getErc20BalanceSchema } = require('./validators') const Joi = require('@hapi/joi') /** * Retrieve the RootChain ERC20 balance for an address * * @method getErc20Balance * @param {Object} args arguments object * @param {Web3} args.web3 web3 instance * @param {string} args.address the address to check * @param {string} args.erc20Address the address of the erc20 contract * @return {Promise<string>} promise that resolves with the balance */ async function getErc20Balance ({ web3, address, erc20Address }) { Joi.assert({ web3, address, erc20Address }, getErc20BalanceSchema) const erc20Contract = new web3.eth.Contract(erc20abi, erc20Address) const txDetails = { from: address, to: erc20Address, data: erc20Contract.methods.balanceOf(address).encodeABI() } const balance = await web3.eth.call(txDetails) // return number as string in case of very large numbers return web3.utils.hexToNumberString(balance) } module.exports = getErc20Balance
import { BaseVariable } from './BaseVariable.js'; /** * Allows to create a dynamic reference to another variable. * For example when you compute a log-loss you can reference the * positive class probability and propagate gradient to the correct variable */ export class ReferenceVariable extends BaseVariable { constructor(vs, children) { super(vs, children); this.uiName = 'Ref(var)' // Instead of storying the value in memory, we store the id of the variable // to which we point. This changes how the variable is accessed this.name = `v[v[${this.id}]]`; this.gradName = `gv[v[${this.id}]]`; } setReference(value) { this.vs.v[this.id] = value.id; } getValue() { let v = this.vs.v; return v[v[id]]; } setValue(value) { let v = this.vs.v; v[v[this.id]] = value; } }
export default class OperatorManager { constructor() { this.builtin_uniary = { '+': (inp) => inp, '-': (inp) => -inp, 'NOT': (inp) => ~inp } this.builtin_binary = { "+": (inp1, inp2) => inp1 + inp2, "-": (inp1, inp2) => inp1 - inp2, "*": (inp1, inp2) => inp1 * inp2, "/": (inp1, inp2) => inp1 / inp2, "\\": (inp1, inp2) => parseInt(inp1 / inp2), "^": (inp1, inp2) => Math.pow(inp1, inp2), "<": (inp1, inp2) => inp1 < inp2, ">": (inp1, inp2) => inp1 > inp2, "==": (inp1, inp2) => inp1 == inp2, "<=": (inp1, inp2) => inp1 <= inp2, "=<": (inp1, inp2) => inp1 <= inp2, ">=": (inp1, inp2) => inp1 >= inp2, "=>": (inp1, inp2) => inp1 >= inp2, "<>": (inp1, inp2) => inp1 != inp2, "AND": (inp1, inp2) => inp1 && inp2, "OR": (inp1, inp2) => inp1 || inp2, "MOD": (inp1, inp2) => inp1 % inp2, "XOR": (inp1, inp2) => inp1 ^ inp2, "EQV": (inp1, inp2) => ~(inp1 ^ inp2), "IMP": (inp1, inp2) => ~inp1 ^ inp2, } this.uniary_dict = this.builtin_uniary; this.binary_dict = this.builtin_binary; } clear() { this.uniary_dict = this.builtin_uniary; this.binary_dict = this.builtin_binary; } get_uniary(name) { return this.uniary_dict[name]; } get_binary(name) { return this.binary_dict[name]; } register_uniary(name, op_function) { this.uniary_dict[name] = op_function; } register_binary(name, op_function) { this.binary_dict[name] = op_function; } _getOps() { var uniary = Object.keys(this.uniary_dict); var binary = Object.keys(this.binary_dict); return uniary.concat(binary); } _getMaxOpLength() { var ops = this._getOps(), len = 0; ops.map((val) => { if (val.length > len) len = val.length; }) return len; } isOp(text) { var ops = this._getOps(); for (var i = this._getMaxOpLength(); i > 0; i--) { var chunk = text.slice(0, i); if (ops.indexOf(chunk) > -1) { return [i, chunk]; } } } }
import { formatTimer } from "./time"; export default { formatTimer, };
import React from 'react'; import styles from "./index.less" import {Form,Input,Button} from 'antd' import { connect } from 'dva'; const FormItem = Form.Item; @Form.create() @connect((state)=>{ return {} }) class Login extends React.Component{ handleSubmit=(e)=>{ e.preventDefault(); this.props.form.validateFields((err,values)=>{ if(!err){ this.props.dispatch({ type:'login/login', payload:{ userName:values.userName, password:values.password, } }) } }) } goRegister=()=>{ this.props.dispatch({ type:'login/redirect', payload:{} }) } render(){ const {getFieldDecorator} = this.props.form; return <div className={styles.loginContainer}> <Form className={styles.formGroup} onSubmit={this.handleSubmit}> <FormItem> { getFieldDecorator('userName',{ rules:[ { required:true, message:'请输入用户名' } ] })( <Input placeholder='用户名'/> ) } </FormItem> <FormItem> { getFieldDecorator('password',{ rules:[ { required:true, message:'请输入密码' } ] })( <Input placeholder='密码'/> ) } </FormItem> <FormItem className={styles.login}> <Button type="primary" htmlType="submit"> 登录 </Button> </FormItem> <FormItem> <span>还没有账户?</span> <Button onClick={this.goRegister}>去注册</Button> </FormItem> </Form> </div> } } export default Login;
const fs = require('fs'); const path = require('path'); const task2 = require('./task2.js'); fs.readFile(`${path.parse(__filename).name}.txt`, 'utf8', function (err, data) { if (err) { return console.log(err); } let rows = data.split('\r\n'); rows.pop(); let result2 = task2({ data: rows }); console.log(result2); });
'use strict'; const log = require('electron-log'); const Promise = require('bluebird'); const adb = require('adbkit'); const client = adb.createClient(); const toTitleCase = require('titlecase') const ipcMain = require('electron').ipcMain; ipcMain.on('adbkit-observe-devices', function(event, arg) { observeDevices(event, arg); }); function observeDevices(event, arg) { log.debug(`Starting to observe device state changes`); client.trackDevices() .then(function(tracker) { tracker.on('add', function(device) { event.sender.send('adbkit-device-added', device); }); tracker.on('remove', function(device) { event.sender.send('adbkit-device-removed', device); }); tracker.on('end', function() { log.debug(`Device state observation stopped`); }); }) .catch(function(err) { log.warn('Unable to observe devices:', err.stack) }); } ipcMain.on('adbkit-update-devices', function(event, arg) { updateDevices(event, arg); }); function updateDevices(event, arg) { log.debug(`Updating device list`); client.listDevicesWithPaths() .then(function(devices) { event.sender.send('adbkit-devices-updated', devices); }) .catch(function(err) { log.warn('Unable to get devices:', err.stack) event.sender.send('adbkit-devices-updated', []); }); } ipcMain.on('adbkit-connect-device', function(event, arg) { connectDevice(event, arg); }); function connectDevice(event, arg) { log.debug(`Connecting device: `, arg); client.connect(arg) .then(function(deviceId) { log.debug('Device connected:', deviceId) }) .catch(function(err) { log.warn('Unable to connect device:', err.stack) }); } ipcMain.on('adbkit-update-device', function(event, device) { updateDeviceFeatures(event, device); updateDeviceIpAddress(event, device); updateDeviceId(event, device); updateDeviceName(event, device); updateDeviceManufacturer(event, device); updateDeviceModel(event, device); }); function updateDeviceFeatures(event, device) { log.debug(`Updating features of device: ${device.id}`); client.getFeatures(device.id) .then(function(features) { device.features = features; event.sender.send('adbkit-device-features-updated', device); }) .catch(function(err) { log.warn('Unable to get device features:', err.stack) }); } function updateDeviceIpAddress(event, device) { log.debug(`Updating IP address of device: ${device.id}`); runShellCommand(device, 'ip addr show wlan0 | grep \'inet \' | cut -d\' \' -f6|cut -d/ -f1') .then((output) => { device.ipAddress = output; event.sender.send('adbkit-device-updated', device); }) .catch((err) => { log.warn('Unable to get device IP address:', err.stack) }); } function updateDeviceId(event, device) { log.debug(`Updating Android ID of device: ${device.id}`); runShellCommand(device, createGetSettingCommand('secure', 'android_id')) .then((output) => { device.androidId = output; event.sender.send('adbkit-device-updated', device); }) .catch((err) => { log.warn('Unable to get device ID:', err.stack) }); } function updateDeviceName(event, device) { log.debug(`Updating name of device: ${device.id}`); runShellCommand(device, createGetSettingCommand('secure', 'bluetooth_name')) .then((output) => { device.bluetoothName = output; event.sender.send('adbkit-device-updated', device); }) .catch((err) => { log.warn('Unable to get device name:', err.stack) }); } function updateDeviceManufacturer(event, device) { log.debug(`Updating manufacturer of device: ${device.id}`); runShellCommand(device, createGetPropCommand('ro.product.manufacturer')) .then((output) => { device.manufacturer = toTitleCase(output.toLowerCase()); event.sender.send('adbkit-device-updated', device); }) .catch((err) => { log.warn('Unable to get device name:', err.stack) }); } function updateDeviceModel(event, device) { log.debug(`Updating model of device: ${device.id}`); runShellCommand(device, createGetPropCommand('ro.product.model')) .then((output) => { device.model = toTitleCase(output.toLowerCase()); event.sender.send('adbkit-device-updated', device); }) .catch((err) => { log.warn('Unable to get device model:', err.stack) }); } function runShellCommand(device, command) { log.debug(`Executing shell command on ${device.id}: ${command}`); return new Promise((resolve, reject) => { client.shell(device.id, command) .then(function(outputStream) { adb.util.readAll(outputStream) .then(function(outputBuffer) { let output = outputBuffer.toString('utf-8'); // remove linebreaks from start and end output = output.replace(/^\s+|\s+$/g, ''); resolve(output); }); }) .catch(reject); }); } function createGetPropCommand(propertyId) { return `getprop | grep "${propertyId}" | cut -d ":" -f2 | cut -d "[" -f2 | cut -d "]" -f1`; } function createGetSettingCommand(namespace, settingId) { return `settings get ${namespace} "${settingId}"`; } module.exports = { updateDevices: updateDevices };
import Thener from './thener'; export default Thener;
import { h } from 'omi'; import createSvgIcon from './utils/createSvgIcon'; export default createSvgIcon(h(h.f, null, h("path", { d: "M20 14v-4h-4v2.89L17.11 14zm-10-1.45V14h1.45zM14 10h-.89l.89.89zm5.11 6l.89.89V16zM8 4h-.89l.89.89zm6 4V4h-4v2.89L11.11 8zm2-4h4v4h-4zm-6 12v4h4v-3.45l-.55-.55zm-6-6v4h4v-3.45L7.45 10zm12 10h1.45L16 18.55zM4 16h4v4H4zm0-9.45V8h1.45z", opacity: ".3" }), h("path", { d: "M8 4v.89l2 2V4h4v4h-2.89l2 2H14v.89l2 2V10h4v4h-2.89l2 2H20v.89l2 2V4c0-1.1-.9-2-2-2H5.11l2 2H8zm8 0h4v4h-4V4zM1.41 1.14L0 2.55l2 2V20c0 1.1.9 2 2 2h15.45l2.01 2.01 1.41-1.41L1.41 1.14zM10 12.55L11.45 14H10v-1.45zm-6-6L5.45 8H4V6.55zM8 20H4v-4h4v4zm0-6H4v-4h3.45l.55.55V14zm6 6h-4v-4h3.45l.55.55V20zm2 0v-1.45L17.45 20H16z" })), 'GridOffTwoTone');
import Vue from "vue" const vueFb = {} vueFb.install = function install (Vue, options) { (function (d, s, id) { var js var fjs = d.getElementsByTagName(s)[0] if (d.getElementById(id)) { return } js = d.createElement(s) js.id = id js.src = "//connect.facebook.net/en_US/sdk.js" fjs.parentNode.insertBefore(js, fjs) }(document, "script", "facebook-jssdk")) window.fbAsyncInit = function onSDKInit () { window.FB.init(options) window.FB.AppEvents.logPageView() Vue.FB = window.FB window.dispatchEvent(new Event("fb-sdk-ready")) } Vue.FB = undefined } Vue.use(vueFb, { appId: process.env.FB_APP_ID, autoLogAppEvents: true, xfbml: true, version: "v2.9" })
import React, { useState } from 'react'; import PropTypes from 'prop-types'; import ReactJson from 'react-json-view'; import moment from 'moment'; import { EuiBasicTable, EuiHealth, EuiIcon, EuiFlyout, EuiFlyoutBody, EuiFlyoutHeader, EuiTitle, EuiText, } from '@elastic/eui'; const ConnectivityDomainPodsTable = ({ components }) => { const [isFlyoutVisible, setIsFlyoutVisible] = useState(false); const [flyoutTitle, setFlyOutTitle] = useState('wcm-system'); const [flyOutContent, setFlyOutContent] = useState(); let flyout; if (isFlyoutVisible) { flyout = ( <EuiFlyout ownFocus onClose={() => setIsFlyoutVisible(false)} aria-labelledby="flyoutTitle"> <EuiFlyoutHeader hasBorder> <EuiTitle size="m"> <h2 id="flyoutTitle">{flyoutTitle}</h2> </EuiTitle> </EuiFlyoutHeader> <EuiFlyoutBody> <EuiText> <ReactJson name={flyoutTitle} src={flyOutContent} indentWidth={2} enableClipboard={false} collapsed={2} /> </EuiText> </EuiFlyoutBody> </EuiFlyout> ); } const columns = [ { field: 'status', width: '100px', name: 'Status', dataType: 'boolean', render: (online) => { const color = online === 'Running' ? 'success' : 'warning'; return <EuiHealth color={color}>{online}</EuiHealth>; }, }, { field: 'provider', width: '80px', name: 'Provider', render: () => { const logo = 'logoKubernetes'; return ( <span> <EuiIcon type={logo} size="l" /> </span> ); }, }, { width: '100px', field: 'namespace', name: 'Namespace', }, { field: 'name', name: 'Pod Name', }, { field: 'status.startTime', name: 'Start Time', width: '200px', render: (time) => { const displayTime = moment(time).format('MMMM Do YYYY, h:mm a'); return <span>{displayTime}</span>; }, }, ]; const getRowProps = (item) => { const { id } = item; return { 'data-test-subj': `row-${id}`, className: 'customRowClass', onClick: () => { setFlyOutContent(item); setFlyOutTitle(`Pod name: ${item.name}`); setIsFlyoutVisible(true); }, }; }; const getCellProps = (item, column) => { const { id } = item; const { field } = column; return { className: 'customCellClass', 'data-test-subj': `cell-${id}-${field}`, textOnly: true, }; }; return ( <> <EuiBasicTable items={components} rowHeader="firstName" columns={columns} rowProps={getRowProps} cellProps={getCellProps} /> {flyout} </> ); }; ConnectivityDomainPodsTable.propTypes = { components: PropTypes.arrayOf(PropTypes.object).isRequired }; export default ConnectivityDomainPodsTable;
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const React = require("react"); const wrapIcon_1 = require("../utils/wrapIcon"); const rawSvg = (iconProps) => { const { className, primaryFill } = iconProps; return React.createElement("svg", { width: 24, height: 24, viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", className: className }, React.createElement("path", { d: "M5.25 3A3.25 3.25 0 002 6.25v6.5C2 14.55 3.46 16 5.25 16h2.24c-.08.84-.78 1.5-1.65 1.5H3.25a.75.75 0 00-.75.75v3c0 .41.34.75.75.75h3A5.75 5.75 0 0012 16.25V16h1.75a3.25 3.25 0 003.23-2.93l3.88 2.32a.75.75 0 001.14-.64V4.25a.75.75 0 00-1.14-.64l-3.88 2.32A3.25 3.25 0 0013.75 3h-8.5zM17 7.67l3.5-2.1v7.86l-3.5-2.1V7.67zM6.25 20.5H4V19h1.84c1.7 0 3.07-1.33 3.16-3h1.5v.25c0 2.35-1.9 4.25-4.25 4.25zM3.5 6.25c0-.97.78-1.75 1.75-1.75h8.5c.97 0 1.75.78 1.75 1.75v6.5c0 .97-.78 1.75-1.75 1.75h-8.5c-.97 0-1.75-.78-1.75-1.75v-6.5z", fill: primaryFill })); }; const VideoSecurity24Regular = wrapIcon_1.default(rawSvg({}), 'VideoSecurity24Regular'); exports.default = VideoSecurity24Regular;
var OuterSubscriber_1 = require('../OuterSubscriber'); var subscribeToResult_1 = require('../util/subscribeToResult'); /** * Buffers the source Observable values until `closingNotifier` emits. * * <span class="informal">Collects values from the past as an array, and emits * that array only when another Observable emits.</span> * * <img src="./img/buffer.png" width="100%"> * * Buffers the incoming Observable values until the given `closingNotifier` * Observable emits a value, at which point it emits the buffer on the output * Observable and starts a new buffer internally, awaiting the next time * `closingNotifier` emits. * * @example <caption>On every click, emit array of most recent interval events</caption> * var clicks = Rx.Observable.fromEvent(document, 'click'); * var interval = Rx.Observable.interval(1000); * var buffered = interval.buffer(clicks); * buffered.subscribe(x => console.log(x)); * * @see {@link bufferCount} * @see {@link bufferTime} * @see {@link bufferToggle} * @see {@link bufferWhen} * @see {@link window} * * @param {Observable<any>} closingNotifier An Observable that signals the * buffer to be emitted on the output Observable. * @return {Observable<T[]>} An Observable of buffers, which are arrays of * values. * @method buffer * @owner Observable */ function buffer(closingNotifier) { return this.lift(new BufferOperator(closingNotifier)); } exports.buffer = buffer; var BufferOperator = (function () { function BufferOperator(closingNotifier) { this.closingNotifier = closingNotifier; } BufferOperator.prototype.call = function (subscriber, source) { return source._subscribe(new BufferSubscriber(subscriber, this.closingNotifier)); }; return BufferOperator; })(); /** * We need this JSDoc comment for affecting ESDoc. * @ignore * @extends {Ignored} */ var BufferSubscriber = (function (_super) { __extends(BufferSubscriber, _super); function BufferSubscriber(destination, closingNotifier) { _super.call(this, destination); this.buffer = []; this.add(subscribeToResult_1.subscribeToResult(this, closingNotifier)); } BufferSubscriber.prototype._next = function (value) { this.buffer.push(value); }; BufferSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) { var buffer = this.buffer; this.buffer = []; this.destination.next(buffer); }; return BufferSubscriber; })(OuterSubscriber_1.OuterSubscriber); //# sourceMappingURL=buffer.js.map
/** * Module dependencies. */ const app = express(); const server = require('http').Server(app); const io = require('socket.io')(server); const compression = require('compression'); const session = require('express-session'); const bodyParser = require('body-parser'); const logger = require('morgan'); const chalk = require('chalk'); const errorHandler = require('errorhandler'); const lusca = require('lusca'); const dotenv = require('dotenv'); const MongoStore = require('connect-mongo')(session); const flash = require('express-flash'); const path = require('path'); const mongoose = require('mongoose'); const passport = require('passport'); const sass = require('node-sass-middleware'); const multer = require('multer'); const upload = multer({ dest: path.join(__dirname, 'uploads') }); /** * Load environment variables from .env file, where API keys and passwords are configured. */ dotenv.config({ path: '.env.example' }); /** * Controllers (route handlers). */ const homeController = require('./controllers/home'); const userController = require('./controllers/user'); const apiController = require('./controllers/api'); const contactController = require('./controllers/contact'); /** * API keys and Passport configuration. */ const passportConfig = require('./config/passport'); /** * Create Express server. */ const app = express(); /** * Connect to MongoDB. */ mongoose.set('useFindAndModify', false); mongoose.set('useCreateIndex', true); mongoose.set('useNewUrlParser', true); mongoose.set('useUnifiedTopology', true); mongoose.connect(process.env.MONGODB_URI); mongoose.connection.on('error', (err) => { console.error(err); console.log('%s MongoDB connection error. Please make sure MongoDB is running.', chalk.red('✗')); process.exit(); }); /** * Express configuration. */ app.set('host', process.env.OPENSHIFT_NODEJS_IP || '0.0.0.0'); app.set('port', process.env.PORT || process.env.OPENSHIFT_NODEJS_PORT || 8080); app.set('views', path.join(__dirname, 'views')); app.set('view engine', 'pug'); app.use(compression()); app.use(sass({ src: path.join(__dirname, 'public'), dest: path.join(__dirname, 'public') })); app.use(logger('dev')); app.use(bodyParser.json()); app.use(bodyParser.urlencoded({ extended: true })); app.use(session({ resave: true, saveUninitialized: true, secret: process.env.SESSION_SECRET, cookie: { maxAge: 1209600000 }, // two weeks in milliseconds store: new MongoStore({ url: process.env.MONGODB_URI, autoReconnect: true, }) })); app.use(passport.initialize()); app.use(passport.session()); app.use(flash()); app.use((req, res, next) => { if (req.path === '/api/upload') { // Multer multipart/form-data handling needs to occur before the Lusca CSRF check. next(); } else { lusca.csrf()(req, res, next); } }); app.use(lusca.xframe('SAMEORIGIN')); app.use(lusca.xssProtection(true)); app.disable('x-powered-by'); app.use((req, res, next) => { res.locals.user = req.user; next(); }); app.use((req, res, next) => { // After successful login, redirect back to the intended page if (!req.user && req.path !== '/login' && req.path !== '/signup' && !req.path.match(/^\/auth/) && !req.path.match(/\./)) { req.session.returnTo = req.originalUrl; } else if (req.user && (req.path === '/account' || req.path.match(/^\/api/))) { req.session.returnTo = req.originalUrl; } next(); }); app.use('/', express.static(path.join(__dirname, 'public'), { maxAge: 31557600000 })); app.use('/js/lib', express.static(path.join(__dirname, 'node_modules/chart.js/dist'), { maxAge: 31557600000 })); app.use('/js/lib', express.static(path.join(__dirname, 'node_modules/popper.js/dist/umd'), { maxAge: 31557600000 })); app.use('/js/lib', express.static(path.join(__dirname, 'node_modules/bootstrap/dist/js'), { maxAge: 31557600000 })); app.use('/js/lib', express.static(path.join(__dirname, 'node_modules/jquery/dist'), { maxAge: 31557600000 })); app.use('/webfonts', express.static(path.join(__dirname, 'node_modules/@fortawesome/fontawesome-free/webfonts'), { maxAge: 31557600000 })); /** * Primary app routes. */ app.get('/', homeController.index); app.get('/login', userController.getLogin); app.post('/login', userController.postLogin); app.get('/logout', userController.logout); app.get('/forgot', userController.getForgot); app.post('/forgot', userController.postForgot); app.get('/reset/:token', userController.getReset); app.post('/reset/:token', userController.postReset); app.get('/signup', userController.getSignup); app.post('/signup', userController.postSignup); app.get('/contact', contactController.getContact); app.post('/contact', contactController.postContact); app.get('/account/verify', passportConfig.isAuthenticated, userController.getVerifyEmail); app.get('/account/verify/:token', passportConfig.isAuthenticated, userController.getVerifyEmailToken); app.get('/account', passportConfig.isAuthenticated, userController.getAccount); app.post('/account/profile', passportConfig.isAuthenticated, userController.postUpdateProfile); app.post('/account/password', passportConfig.isAuthenticated, userController.postUpdatePassword); app.post('/account/delete', passportConfig.isAuthenticated, userController.postDeleteAccount); app.get('/account/unlink/:provider', passportConfig.isAuthenticated, userController.getOauthUnlink); /** * API examples routes. */ app.get('/api', apiController.getApi); app.get('/api/lastfm', apiController.getLastfm); app.get('/api/nyt', apiController.getNewYorkTimes); app.get('/api/steam', passportConfig.isAuthenticated, passportConfig.isAuthorized, apiController.getSteam); app.get('/api/stripe', apiController.getStripe); app.post('/api/stripe', apiController.postStripe); app.get('/api/scraping', apiController.getScraping); app.get('/api/twilio', apiController.getTwilio); app.post('/api/twilio', apiController.postTwilio); app.get('/api/foursquare', passportConfig.isAuthenticated, passportConfig.isAuthorized, apiController.getFoursquare); app.get('/api/tumblr', passportConfig.isAuthenticated, passportConfig.isAuthorized, apiController.getTumblr); app.get('/api/facebook', passportConfig.isAuthenticated, passportConfig.isAuthorized, apiController.getFacebook); app.get('/api/github', passportConfig.isAuthenticated, passportConfig.isAuthorized, apiController.getGithub); app.get('/api/twitter', passportConfig.isAuthenticated, passportConfig.isAuthorized, apiController.getTwitter); app.post('/api/twitter', passportConfig.isAuthenticated, passportConfig.isAuthorized, apiController.postTwitter); app.get('/api/twitch', passportConfig.isAuthenticated, passportConfig.isAuthorized, apiController.getTwitch); app.get('/api/instagram', passportConfig.isAuthenticated, passportConfig.isAuthorized, apiController.getInstagram); app.get('/api/paypal', apiController.getPayPal); app.get('/api/paypal/success', apiController.getPayPalSuccess); app.get('/api/paypal/cancel', apiController.getPayPalCancel); app.get('/api/lob', apiController.getLob); app.get('/api/upload', lusca({ csrf: true }), apiController.getFileUpload); app.post('/api/upload', upload.single('myFile'), lusca({ csrf: true }), apiController.postFileUpload); app.get('/api/pinterest', passportConfig.isAuthenticated, passportConfig.isAuthorized, apiController.getPinterest); app.post('/api/pinterest', passportConfig.isAuthenticated, passportConfig.isAuthorized, apiController.postPinterest); app.get('/api/here-maps', apiController.getHereMaps); app.get('/api/google-maps', apiController.getGoogleMaps); app.get('/api/google/drive', passportConfig.isAuthenticated, passportConfig.isAuthorized, apiController.getGoogleDrive); app.get('/api/chart', apiController.getChart); app.get('/api/google/sheets', passportConfig.isAuthenticated, passportConfig.isAuthorized, apiController.getGoogleSheets); app.get('/api/quickbooks', passportConfig.isAuthenticated, passportConfig.isAuthorized, apiController.getQuickbooks); /** * OAuth authentication routes. (Sign in) */ app.get('/auth/instagram', passport.authenticate('instagram', { scope: ['basic', 'public_content'] })); app.get('/auth/instagram/callback', passport.authenticate('instagram', { failureRedirect: '/login' }), (req, res) => { res.redirect(req.session.returnTo || '/'); }); app.get('/auth/snapchat', passport.authenticate('snapchat')); app.get('/auth/snapchat/callback', passport.authenticate('snapchat', { failureRedirect: '/login' }), (req, res) => { res.redirect(req.session.returnTo || '/'); }); app.get('/auth/facebook', passport.authenticate('facebook', { scope: ['email', 'public_profile'] })); app.get('/auth/facebook/callback', passport.authenticate('facebook', { failureRedirect: '/login' }), (req, res) => { res.redirect(req.session.returnTo || '/'); }); app.get('/auth/github', passport.authenticate('github')); app.get('/auth/github/callback', passport.authenticate('github', { failureRedirect: '/login' }), (req, res) => { res.redirect(req.session.returnTo || '/'); }); app.get('/auth/google', passport.authenticate('google', { scope: ['profile', 'email', 'https://www.googleapis.com/auth/drive', 'https://www.googleapis.com/auth/spreadsheets.readonly'], accessType: 'offline', prompt: 'consent' })); app.get('/auth/google/callback', passport.authenticate('google', { failureRedirect: '/login' }), (req, res) => { res.redirect(req.session.returnTo || '/'); }); app.get('/auth/twitter', passport.authenticate('twitter')); app.get('/auth/twitter/callback', passport.authenticate('twitter', { failureRedirect: '/login' }), (req, res) => { res.redirect(req.session.returnTo || '/'); }); app.get('/auth/linkedin', passport.authenticate('linkedin', { state: 'SOME STATE' })); app.get('/auth/linkedin/callback', passport.authenticate('linkedin', { failureRedirect: '/login' }), (req, res) => { res.redirect(req.session.returnTo || '/'); }); app.get('/auth/twitch', passport.authenticate('twitch', {})); app.get('/auth/twitch/callback', passport.authenticate('twitch', { failureRedirect: '/login' }), (req, res) => { res.redirect(req.session.returnTo || '/'); }); /** * OAuth authorization routes. (API examples) */ app.get('/auth/foursquare', passport.authorize('foursquare')); app.get('/auth/foursquare/callback', passport.authorize('foursquare', { failureRedirect: '/api' }), (req, res) => { res.redirect('/api/foursquare'); }); app.get('/auth/tumblr', passport.authorize('tumblr')); app.get('/auth/tumblr/callback', passport.authorize('tumblr', { failureRedirect: '/api' }), (req, res) => { res.redirect('/api/tumblr'); }); app.get('/auth/steam', passport.authorize('openid', { state: 'SOME STATE' })); app.get('/auth/steam/callback', passport.authorize('openid', { failureRedirect: '/api' }), (req, res) => { res.redirect(req.session.returnTo); }); app.get('/auth/pinterest', passport.authorize('pinterest', { scope: 'read_public write_public' })); app.get('/auth/pinterest/callback', passport.authorize('pinterest', { failureRedirect: '/login' }), (req, res) => { res.redirect('/api/pinterest'); }); app.get('/auth/quickbooks', passport.authorize('quickbooks', { scope: ['com.intuit.quickbooks.accounting'], state: 'SOME STATE' })); app.get('/auth/quickbooks/callback', passport.authorize('quickbooks', { failureRedirect: '/login' }), (req, res) => { res.redirect(req.session.returnTo); }); /** * Error Handler. */ if (process.env.NODE_ENV === 'development') { // only use in development app.use(errorHandler()); } else { app.use((err, req, res, next) => { console.error(err); res.status(500).send('Server Error'); }); } /** * Start Express server. */ app.listen(app.get('port'), () => { console.log('%s App is running at http://localhost:%d in %s mode', chalk.green('✓'), app.get('port'), app.get('env')); console.log(' Press CTRL-C to stop\n'); }); module.exports = app;
// see http://vuejs-templates.github.io/webpack for documentation. var path = require('path') module.exports = { build: { env: require('./prod.env'), index: path.resolve(__dirname, '../dist/index.html'), assetsRoot: path.resolve(__dirname, '../dist'), assetsSubDirectory: 'static', assetsPublicPath: './', productionSourceMap: true, // Gzip off by default as many popular static hosts such as // Surge or Netlify already gzip all static assets for you. // Before setting to `true`, make sure to: // npm install --save-dev compression-webpack-plugin productionGzip: false, productionGzipExtensions: ['js', 'css'], // Run the build command with an extra argument to // View the bundle analyzer report after build finishes: // `npm run build --report` // Set to `true` or `false` to always turn it on or off bundleAnalyzerReport: process.env.npm_config_report }, dev: { env: require('./dev.env'), port: 9527, autoOpenBrowser: false, assetsSubDirectory: 'static', assetsPublicPath: '/', proxyTable: {}, // CSS Sourcemaps off by default because relative paths are "buggy" // with this option, according to the CSS-Loader README // (https://github.com/webpack/css-loader#sourcemaps) // In our experience, they generally work as expected, // just be aware of this issue when enabling this option. cssSourceMap: false } }
export { EuiListGroup } from './list_group'; export { EuiListGroupItem } from './list_group_item';
const DELAY= 0; module.exports = function() { var Moment = require('vendor/moment'); if (!Ti.Network.online || Ti.App.Properties.hasProperty('LASTSYNC') && Ti.App.Properties.getInt('LASTSYNC') - parseInt(Moment().format('X')) < 3600 * 24) { console.log('Warning: sync aborted, last sync is to fresh ≠≠≠≠≠≠≠≠≠≠≠≠≠≠≠≠≠≠≠≠≠≠≠'); return; } Ti.App.Properties.setString('LASTSYNC',parseInt(Moment().format('X'))); var today = Moment().format('YYMMDD'); var alarmManager = require('bencoding.alarmmanager').createAlarmManager(); alarmManager.addAlarmNotification({ requestCode : 2, // must be INT to identify the alarm second : DELAY, contentTitle : 'DLR Mediathek', contentText : ' Podcastssynchronisierung gestartet', playSound : true, icon : Ti.App.Android.R.drawable.appicon, sound : Ti.Filesystem.getResRawDirectory() + 'kkj', //Set a custom sound to play }); alarmManager.addAlarmService({ service : 'de.appwerft.dlrmediathek.PodcastsyncService', second : DELAY, repeat : 'daily', interval : 3600 * 24 * 1000 }); };
/** * @author Richard Davey <rich@photonstorm.com> * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var Class = require('../../../utils/Class'); var Earcut = require('../../../geom/polygon/Earcut'); var EllipseRender = require('./EllipseRender'); var GeomEllipse = require('../../../geom/ellipse/Ellipse'); var Shape = require('../Shape'); /** * @classdesc * The Ellipse Shape is a Game Object that can be added to a Scene, Group or Container. You can * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling * it for input or physics. It provides a quick and easy way for you to render this shape in your * game without using a texture, while still taking advantage of being fully batched in WebGL. * * This shape supports both fill and stroke colors. * * When it renders it displays an ellipse shape. You can control the width and height of the ellipse. * If the width and height match it will render as a circle. If the width is less than the height, * it will look more like an egg shape. * * The Ellipse shape also has a `smoothness` property and corresponding `setSmoothness` method. * This allows you to control how smooth the shape renders in WebGL, by controlling the number of iterations * that take place during construction. Increase and decrease the default value for smoother, or more * jagged, shapes. * * @class Ellipse * @extends Phaser.GameObjects.Shape * @memberof Phaser.GameObjects * @constructor * @since 3.13.0 * * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. * @param {number} [x=0] - The horizontal position of this Game Object in the world. * @param {number} [y=0] - The vertical position of this Game Object in the world. * @param {number} [width=128] - The width of the ellipse. An ellipse with equal width and height renders as a circle. * @param {number} [height=128] - The height of the ellipse. An ellipse with equal width and height renders as a circle. * @param {number} [fillColor] - The color the ellipse will be filled with, i.e. 0xff0000 for red. * @param {number} [fillAlpha] - The alpha the ellipse will be filled with. You can also set the alpha of the overall Shape using its `alpha` property. */ var Ellipse = new Class({ Extends: Shape, Mixins: [ EllipseRender ], initialize: function Ellipse (scene, x, y, width, height, fillColor, fillAlpha) { if (x === undefined) { x = 0; } if (y === undefined) { y = 0; } if (width === undefined) { width = 128; } if (height === undefined) { height = 128; } Shape.call(this, scene, 'Ellipse', new GeomEllipse(width / 2, height / 2, width, height)); /** * Private internal value. * The number of points used to draw the curve. Higher values create smoother renders at the cost of more triangles being drawn. * * @name Phaser.GameObjects.Ellipse#_smoothness * @type {integer} * @private * @since 3.13.0 */ this._smoothness = 64; this.setPosition(x, y); this.width = width; this.height = height; if (fillColor !== undefined) { this.setFillStyle(fillColor, fillAlpha); } this.updateDisplayOrigin(); this.updateData(); }, /** * The smoothness of the ellipse. The number of points used when rendering it. * Increase this value for a smoother ellipse, at the cost of more polygons being rendered. * * @name Phaser.GameObjects.Ellipse#smoothness * @type {integer} * @default 64 * @since 3.13.0 */ smoothness: { get: function () { return this._smoothness; }, set: function (value) { this._smoothness = value; this.updateData(); } }, /** * Sets the size of the ellipse by changing the underlying geometry data, rather than scaling the object. * This call can be chained. * * @method Phaser.GameObjects.Ellipse#setSize * @since 3.13.0 * * @param {number} width - The width of the ellipse. * @param {number} height - The height of the ellipse. * * @return {this} This Game Object instance. */ setSize: function (width, height) { this.geom.setSize(width, height); return this.updateData(); }, /** * Sets the smoothness of the ellipse. The number of points used when rendering it. * Increase this value for a smoother ellipse, at the cost of more polygons being rendered. * This call can be chained. * * @method Phaser.GameObjects.Ellipse#setSmoothness * @since 3.13.0 * * @param {integer} value - The value to set the smoothness to. * * @return {this} This Game Object instance. */ setSmoothness: function (value) { this._smoothness = value; return this.updateData(); }, /** * Internal method that updates the data and path values. * * @method Phaser.GameObjects.Ellipse#updateData * @private * @since 3.13.0 * * @return {this} This Game Object instance. */ updateData: function () { var path = []; var points = this.geom.getPoints(this._smoothness); for (var i = 0; i < points.length; i++) { path.push(points[i].x, points[i].y); } path.push(points[0].x, points[0].y); this.pathIndexes = Earcut(path); this.pathData = path; return this; } }); module.exports = Ellipse;
//Fact Generator var factlist = ["I was Time's Person of The Year for 2006! Wow! :)", "I like gaming, I have over 30 different console emulators installed on my PC!", "While I do enjoy watching anime, I also like watching cartoons! It's not strictly for kids!", "I learnt cycling and swimming at the very young age... of 19. You're never too old to learn something new!", "I scored the lowest in my class for PSLE, pretty sure my class was filled with child prodigies.", "Along with programming, I am also skilled in graphic design. I made data visuals, infographics and digital art", "Unlike most guys in Singapore, I have 0 interest in anything related to National Service.", "I actually dislike reading novels & fictional books, I prefer non-fiction & informative magazines!", "One of my future ambitions is to start my own web comic series!", "I have been to Japan, Taiwan, New Zealand & Australia, I hope to visit Europe & The Americas in the future."]; function shuffleArray(array) { var array2 = array; for (let i = array2.length - 1; i > 0; i--) { const j = Math.floor(Math.random() * (i + 1)); [array2[i], array2[j]] = [array2[j], array2[i]]; } return array2; } factlist = shuffleArray(factlist); var startindex = 0; function genFact(){ startindex = startindex % 10; var randomfact = factlist[startindex]; document.getElementById("fact").innerHTML = randomfact; startindex++; } function rouletteFact(){ //Roulette Effect for Fact Generator var i; for (i = 0; i < 101; i++) { genFact(); } } //Fact Generator //Pulsating effects $("#arrow").pulsate({ color: $(".banner-heading").css("background-color"), glow: true, }); $(".btn-primary").pulsate({ color: $(".banner-heading").css("background-color"), glow: true, }); $(".btn-secondary").pulsate({ color: $(".banner-heading").css("background-color"), glow: true, }); //Pulsating effects
import React from 'react'; import ReactCSSTransitionGroup from 'react-addons-css-transition-group'; const Resume = ({ load, nav, data, }) => { return ( <ReactCSSTransitionGroup transitionName="drop" transitionAppear={true} transitionAppearTimeout={500} transitionEnterTimeout={500} transitionLeaveTimeout={500} > {nav === 'resume' && load && ( <div id={"resume"} style={{ backgroundColor: 'rgba(0, 0, 0, .5)', color: 'white', borderColor: 'rgba(255, 255, 255, .0)', borderWidth: 3, borderStyle: 'solid', position: 'absolute', left: window.innerWidth < 900 ? '0%' : '15%', top: '10%', height: '90%', width: window.innerWidth < 900 ? '100%' : '70%', borderRadius: 30, padding: 20, overflowX: 'hidden' }} > <div className="row work"> <div className="three columns header-col"> <h1> <span className="glow">Work</span> </h1> </div> <div className="nine columns main-col"> {data.work.map(work => ( <div key={work.company}> <p style={{ fontSize: 20, marginBottom: -10 }}>{work.company}</p> <p className="info"> {work.title}{' '} <span>&bull;</span>{' '} <em className="date">{work.years}</em> </p> <p>{work.description}</p> <br></br> </div> ))} </div> </div> <div className="row education"> <div className="three columns header-col"> <h1 className="resume"> <span className="glow">Education</span> </h1> </div> <div className="nine columns main-col"> <div className="row item"> <div className="twelve columns"> {data.education.map(education => ( <div key={education.school}> <p style={{ fontSize: 20, marginBottom: -10 }}>{education.school}</p> <p className="info"> {education.degree} </p> <p>{education.description}</p> </div> ))} </div> </div> </div> </div> <div className="row skill"> <div className="three columns header-col"> <h1 className="resume glow"> <span>Skills</span> </h1> </div> <div className="nine columns main-col"> <span style={{ color: 'white' }}>{data.skillmessage}</span> </div> </div> </div> ) } </ReactCSSTransitionGroup > ); }; export default Resume;
console.log("hello world!"); //http请求: const http = require('http'); http.get({ localname:'api.douban.com', port:80 },(res)=>{ console.log(res); })
/* * * LiveShare actions * */ import * as CONSTANTS from './constants' import {createSkillUpdateMessage, createChatMessage, createContentOperationsMessage } from '../../utils/liveshare-message-builder' export function createHubConnection(onMessageReceivedCallback) { return { type: CONSTANTS.HUB_CONNECTION_REQUEST, onMessageReceivedCallback } } export function createOrLoadSkillInstance(skillId) { return { type: CONSTANTS.LOAD_SKILL_INSTANCE_REQUEST, skillId } } export function closeOrUnloadSkillInstance(skillId) { return { type: CONSTANTS.UNLOAD_SKILL_INSTANCE_REQUEST, skillId } } export function collaboratorJoined(collaborator) { return { type: CONSTANTS.COLLABORATOR_JOINED_EVENT_REQUEST, collaborator } } export function collaboratorLeft(collaborator) { return { type: CONSTANTS.COLLABORATOR_LEFT_EVENT_REQUEST, collaborator } } export function sendPatch(connection, skillId, patch, origin) { return { type: CONSTANTS.SEND_PATCH_REQUEST, connection, message: createSkillUpdateMessage(skillId, patch, origin) } } export function applyPatch(origin, patch) { return { type: CONSTANTS.PATCH_RECEIVED_EVENT_REQUEST, origin, patch } } export function setChangeTracking(trackChanges) { return { type: CONSTANTS.SET_CHANGE_TRACKING_REQUEST, trackChanges } } export function setSkillData(data) { return { type: CONSTANTS.SET_SKILL_DATA_REQUEST, data } } export function sendChatMessage(connection, skillId, message, id) { return { type: CONSTANTS.SEND_CHAT_MESSAGE_REQUEST, connection, message: createChatMessage(skillId, message, id) } } export function receiveChatMessage(message) { return { type: CONSTANTS.CHAT_MESSAGE_RECEIVED_REQUEST, message } } export function sendContentOperationMessage(skillId, pageId, operations) { return { type: CONSTANTS.SEND_CONTENT_OPERATION_REQUEST, skillId, pageId, operations } } export function addContentOperations(pageId, operations) { return { type: CONSTANTS.ADD_CONTENT_OPERATIONS_REQUEST, operations, pageId } } export function setPageContent(pageId, content) { return { type: CONSTANTS.SET_PAGE_CONTENT_REQUEST, content, pageId } } export function nodeOperationReceived(id, name, type, operationType) { return { type: CONSTANTS.LIVESHARE_NODE_OPERATION_RECEIVED_REQUEST, id, name, nodeType: type, operationType } } export function linkOperationReceived(sourceId, targetId, weight, operationType) { return { type: CONSTANTS.LIVESHARE_LINK_OPERATION_RECEIVED_REQUEST, sourceId, targetId, weight, operationType } }
export { default } from '@lblod/ember-rdfa-editor-bijzonder-comite-aanstelling-plugin/models/persoon';
class InvalidArgumentError extends Error { } module.exports = InvalidArgumentError;
db.voices.aggregate( { $group: { _id: "$language", count: {$sum:1}}, }, {$sort: {count: -1} } )
webpackJsonp([0x81b8806e4260],{331:function(e,o){e.exports={data:{allDataJson:{edges:[{node:{owners:[{name:"Anthony Chaple",fantasyname:"Finessers ",id:"{39E338CD-7398-4D82-8AEA-028DB7FC27B3}",image:"https://g.espncdn.com/lm-static/logo-packs/ffl/CreepShow-ToddDetwiler/CreepShow-01.svg",status:"active"},{name:"Armando Garcia",fantasyname:"Bombas",id:"{18048C9C-ECBE-43B1-B15B-4B7472580D6D}",image:"https://g.espncdn.com/lm-static/logo-packs/ffl/AtTheStadium-RobbHarskamp/At_The_Stadium_07.svg",status:"active"},{name:"Christian Plasencia",fantasyname:"Thanos",id:"{9B329FA4-4F2C-4204-8F5C-1EA6DD54ADA1}",image:"https://g.espncdn.com/lm-static/logo-packs/core/DIS_Avengers_EndGame/DIS_Avengers_EndGame_Thanos.svg",status:"active"},{name:"Giovanni Lorenzo",fantasyname:"Lorenzo",id:"{020C980B-8440-11D4-820C-00A0C9E58E2D}",image:"https://g.espncdn.com/lm-static/ffl/images/default_logos/12.svg",status:"active"},{name:"Jen Ten",fantasyname:"Brees",id:"{A54F23FC-66D8-4F47-A2AB-DDFAF68FD306}",image:"https://g.espncdn.com/lm-static/logo-packs/ffl/TeamKinny-MartinLaksman/TeamKinny-27.svg",status:"active"},{name:"Matthew Melton",fantasyname:"Ice",id:"{AA6CD04E-A7CA-4F94-919B-35FA5B31E667}",image:"https://g.espncdn.com/lm-static/logo-packs/core/Incredibles/incredibles_15.svg",status:"active"},{name:"Michael Balouch",fantasyname:"Slidazz",id:"{10D0AF16-40E0-4E2C-90AF-1640E06E2C06}",image:"https://g.espncdn.com/lm-static/logo-packs/core/StadiumFoods-ESPN/stadium-foods_tacos.svg",status:"active"},{name:"Michael Dovale",fantasyname:"Taco Bell",id:"{6A627663-12F0-47CF-A276-6312F097CF1A}",image:"https://g.espncdn.com/lm-static/logo-packs/core/StadiumFoods-ESPN/stadium-foods_tacos.svg",status:"active"},{name:"Michael Martinez",fantasyname:"God",id:"{AB884EFE-8384-4A15-884E-FE83849A1528}",image:"https://g.espncdn.com/lm-static/logo-packs/ffl/AtTheStadium-RobbHarskamp/At_The_Stadium_16.svg",status:"active"},{name:"Uriel Vargas",fantasyname:"or Bust 🤡",id:"{648DB07B-E4CC-47B2-96B7-D7F4C4099CC9}",image:"https://g.espncdn.com/lm-static/logo-packs/ffl/BoneHeads-ToddDetwiler/BoneHeads-07b.svg",status:"active"}],years:[{weeks_games:[{games:[{week:"Week 1",playoffTierType:"NONE",winner:"HOME",team_a:[{name:"Ice",owner:"Matthew Melton",ownerId:"{AA6CD04E-A7CA-4F94-919B-35FA5B31E667}",logo:"https://g.espncdn.com/lm-static/logo-packs/core/Incredibles/incredibles_15.svg",score:99.3,rank:8}],team_b:[{name:"Thanos",owner:"Christian Plasencia",ownerId:"{9B329FA4-4F2C-4204-8F5C-1EA6DD54ADA1}",logo:"https://g.espncdn.com/lm-static/logo-packs/core/DIS_Avengers_EndGame/DIS_Avengers_EndGame_Thanos.svg",score:87.22,rank:6}],year:"2019 SEASON"},{week:"Week 1",playoffTierType:"NONE",winner:"AWAY",team_a:[{name:"or Bust 🤡",owner:"Uriel Vargas",ownerId:"{648DB07B-E4CC-47B2-96B7-D7F4C4099CC9}",logo:"https://g.espncdn.com/lm-static/logo-packs/ffl/BoneHeads-ToddDetwiler/BoneHeads-07b.svg",score:95.52,rank:7}],team_b:[{name:"Bombas",owner:"Armando Garcia",ownerId:"{18048C9C-ECBE-43B1-B15B-4B7472580D6D}",logo:"https://g.espncdn.com/lm-static/logo-packs/ffl/AtTheStadium-RobbHarskamp/At_The_Stadium_07.svg",score:102.52,rank:3}],year:"2019 SEASON"},{week:"Week 1",playoffTierType:"NONE",winner:"HOME",team_a:[{name:"Lorenzo",owner:"Giovanni Lorenzo",ownerId:"{020C980B-8440-11D4-820C-00A0C9E58E2D}",logo:"https://g.espncdn.com/lm-static/ffl/images/default_logos/12.svg",score:142.26,rank:2}],team_b:[{name:"Finessers ",owner:"Anthony Chaple",ownerId:"{39E338CD-7398-4D82-8AEA-028DB7FC27B3}",logo:"https://g.espncdn.com/lm-static/logo-packs/ffl/CreepShow-ToddDetwiler/CreepShow-01.svg",score:81.94,rank:9}],year:"2019 SEASON"},{week:"Week 1",playoffTierType:"NONE",winner:"HOME",team_a:[{name:"Slidazz",owner:"Michael Balouch",ownerId:"{10D0AF16-40E0-4E2C-90AF-1640E06E2C06}",logo:"https://g.espncdn.com/lm-static/logo-packs/core/StadiumFoods-ESPN/stadium-foods_tacos.svg",score:166.56,rank:4}],team_b:[{name:"Brees",owner:"Jen Ten",ownerId:"{A54F23FC-66D8-4F47-A2AB-DDFAF68FD306}",logo:"https://g.espncdn.com/lm-static/logo-packs/ffl/TeamKinny-MartinLaksman/TeamKinny-27.svg",score:113.76,rank:5}],year:"2019 SEASON"},{week:"Week 1",playoffTierType:"NONE",winner:"AWAY",team_a:[{name:"Taco Bell",owner:"Michael Dovale",ownerId:"{6A627663-12F0-47CF-A276-6312F097CF1A}",logo:"https://g.espncdn.com/lm-static/logo-packs/core/StadiumFoods-ESPN/stadium-foods_tacos.svg",score:65.24,rank:10}],team_b:[{name:"God",owner:"Michael Martinez",ownerId:"{AB884EFE-8384-4A15-884E-FE83849A1528}",logo:"https://g.espncdn.com/lm-static/logo-packs/ffl/AtTheStadium-RobbHarskamp/At_The_Stadium_16.svg",score:142.04,rank:1}],year:"2019 SEASON"}]},{games:[{week:"Week 2",playoffTierType:"NONE",winner:"HOME",team_a:[{name:"Bombas",owner:"Armando Garcia",ownerId:"{18048C9C-ECBE-43B1-B15B-4B7472580D6D}",logo:"https://g.espncdn.com/lm-static/logo-packs/ffl/AtTheStadium-RobbHarskamp/At_The_Stadium_07.svg",score:123.44,rank:3}],team_b:[{name:"Finessers ",owner:"Anthony Chaple",ownerId:"{39E338CD-7398-4D82-8AEA-028DB7FC27B3}",logo:"https://g.espncdn.com/lm-static/logo-packs/ffl/CreepShow-ToddDetwiler/CreepShow-01.svg",score:78.12,rank:9}],year:"2019 SEASON"},{week:"Week 2",playoffTierType:"NONE",winner:"AWAY",team_a:[{name:"Brees",owner:"Jen Ten",ownerId:"{A54F23FC-66D8-4F47-A2AB-DDFAF68FD306}",logo:"https://g.espncdn.com/lm-static/logo-packs/ffl/TeamKinny-MartinLaksman/TeamKinny-27.svg",score:88.92,rank:5}],team_b:[{name:"Ice",owner:"Matthew Melton",ownerId:"{AA6CD04E-A7CA-4F94-919B-35FA5B31E667}",logo:"https://g.espncdn.com/lm-static/logo-packs/core/Incredibles/incredibles_15.svg",score:114.46,rank:8}],year:"2019 SEASON"},{week:"Week 2",playoffTierType:"NONE",winner:"HOME",team_a:[{name:"God",owner:"Michael Martinez",ownerId:"{AB884EFE-8384-4A15-884E-FE83849A1528}",logo:"https://g.espncdn.com/lm-static/logo-packs/ffl/AtTheStadium-RobbHarskamp/At_The_Stadium_16.svg",score:124.16,rank:1}],team_b:[{name:"Thanos",owner:"Christian Plasencia",ownerId:"{9B329FA4-4F2C-4204-8F5C-1EA6DD54ADA1}",logo:"https://g.espncdn.com/lm-static/logo-packs/core/DIS_Avengers_EndGame/DIS_Avengers_EndGame_Thanos.svg",score:123.92,rank:6}],year:"2019 SEASON"},{week:"Week 2",playoffTierType:"NONE",winner:"AWAY",team_a:[{name:"Slidazz",owner:"Michael Balouch",ownerId:"{10D0AF16-40E0-4E2C-90AF-1640E06E2C06}",logo:"https://g.espncdn.com/lm-static/logo-packs/core/StadiumFoods-ESPN/stadium-foods_tacos.svg",score:96.5,rank:4}],team_b:[{name:"or Bust 🤡",owner:"Uriel Vargas",ownerId:"{648DB07B-E4CC-47B2-96B7-D7F4C4099CC9}",logo:"https://g.espncdn.com/lm-static/logo-packs/ffl/BoneHeads-ToddDetwiler/BoneHeads-07b.svg",score:100.46,rank:7}],year:"2019 SEASON"},{week:"Week 2",playoffTierType:"NONE",winner:"AWAY",team_a:[{name:"Taco Bell",owner:"Michael Dovale",ownerId:"{6A627663-12F0-47CF-A276-6312F097CF1A}",logo:"https://g.espncdn.com/lm-static/logo-packs/core/StadiumFoods-ESPN/stadium-foods_tacos.svg",score:88.16,rank:10}],team_b:[{name:"Lorenzo",owner:"Giovanni Lorenzo",ownerId:"{020C980B-8440-11D4-820C-00A0C9E58E2D}",logo:"https://g.espncdn.com/lm-static/ffl/images/default_logos/12.svg",score:114.18,rank:2}],year:"2019 SEASON"}]},{games:[{week:"Week 3",playoffTierType:"NONE",winner:"AWAY",team_a:[{name:"Brees",owner:"Jen Ten",ownerId:"{A54F23FC-66D8-4F47-A2AB-DDFAF68FD306}",logo:"https://g.espncdn.com/lm-static/logo-packs/ffl/TeamKinny-MartinLaksman/TeamKinny-27.svg",score:127.76,rank:5}],team_b:[{name:"God",owner:"Michael Martinez",ownerId:"{AB884EFE-8384-4A15-884E-FE83849A1528}",logo:"https://g.espncdn.com/lm-static/logo-packs/ffl/AtTheStadium-RobbHarskamp/At_The_Stadium_16.svg",score:141.34,rank:1}],year:"2019 SEASON"},{week:"Week 3",playoffTierType:"NONE",winner:"AWAY",team_a:[{name:"Bombas",owner:"Armando Garcia",ownerId:"{18048C9C-ECBE-43B1-B15B-4B7472580D6D}",logo:"https://g.espncdn.com/lm-static/logo-packs/ffl/AtTheStadium-RobbHarskamp/At_The_Stadium_07.svg",score:156.94,rank:3}],team_b:[{name:"Slidazz",owner:"Michael Balouch",ownerId:"{10D0AF16-40E0-4E2C-90AF-1640E06E2C06}",logo:"https://g.espncdn.com/lm-static/logo-packs/core/StadiumFoods-ESPN/stadium-foods_tacos.svg",score:172.86,rank:4}],year:"2019 SEASON"},{week:"Week 3",playoffTierType:"NONE",winner:"HOME",team_a:[{name:"Finessers ",owner:"Anthony Chaple",ownerId:"{39E338CD-7398-4D82-8AEA-028DB7FC27B3}",logo:"https://g.espncdn.com/lm-static/logo-packs/ffl/CreepShow-ToddDetwiler/CreepShow-01.svg",score:121.82,rank:9}],team_b:[{name:"Taco Bell",owner:"Michael Dovale",ownerId:"{6A627663-12F0-47CF-A276-6312F097CF1A}",logo:"https://g.espncdn.com/lm-static/logo-packs/core/StadiumFoods-ESPN/stadium-foods_tacos.svg",score:84.7,rank:10}],year:"2019 SEASON"},{week:"Week 3",playoffTierType:"NONE",winner:"HOME",team_a:[{name:"Ice",owner:"Matthew Melton",ownerId:"{AA6CD04E-A7CA-4F94-919B-35FA5B31E667}",logo:"https://g.espncdn.com/lm-static/logo-packs/core/Incredibles/incredibles_15.svg",score:97.94,rank:8}],team_b:[{name:"or Bust 🤡",owner:"Uriel Vargas",ownerId:"{648DB07B-E4CC-47B2-96B7-D7F4C4099CC9}",logo:"https://g.espncdn.com/lm-static/logo-packs/ffl/BoneHeads-ToddDetwiler/BoneHeads-07b.svg",score:82.04,rank:7}],year:"2019 SEASON"},{week:"Week 3",playoffTierType:"NONE",winner:"HOME",team_a:[{name:"Thanos",owner:"Christian Plasencia",ownerId:"{9B329FA4-4F2C-4204-8F5C-1EA6DD54ADA1}",logo:"https://g.espncdn.com/lm-static/logo-packs/core/DIS_Avengers_EndGame/DIS_Avengers_EndGame_Thanos.svg",score:109.16,rank:6}],team_b:[{name:"Lorenzo",owner:"Giovanni Lorenzo",ownerId:"{020C980B-8440-11D4-820C-00A0C9E58E2D}",logo:"https://g.espncdn.com/lm-static/ffl/images/default_logos/12.svg",score:106.58,rank:2}],year:"2019 SEASON"}]},{games:[{week:"Week 4",playoffTierType:"NONE",winner:"HOME",team_a:[{name:"Slidazz",owner:"Michael Balouch",ownerId:"{10D0AF16-40E0-4E2C-90AF-1640E06E2C06}",logo:"https://g.espncdn.com/lm-static/logo-packs/core/StadiumFoods-ESPN/stadium-foods_tacos.svg",score:128.38,rank:4}],team_b:[{name:"Taco Bell",owner:"Michael Dovale",ownerId:"{6A627663-12F0-47CF-A276-6312F097CF1A}",logo:"https://g.espncdn.com/lm-static/logo-packs/core/StadiumFoods-ESPN/stadium-foods_tacos.svg",score:115.98,rank:10}],year:"2019 SEASON"},{week:"Week 4",playoffTierType:"NONE",winner:"AWAY",team_a:[{name:"or Bust 🤡",owner:"Uriel Vargas",ownerId:"{648DB07B-E4CC-47B2-96B7-D7F4C4099CC9}",logo:"https://g.espncdn.com/lm-static/logo-packs/ffl/BoneHeads-ToddDetwiler/BoneHeads-07b.svg",score:90.8,rank:7}],team_b:[{name:"Brees",owner:"Jen Ten",ownerId:"{A54F23FC-66D8-4F47-A2AB-DDFAF68FD306}",logo:"https://g.espncdn.com/lm-static/logo-packs/ffl/TeamKinny-MartinLaksman/TeamKinny-27.svg",score:93.7,rank:5}],year:"2019 SEASON"},{week:"Week 4",playoffTierType:"NONE",winner:"HOME",team_a:[{name:"Lorenzo",owner:"Giovanni Lorenzo",ownerId:"{020C980B-8440-11D4-820C-00A0C9E58E2D}",logo:"https://g.espncdn.com/lm-static/ffl/images/default_logos/12.svg",score:131.28,rank:2}],team_b:[{name:"God",owner:"Michael Martinez",ownerId:"{AB884EFE-8384-4A15-884E-FE83849A1528}",logo:"https://g.espncdn.com/lm-static/logo-packs/ffl/AtTheStadium-RobbHarskamp/At_The_Stadium_16.svg",score:85.3,rank:1}],year:"2019 SEASON"},{week:"Week 4",playoffTierType:"NONE",winner:"AWAY",team_a:[{name:"Ice",owner:"Matthew Melton",ownerId:"{AA6CD04E-A7CA-4F94-919B-35FA5B31E667}",logo:"https://g.espncdn.com/lm-static/logo-packs/core/Incredibles/incredibles_15.svg",score:78.82,rank:8}],team_b:[{name:"Bombas",owner:"Armando Garcia",ownerId:"{18048C9C-ECBE-43B1-B15B-4B7472580D6D}",logo:"https://g.espncdn.com/lm-static/logo-packs/ffl/AtTheStadium-RobbHarskamp/At_The_Stadium_07.svg",score:129.9,rank:3}],year:"2019 SEASON"},{week:"Week 4",playoffTierType:"NONE",winner:"HOME",team_a:[{name:"Thanos",owner:"Christian Plasencia",ownerId:"{9B329FA4-4F2C-4204-8F5C-1EA6DD54ADA1}",logo:"https://g.espncdn.com/lm-static/logo-packs/core/DIS_Avengers_EndGame/DIS_Avengers_EndGame_Thanos.svg",score:107.1,rank:6}],team_b:[{name:"Finessers ",owner:"Anthony Chaple",ownerId:"{39E338CD-7398-4D82-8AEA-028DB7FC27B3}",logo:"https://g.espncdn.com/lm-static/logo-packs/ffl/CreepShow-ToddDetwiler/CreepShow-01.svg",score:79.48,rank:9}],year:"2019 SEASON"}]},{games:[{week:"Week 5",playoffTierType:"NONE",winner:"HOME",team_a:[{name:"or Bust 🤡",owner:"Uriel Vargas",ownerId:"{648DB07B-E4CC-47B2-96B7-D7F4C4099CC9}",logo:"https://g.espncdn.com/lm-static/logo-packs/ffl/BoneHeads-ToddDetwiler/BoneHeads-07b.svg",score:135.94,rank:7}],team_b:[{name:"Lorenzo",owner:"Giovanni Lorenzo",ownerId:"{020C980B-8440-11D4-820C-00A0C9E58E2D}",logo:"https://g.espncdn.com/lm-static/ffl/images/default_logos/12.svg",score:130.04,rank:2}],year:"2019 SEASON"},{week:"Week 5",playoffTierType:"NONE",winner:"HOME",team_a:[{name:"Slidazz",owner:"Michael Balouch",ownerId:"{10D0AF16-40E0-4E2C-90AF-1640E06E2C06}",logo:"https://g.espncdn.com/lm-static/logo-packs/core/StadiumFoods-ESPN/stadium-foods_tacos.svg",score:116.96,rank:4}],team_b:[{name:"Ice",owner:"Matthew Melton",ownerId:"{AA6CD04E-A7CA-4F94-919B-35FA5B31E667}",logo:"https://g.espncdn.com/lm-static/logo-packs/core/Incredibles/incredibles_15.svg",score:100.82,rank:8}],year:"2019 SEASON"},{week:"Week 5",playoffTierType:"NONE",winner:"AWAY",team_a:[{name:"Taco Bell",owner:"Michael Dovale",ownerId:"{6A627663-12F0-47CF-A276-6312F097CF1A}",logo:"https://g.espncdn.com/lm-static/logo-packs/core/StadiumFoods-ESPN/stadium-foods_tacos.svg",score:93.22,rank:10}],team_b:[{name:"Thanos",owner:"Christian Plasencia",ownerId:"{9B329FA4-4F2C-4204-8F5C-1EA6DD54ADA1}",logo:"https://g.espncdn.com/lm-static/logo-packs/core/DIS_Avengers_EndGame/DIS_Avengers_EndGame_Thanos.svg",score:98.64,rank:6}],year:"2019 SEASON"},{week:"Week 5",playoffTierType:"NONE",winner:"HOME",team_a:[{name:"Brees",owner:"Jen Ten",ownerId:"{A54F23FC-66D8-4F47-A2AB-DDFAF68FD306}",logo:"https://g.espncdn.com/lm-static/logo-packs/ffl/TeamKinny-MartinLaksman/TeamKinny-27.svg",score:139.06,rank:5}],team_b:[{name:"Bombas",owner:"Armando Garcia",ownerId:"{18048C9C-ECBE-43B1-B15B-4B7472580D6D}",logo:"https://g.espncdn.com/lm-static/logo-packs/ffl/AtTheStadium-RobbHarskamp/At_The_Stadium_07.svg",score:82.16,rank:3}],year:"2019 SEASON"},{week:"Week 5",playoffTierType:"NONE",winner:"HOME",team_a:[{name:"God",owner:"Michael Martinez",ownerId:"{AB884EFE-8384-4A15-884E-FE83849A1528}",logo:"https://g.espncdn.com/lm-static/logo-packs/ffl/AtTheStadium-RobbHarskamp/At_The_Stadium_16.svg",score:171.62,rank:1}],team_b:[{name:"Finessers ",owner:"Anthony Chaple",ownerId:"{39E338CD-7398-4D82-8AEA-028DB7FC27B3}",logo:"https://g.espncdn.com/lm-static/logo-packs/ffl/CreepShow-ToddDetwiler/CreepShow-01.svg",score:130.12,rank:9}],year:"2019 SEASON"}]},{games:[{week:"Week 6",playoffTierType:"NONE",winner:"HOME",team_a:[{name:"Thanos",owner:"Christian Plasencia",ownerId:"{9B329FA4-4F2C-4204-8F5C-1EA6DD54ADA1}",logo:"https://g.espncdn.com/lm-static/logo-packs/core/DIS_Avengers_EndGame/DIS_Avengers_EndGame_Thanos.svg",score:133.02,rank:6}],team_b:[{name:"Bombas",owner:"Armando Garcia",ownerId:"{18048C9C-ECBE-43B1-B15B-4B7472580D6D}",logo:"https://g.espncdn.com/lm-static/logo-packs/ffl/AtTheStadium-RobbHarskamp/At_The_Stadium_07.svg",score:121,rank:3}],year:"2019 SEASON"},{week:"Week 6",playoffTierType:"NONE",winner:"AWAY",team_a:[{name:"Finessers ",owner:"Anthony Chaple",ownerId:"{39E338CD-7398-4D82-8AEA-028DB7FC27B3}",logo:"https://g.espncdn.com/lm-static/logo-packs/ffl/CreepShow-ToddDetwiler/CreepShow-01.svg",score:96.1,rank:9}],team_b:[{name:"Brees",owner:"Jen Ten",ownerId:"{A54F23FC-66D8-4F47-A2AB-DDFAF68FD306}",logo:"https://g.espncdn.com/lm-static/logo-packs/ffl/TeamKinny-MartinLaksman/TeamKinny-27.svg",score:101.3,rank:5}],year:"2019 SEASON"},{week:"Week 6",playoffTierType:"NONE",winner:"HOME",team_a:[{name:"God",owner:"Michael Martinez",ownerId:"{AB884EFE-8384-4A15-884E-FE83849A1528}",logo:"https://g.espncdn.com/lm-static/logo-packs/ffl/AtTheStadium-RobbHarskamp/At_The_Stadium_16.svg",score:130.36,rank:1}],team_b:[{name:"Slidazz",owner:"Michael Balouch",ownerId:"{10D0AF16-40E0-4E2C-90AF-1640E06E2C06}",logo:"https://g.espncdn.com/lm-static/logo-packs/core/StadiumFoods-ESPN/stadium-foods_tacos.svg",score:96.34,rank:4}],year:"2019 SEASON"},{week:"Week 6",playoffTierType:"NONE",winner:"AWAY",team_a:[{name:"Taco Bell",owner:"Michael Dovale",ownerId:"{6A627663-12F0-47CF-A276-6312F097CF1A}",logo:"https://g.espncdn.com/lm-static/logo-packs/core/StadiumFoods-ESPN/stadium-foods_tacos.svg",score:103.12,rank:10}],team_b:[{name:"or Bust 🤡",owner:"Uriel Vargas",ownerId:"{648DB07B-E4CC-47B2-96B7-D7F4C4099CC9}",logo:"https://g.espncdn.com/lm-static/logo-packs/ffl/BoneHeads-ToddDetwiler/BoneHeads-07b.svg",score:121.5,rank:7}],year:"2019 SEASON"},{week:"Week 6",playoffTierType:"NONE",winner:"HOME",team_a:[{name:"Lorenzo",owner:"Giovanni Lorenzo",ownerId:"{020C980B-8440-11D4-820C-00A0C9E58E2D}",logo:"https://g.espncdn.com/lm-static/ffl/images/default_logos/12.svg",score:139.44,rank:2}],team_b:[{name:"Ice",owner:"Matthew Melton",ownerId:"{AA6CD04E-A7CA-4F94-919B-35FA5B31E667}",logo:"https://g.espncdn.com/lm-static/logo-packs/core/Incredibles/incredibles_15.svg",score:82.42,rank:8}],year:"2019 SEASON"}]},{games:[{week:"Week 7",playoffTierType:"NONE",winner:"HOME",team_a:[{name:"Brees",owner:"Jen Ten",ownerId:"{A54F23FC-66D8-4F47-A2AB-DDFAF68FD306}",logo:"https://g.espncdn.com/lm-static/logo-packs/ffl/TeamKinny-MartinLaksman/TeamKinny-27.svg",score:88.2,rank:5}],team_b:[{name:"Thanos",owner:"Christian Plasencia",ownerId:"{9B329FA4-4F2C-4204-8F5C-1EA6DD54ADA1}",logo:"https://g.espncdn.com/lm-static/logo-packs/core/DIS_Avengers_EndGame/DIS_Avengers_EndGame_Thanos.svg",score:79.84,rank:6}],year:"2019 SEASON"},{week:"Week 7",playoffTierType:"NONE",winner:"AWAY",team_a:[{name:"Slidazz",owner:"Michael Balouch",ownerId:"{10D0AF16-40E0-4E2C-90AF-1640E06E2C06}",logo:"https://g.espncdn.com/lm-static/logo-packs/core/StadiumFoods-ESPN/stadium-foods_tacos.svg",score:62.06,rank:4}],team_b:[{name:"Finessers ",owner:"Anthony Chaple",ownerId:"{39E338CD-7398-4D82-8AEA-028DB7FC27B3}",logo:"https://g.espncdn.com/lm-static/logo-packs/ffl/CreepShow-ToddDetwiler/CreepShow-01.svg",score:103.16,rank:9}],year:"2019 SEASON"},{week:"Week 7",playoffTierType:"NONE",winner:"HOME",team_a:[{name:"or Bust 🤡",owner:"Uriel Vargas",ownerId:"{648DB07B-E4CC-47B2-96B7-D7F4C4099CC9}",logo:"https://g.espncdn.com/lm-static/logo-packs/ffl/BoneHeads-ToddDetwiler/BoneHeads-07b.svg",score:114.02,rank:7}],team_b:[{name:"God",owner:"Michael Martinez",ownerId:"{AB884EFE-8384-4A15-884E-FE83849A1528}",logo:"https://g.espncdn.com/lm-static/logo-packs/ffl/AtTheStadium-RobbHarskamp/At_The_Stadium_16.svg",score:70.96,rank:1}],year:"2019 SEASON"},{week:"Week 7",playoffTierType:"NONE",winner:"AWAY",team_a:[{name:"Ice",owner:"Matthew Melton",ownerId:"{AA6CD04E-A7CA-4F94-919B-35FA5B31E667}",logo:"https://g.espncdn.com/lm-static/logo-packs/core/Incredibles/incredibles_15.svg",score:110.16,rank:8}],team_b:[{name:"Taco Bell",owner:"Michael Dovale",ownerId:"{6A627663-12F0-47CF-A276-6312F097CF1A}",logo:"https://g.espncdn.com/lm-static/logo-packs/core/StadiumFoods-ESPN/stadium-foods_tacos.svg",score:113.76,rank:10}],year:"2019 SEASON"},{week:"Week 7",playoffTierType:"NONE",winner:"HOME",team_a:[{name:"Bombas",owner:"Armando Garcia",ownerId:"{18048C9C-ECBE-43B1-B15B-4B7472580D6D}",logo:"https://g.espncdn.com/lm-static/logo-packs/ffl/AtTheStadium-RobbHarskamp/At_The_Stadium_07.svg",score:110.74,rank:3}],team_b:[{name:"Lorenzo",owner:"Giovanni Lorenzo",ownerId:"{020C980B-8440-11D4-820C-00A0C9E58E2D}",logo:"https://g.espncdn.com/lm-static/ffl/images/default_logos/12.svg",score:109.32,rank:2}],year:"2019 SEASON"}]},{games:[{week:"Week 8",playoffTierType:"NONE",winner:"HOME",team_a:[{name:"Thanos",owner:"Christian Plasencia",ownerId:"{9B329FA4-4F2C-4204-8F5C-1EA6DD54ADA1}",logo:"https://g.espncdn.com/lm-static/logo-packs/core/DIS_Avengers_EndGame/DIS_Avengers_EndGame_Thanos.svg",score:118.9,rank:6}],team_b:[{name:"Slidazz",owner:"Michael Balouch",ownerId:"{10D0AF16-40E0-4E2C-90AF-1640E06E2C06}",logo:"https://g.espncdn.com/lm-static/logo-packs/core/StadiumFoods-ESPN/stadium-foods_tacos.svg",score:107.48,rank:4}],year:"2019 SEASON"},{week:"Week 8",playoffTierType:"NONE",winner:"HOME",team_a:[{name:"Finessers ",owner:"Anthony Chaple",ownerId:"{39E338CD-7398-4D82-8AEA-028DB7FC27B3}",logo:"https://g.espncdn.com/lm-static/logo-packs/ffl/CreepShow-ToddDetwiler/CreepShow-01.svg",score:124.7,rank:9}],team_b:[{name:"or Bust 🤡",owner:"Uriel Vargas",ownerId:"{648DB07B-E4CC-47B2-96B7-D7F4C4099CC9}",logo:"https://g.espncdn.com/lm-static/logo-packs/ffl/BoneHeads-ToddDetwiler/BoneHeads-07b.svg",score:104.36,rank:7}],year:"2019 SEASON"},{week:"Week 8",playoffTierType:"NONE",winner:"HOME",team_a:[{name:"God",owner:"Michael Martinez",ownerId:"{AB884EFE-8384-4A15-884E-FE83849A1528}",logo:"https://g.espncdn.com/lm-static/logo-packs/ffl/AtTheStadium-RobbHarskamp/At_The_Stadium_16.svg",score:106.16,rank:1}],team_b:[{name:"Ice",owner:"Matthew Melton",ownerId:"{AA6CD04E-A7CA-4F94-919B-35FA5B31E667}",logo:"https://g.espncdn.com/lm-static/logo-packs/core/Incredibles/incredibles_15.svg",score:79.46,rank:8}],year:"2019 SEASON"},{week:"Week 8",playoffTierType:"NONE",winner:"AWAY",team_a:[{name:"Taco Bell",owner:"Michael Dovale",ownerId:"{6A627663-12F0-47CF-A276-6312F097CF1A}",logo:"https://g.espncdn.com/lm-static/logo-packs/core/StadiumFoods-ESPN/stadium-foods_tacos.svg",score:95.8,rank:10}],team_b:[{name:"Bombas",owner:"Armando Garcia",ownerId:"{18048C9C-ECBE-43B1-B15B-4B7472580D6D}",logo:"https://g.espncdn.com/lm-static/logo-packs/ffl/AtTheStadium-RobbHarskamp/At_The_Stadium_07.svg",score:163.48,rank:3}],year:"2019 SEASON"},{week:"Week 8",playoffTierType:"NONE",winner:"AWAY",team_a:[{name:"Lorenzo",owner:"Giovanni Lorenzo",ownerId:"{020C980B-8440-11D4-820C-00A0C9E58E2D}",logo:"https://g.espncdn.com/lm-static/ffl/images/default_logos/12.svg",score:105.66,rank:2}],team_b:[{name:"Brees",owner:"Jen Ten",ownerId:"{A54F23FC-66D8-4F47-A2AB-DDFAF68FD306}",logo:"https://g.espncdn.com/lm-static/logo-packs/ffl/TeamKinny-MartinLaksman/TeamKinny-27.svg",score:117.34,rank:5}],year:"2019 SEASON"}]},{games:[{week:"Week 9",playoffTierType:"NONE",winner:"HOME",team_a:[{name:"or Bust 🤡",owner:"Uriel Vargas",ownerId:"{648DB07B-E4CC-47B2-96B7-D7F4C4099CC9}",logo:"https://g.espncdn.com/lm-static/logo-packs/ffl/BoneHeads-ToddDetwiler/BoneHeads-07b.svg",score:106.54,rank:7}],team_b:[{name:"Thanos",owner:"Christian Plasencia",ownerId:"{9B329FA4-4F2C-4204-8F5C-1EA6DD54ADA1}",logo:"https://g.espncdn.com/lm-static/logo-packs/core/DIS_Avengers_EndGame/DIS_Avengers_EndGame_Thanos.svg",score:69.6,rank:6}],year:"2019 SEASON"},{week:"Week 9",playoffTierType:"NONE",winner:"AWAY",team_a:[{name:"Ice",owner:"Matthew Melton",ownerId:"{AA6CD04E-A7CA-4F94-919B-35FA5B31E667}",logo:"https://g.espncdn.com/lm-static/logo-packs/core/Incredibles/incredibles_15.svg",score:97.48,rank:8}],team_b:[{name:"Slidazz",owner:"Michael Balouch",ownerId:"{10D0AF16-40E0-4E2C-90AF-1640E06E2C06}",logo:"https://g.espncdn.com/lm-static/logo-packs/core/StadiumFoods-ESPN/stadium-foods_tacos.svg",score:104.84,rank:4}],year:"2019 SEASON"},{week:"Week 9",playoffTierType:"NONE",winner:"AWAY",team_a:[{name:"Finessers ",owner:"Anthony Chaple",ownerId:"{39E338CD-7398-4D82-8AEA-028DB7FC27B3}",logo:"https://g.espncdn.com/lm-static/logo-packs/ffl/CreepShow-ToddDetwiler/CreepShow-01.svg",score:112.44,rank:9}],team_b:[{name:"Lorenzo",owner:"Giovanni Lorenzo",ownerId:"{020C980B-8440-11D4-820C-00A0C9E58E2D}",logo:"https://g.espncdn.com/lm-static/ffl/images/default_logos/12.svg",score:119.8,rank:2}],year:"2019 SEASON"},{week:"Week 9",playoffTierType:"NONE",winner:"HOME",team_a:[{name:"Bombas",owner:"Armando Garcia",ownerId:"{18048C9C-ECBE-43B1-B15B-4B7472580D6D}",logo:"https://g.espncdn.com/lm-static/logo-packs/ffl/AtTheStadium-RobbHarskamp/At_The_Stadium_07.svg",score:152.32,rank:3}],team_b:[{name:"Brees",owner:"Jen Ten",ownerId:"{A54F23FC-66D8-4F47-A2AB-DDFAF68FD306}",logo:"https://g.espncdn.com/lm-static/logo-packs/ffl/TeamKinny-MartinLaksman/TeamKinny-27.svg",score:99.16,rank:5}],year:"2019 SEASON"},{week:"Week 9",playoffTierType:"NONE",winner:"HOME",team_a:[{name:"God",owner:"Michael Martinez",ownerId:"{AB884EFE-8384-4A15-884E-FE83849A1528}",logo:"https://g.espncdn.com/lm-static/logo-packs/ffl/AtTheStadium-RobbHarskamp/At_The_Stadium_16.svg",score:123,rank:1}],team_b:[{name:"Taco Bell",owner:"Michael Dovale",ownerId:"{6A627663-12F0-47CF-A276-6312F097CF1A}",logo:"https://g.espncdn.com/lm-static/logo-packs/core/StadiumFoods-ESPN/stadium-foods_tacos.svg",score:79.84,rank:10}],year:"2019 SEASON"}]},{games:[{week:"Week 10",playoffTierType:"NONE",winner:"HOME",team_a:[{name:"Ice",owner:"Matthew Melton",ownerId:"{AA6CD04E-A7CA-4F94-919B-35FA5B31E667}",logo:"https://g.espncdn.com/lm-static/logo-packs/core/Incredibles/incredibles_15.svg",score:119.88,rank:8}],team_b:[{name:"Finessers ",owner:"Anthony Chaple",ownerId:"{39E338CD-7398-4D82-8AEA-028DB7FC27B3}",logo:"https://g.espncdn.com/lm-static/logo-packs/ffl/CreepShow-ToddDetwiler/CreepShow-01.svg",score:73.78,rank:9}],year:"2019 SEASON"},{week:"Week 10",playoffTierType:"NONE",winner:"HOME",team_a:[{name:"Bombas",owner:"Armando Garcia",ownerId:"{18048C9C-ECBE-43B1-B15B-4B7472580D6D}",logo:"https://g.espncdn.com/lm-static/logo-packs/ffl/AtTheStadium-RobbHarskamp/At_The_Stadium_07.svg",score:120.88,rank:3}],team_b:[{name:"or Bust 🤡",owner:"Uriel Vargas",ownerId:"{648DB07B-E4CC-47B2-96B7-D7F4C4099CC9}",logo:"https://g.espncdn.com/lm-static/logo-packs/ffl/BoneHeads-ToddDetwiler/BoneHeads-07b.svg",score:112.22,rank:7}],year:"2019 SEASON"},{week:"Week 10",playoffTierType:"NONE",winner:"AWAY",team_a:[{name:"Thanos",owner:"Christian Plasencia",ownerId:"{9B329FA4-4F2C-4204-8F5C-1EA6DD54ADA1}",logo:"https://g.espncdn.com/lm-static/logo-packs/core/DIS_Avengers_EndGame/DIS_Avengers_EndGame_Thanos.svg",score:121.24,rank:6}],team_b:[{name:"God",owner:"Michael Martinez",ownerId:"{AB884EFE-8384-4A15-884E-FE83849A1528}",logo:"https://g.espncdn.com/lm-static/logo-packs/ffl/AtTheStadium-RobbHarskamp/At_The_Stadium_16.svg",score:137.22,rank:1}],year:"2019 SEASON"},{week:"Week 10",playoffTierType:"NONE",winner:"AWAY",team_a:[{name:"Brees",owner:"Jen Ten",ownerId:"{A54F23FC-66D8-4F47-A2AB-DDFAF68FD306}",logo:"https://g.espncdn.com/lm-static/logo-packs/ffl/TeamKinny-MartinLaksman/TeamKinny-27.svg",score:81.92,rank:5}],team_b:[{name:"Slidazz",owner:"Michael Balouch",ownerId:"{10D0AF16-40E0-4E2C-90AF-1640E06E2C06}",logo:"https://g.espncdn.com/lm-static/logo-packs/core/StadiumFoods-ESPN/stadium-foods_tacos.svg",score:97.28,rank:4}],year:"2019 SEASON"},{week:"Week 10",playoffTierType:"NONE",winner:"HOME",team_a:[{name:"Lorenzo",owner:"Giovanni Lorenzo",ownerId:"{020C980B-8440-11D4-820C-00A0C9E58E2D}",logo:"https://g.espncdn.com/lm-static/ffl/images/default_logos/12.svg",score:130.52,rank:2}],team_b:[{name:"Taco Bell",owner:"Michael Dovale",ownerId:"{6A627663-12F0-47CF-A276-6312F097CF1A}",logo:"https://g.espncdn.com/lm-static/logo-packs/core/StadiumFoods-ESPN/stadium-foods_tacos.svg",score:79.72,rank:10}],year:"2019 SEASON"}]},{games:[{week:"Week 11",playoffTierType:"NONE",winner:"AWAY",team_a:[{name:"Bombas",owner:"Armando Garcia",ownerId:"{18048C9C-ECBE-43B1-B15B-4B7472580D6D}",logo:"https://g.espncdn.com/lm-static/logo-packs/ffl/AtTheStadium-RobbHarskamp/At_The_Stadium_07.svg",score:66.76,rank:3}],team_b:[{name:"God",owner:"Michael Martinez",ownerId:"{AB884EFE-8384-4A15-884E-FE83849A1528}",logo:"https://g.espncdn.com/lm-static/logo-packs/ffl/AtTheStadium-RobbHarskamp/At_The_Stadium_16.svg",score:96.14,rank:1}],year:"2019 SEASON"},{week:"Week 11",playoffTierType:"NONE",winner:"AWAY",team_a:[{name:"Ice",owner:"Matthew Melton",ownerId:"{AA6CD04E-A7CA-4F94-919B-35FA5B31E667}",logo:"https://g.espncdn.com/lm-static/logo-packs/core/Incredibles/incredibles_15.svg",score:108.36,rank:8}],team_b:[{name:"Brees",owner:"Jen Ten",ownerId:"{A54F23FC-66D8-4F47-A2AB-DDFAF68FD306}",logo:"https://g.espncdn.com/lm-static/logo-packs/ffl/TeamKinny-MartinLaksman/TeamKinny-27.svg",score:116.36,rank:5}],year:"2019 SEASON"},{week:"Week 11",playoffTierType:"NONE",winner:"HOME",team_a:[{name:"Taco Bell",owner:"Michael Dovale",ownerId:"{6A627663-12F0-47CF-A276-6312F097CF1A}",logo:"https://g.espncdn.com/lm-static/logo-packs/core/StadiumFoods-ESPN/stadium-foods_tacos.svg",score:101.62,rank:10}],team_b:[{name:"Finessers ",owner:"Anthony Chaple",ownerId:"{39E338CD-7398-4D82-8AEA-028DB7FC27B3}",logo:"https://g.espncdn.com/lm-static/logo-packs/ffl/CreepShow-ToddDetwiler/CreepShow-01.svg",score:82.12,rank:9}],year:"2019 SEASON"},{week:"Week 11",playoffTierType:"NONE",winner:"AWAY",team_a:[{name:"or Bust 🤡",owner:"Uriel Vargas",ownerId:"{648DB07B-E4CC-47B2-96B7-D7F4C4099CC9}",logo:"https://g.espncdn.com/lm-static/logo-packs/ffl/BoneHeads-ToddDetwiler/BoneHeads-07b.svg",score:88.38,rank:7}],team_b:[{name:"Slidazz",owner:"Michael Balouch",ownerId:"{10D0AF16-40E0-4E2C-90AF-1640E06E2C06}",logo:"https://g.espncdn.com/lm-static/logo-packs/core/StadiumFoods-ESPN/stadium-foods_tacos.svg",score:141.58,rank:4}],year:"2019 SEASON"},{week:"Week 11",playoffTierType:"NONE",winner:"HOME",team_a:[{name:"Lorenzo",owner:"Giovanni Lorenzo",ownerId:"{020C980B-8440-11D4-820C-00A0C9E58E2D}",logo:"https://g.espncdn.com/lm-static/ffl/images/default_logos/12.svg",score:102.18,rank:2}],team_b:[{name:"Thanos",owner:"Christian Plasencia",ownerId:"{9B329FA4-4F2C-4204-8F5C-1EA6DD54ADA1}",logo:"https://g.espncdn.com/lm-static/logo-packs/core/DIS_Avengers_EndGame/DIS_Avengers_EndGame_Thanos.svg",score:87.38,rank:6}],year:"2019 SEASON"}]},{games:[{week:"Week 12",playoffTierType:"NONE",winner:"HOME",team_a:[{name:"Brees",owner:"Jen Ten",ownerId:"{A54F23FC-66D8-4F47-A2AB-DDFAF68FD306}",logo:"https://g.espncdn.com/lm-static/logo-packs/ffl/TeamKinny-MartinLaksman/TeamKinny-27.svg",score:99.48,rank:5}],team_b:[{name:"Taco Bell",owner:"Michael Dovale",ownerId:"{6A627663-12F0-47CF-A276-6312F097CF1A}",logo:"https://g.espncdn.com/lm-static/logo-packs/core/StadiumFoods-ESPN/stadium-foods_tacos.svg",score:64.46,rank:10}],year:"2019 SEASON"},{week:"Week 12",playoffTierType:"NONE",winner:"HOME",team_a:[{name:"Slidazz",owner:"Michael Balouch",ownerId:"{10D0AF16-40E0-4E2C-90AF-1640E06E2C06}",logo:"https://g.espncdn.com/lm-static/logo-packs/core/StadiumFoods-ESPN/stadium-foods_tacos.svg",score:108.74,rank:4}],team_b:[{name:"Bombas",owner:"Armando Garcia",ownerId:"{18048C9C-ECBE-43B1-B15B-4B7472580D6D}",logo:"https://g.espncdn.com/lm-static/logo-packs/ffl/AtTheStadium-RobbHarskamp/At_The_Stadium_07.svg",score:65.7,rank:3}],year:"2019 SEASON"},{week:"Week 12",playoffTierType:"NONE",winner:"AWAY",team_a:[{name:"God",owner:"Michael Martinez",ownerId:"{AB884EFE-8384-4A15-884E-FE83849A1528}",logo:"https://g.espncdn.com/lm-static/logo-packs/ffl/AtTheStadium-RobbHarskamp/At_The_Stadium_16.svg",score:61,rank:1}],team_b:[{name:"Lorenzo",owner:"Giovanni Lorenzo",ownerId:"{020C980B-8440-11D4-820C-00A0C9E58E2D}",logo:"https://g.espncdn.com/lm-static/ffl/images/default_logos/12.svg",score:139.56,rank:2}],year:"2019 SEASON"},{week:"Week 12",playoffTierType:"NONE",winner:"HOME",team_a:[{name:"or Bust 🤡",owner:"Uriel Vargas",ownerId:"{648DB07B-E4CC-47B2-96B7-D7F4C4099CC9}",logo:"https://g.espncdn.com/lm-static/logo-packs/ffl/BoneHeads-ToddDetwiler/BoneHeads-07b.svg",score:119.82,rank:7}],team_b:[{name:"Ice",owner:"Matthew Melton",ownerId:"{AA6CD04E-A7CA-4F94-919B-35FA5B31E667}",logo:"https://g.espncdn.com/lm-static/logo-packs/core/Incredibles/incredibles_15.svg",score:108.88,rank:8}],year:"2019 SEASON"},{week:"Week 12",playoffTierType:"NONE",winner:"AWAY",team_a:[{name:"Finessers ",owner:"Anthony Chaple",ownerId:"{39E338CD-7398-4D82-8AEA-028DB7FC27B3}",logo:"https://g.espncdn.com/lm-static/logo-packs/ffl/CreepShow-ToddDetwiler/CreepShow-01.svg",score:62.74,rank:9}],team_b:[{name:"Thanos",owner:"Christian Plasencia",ownerId:"{9B329FA4-4F2C-4204-8F5C-1EA6DD54ADA1}",logo:"https://g.espncdn.com/lm-static/logo-packs/core/DIS_Avengers_EndGame/DIS_Avengers_EndGame_Thanos.svg",score:98.56,rank:6}],year:"2019 SEASON" }]},{games:[{week:"Week 13",playoffTierType:"NONE",winner:"AWAY",team_a:[{name:"Slidazz",owner:"Michael Balouch",ownerId:"{10D0AF16-40E0-4E2C-90AF-1640E06E2C06}",logo:"https://g.espncdn.com/lm-static/logo-packs/core/StadiumFoods-ESPN/stadium-foods_tacos.svg",score:100.18,rank:4}],team_b:[{name:"Lorenzo",owner:"Giovanni Lorenzo",ownerId:"{020C980B-8440-11D4-820C-00A0C9E58E2D}",logo:"https://g.espncdn.com/lm-static/ffl/images/default_logos/12.svg",score:111.24,rank:2}],year:"2019 SEASON"},{week:"Week 13",playoffTierType:"NONE",winner:"HOME",team_a:[{name:"Brees",owner:"Jen Ten",ownerId:"{A54F23FC-66D8-4F47-A2AB-DDFAF68FD306}",logo:"https://g.espncdn.com/lm-static/logo-packs/ffl/TeamKinny-MartinLaksman/TeamKinny-27.svg",score:92.5,rank:5}],team_b:[{name:"or Bust 🤡",owner:"Uriel Vargas",ownerId:"{648DB07B-E4CC-47B2-96B7-D7F4C4099CC9}",logo:"https://g.espncdn.com/lm-static/logo-packs/ffl/BoneHeads-ToddDetwiler/BoneHeads-07b.svg",score:71.52,rank:7}],year:"2019 SEASON"},{week:"Week 13",playoffTierType:"NONE",winner:"HOME",team_a:[{name:"Thanos",owner:"Christian Plasencia",ownerId:"{9B329FA4-4F2C-4204-8F5C-1EA6DD54ADA1}",logo:"https://g.espncdn.com/lm-static/logo-packs/core/DIS_Avengers_EndGame/DIS_Avengers_EndGame_Thanos.svg",score:82.5,rank:6}],team_b:[{name:"Taco Bell",owner:"Michael Dovale",ownerId:"{6A627663-12F0-47CF-A276-6312F097CF1A}",logo:"https://g.espncdn.com/lm-static/logo-packs/core/StadiumFoods-ESPN/stadium-foods_tacos.svg",score:81.14,rank:10}],year:"2019 SEASON"},{week:"Week 13",playoffTierType:"NONE",winner:"HOME",team_a:[{name:"Bombas",owner:"Armando Garcia",ownerId:"{18048C9C-ECBE-43B1-B15B-4B7472580D6D}",logo:"https://g.espncdn.com/lm-static/logo-packs/ffl/AtTheStadium-RobbHarskamp/At_The_Stadium_07.svg",score:134.9,rank:3}],team_b:[{name:"Ice",owner:"Matthew Melton",ownerId:"{AA6CD04E-A7CA-4F94-919B-35FA5B31E667}",logo:"https://g.espncdn.com/lm-static/logo-packs/core/Incredibles/incredibles_15.svg",score:115.6,rank:8}],year:"2019 SEASON"},{week:"Week 13",playoffTierType:"NONE",winner:"AWAY",team_a:[{name:"Finessers ",owner:"Anthony Chaple",ownerId:"{39E338CD-7398-4D82-8AEA-028DB7FC27B3}",logo:"https://g.espncdn.com/lm-static/logo-packs/ffl/CreepShow-ToddDetwiler/CreepShow-01.svg",score:98.96,rank:9}],team_b:[{name:"God",owner:"Michael Martinez",ownerId:"{AB884EFE-8384-4A15-884E-FE83849A1528}",logo:"https://g.espncdn.com/lm-static/logo-packs/ffl/AtTheStadium-RobbHarskamp/At_The_Stadium_16.svg",score:104.34,rank:1}],year:"2019 SEASON"}]},{games:[{week:"Week 14",playoffTierType:"WINNERS_BRACKET",winner:"HOME",team_a:[{name:"Slidazz",owner:"Michael Balouch",ownerId:"{10D0AF16-40E0-4E2C-90AF-1640E06E2C06}",logo:"https://g.espncdn.com/lm-static/logo-packs/core/StadiumFoods-ESPN/stadium-foods_tacos.svg",score:122.34,rank:4}],team_b:[{name:"Brees",owner:"Jen Ten",ownerId:"{A54F23FC-66D8-4F47-A2AB-DDFAF68FD306}",logo:"https://g.espncdn.com/lm-static/logo-packs/ffl/TeamKinny-MartinLaksman/TeamKinny-27.svg",score:67.36,rank:5}],year:"2019 SEASON"},{week:"Week 14",playoffTierType:"WINNERS_BRACKET",winner:"HOME",team_a:[{name:"Bombas",owner:"Armando Garcia",ownerId:"{18048C9C-ECBE-43B1-B15B-4B7472580D6D}",logo:"https://g.espncdn.com/lm-static/logo-packs/ffl/AtTheStadium-RobbHarskamp/At_The_Stadium_07.svg",score:105.8,rank:3}],team_b:[{name:"Thanos",owner:"Christian Plasencia",ownerId:"{9B329FA4-4F2C-4204-8F5C-1EA6DD54ADA1}",logo:"https://g.espncdn.com/lm-static/logo-packs/core/DIS_Avengers_EndGame/DIS_Avengers_EndGame_Thanos.svg",score:87.78,rank:6}],year:"2019 SEASON"}]},{games:[{week:"Week 15",playoffTierType:"WINNERS_BRACKET",winner:"AWAY",team_a:[{name:"God",owner:"Michael Martinez",ownerId:"{AB884EFE-8384-4A15-884E-FE83849A1528}",logo:"https://g.espncdn.com/lm-static/logo-packs/ffl/AtTheStadium-RobbHarskamp/At_The_Stadium_16.svg",score:69.42,rank:1}],team_b:[{name:"Slidazz",owner:"Michael Balouch",ownerId:"{10D0AF16-40E0-4E2C-90AF-1640E06E2C06}",logo:"https://g.espncdn.com/lm-static/logo-packs/core/StadiumFoods-ESPN/stadium-foods_tacos.svg",score:143.16,rank:4}],year:"2019 SEASON"},{week:"Week 15",playoffTierType:"WINNERS_BRACKET",winner:"HOME",team_a:[{name:"Lorenzo",owner:"Giovanni Lorenzo",ownerId:"{020C980B-8440-11D4-820C-00A0C9E58E2D}",logo:"https://g.espncdn.com/lm-static/ffl/images/default_logos/12.svg",score:135.48,rank:2}],team_b:[{name:"Bombas",owner:"Armando Garcia",ownerId:"{18048C9C-ECBE-43B1-B15B-4B7472580D6D}",logo:"https://g.espncdn.com/lm-static/logo-packs/ffl/AtTheStadium-RobbHarskamp/At_The_Stadium_07.svg",score:122.44,rank:3}],year:"2019 SEASON"},{week:"Week 15",playoffTierType:"WINNERS_CONSOLATION_LADDER",winner:"AWAY",team_a:[{name:"Brees",owner:"Jen Ten",ownerId:"{A54F23FC-66D8-4F47-A2AB-DDFAF68FD306}",logo:"https://g.espncdn.com/lm-static/logo-packs/ffl/TeamKinny-MartinLaksman/TeamKinny-27.svg",score:87.8,rank:5}],team_b:[{name:"Thanos",owner:"Christian Plasencia",ownerId:"{9B329FA4-4F2C-4204-8F5C-1EA6DD54ADA1}",logo:"https://g.espncdn.com/lm-static/logo-packs/core/DIS_Avengers_EndGame/DIS_Avengers_EndGame_Thanos.svg",score:129.5,rank:6}],year:"2019 SEASON"}]},{games:[{week:"Week 16",playoffTierType:"WINNERS_BRACKET",winner:"AWAY",team_a:[{name:"Lorenzo",owner:"Giovanni Lorenzo",ownerId:"{020C980B-8440-11D4-820C-00A0C9E58E2D}",logo:"https://g.espncdn.com/lm-static/ffl/images/default_logos/12.svg",score:86.32,rank:2}],team_b:[{name:"Slidazz",owner:"Michael Balouch",ownerId:"{10D0AF16-40E0-4E2C-90AF-1640E06E2C06}",logo:"https://g.espncdn.com/lm-static/logo-packs/core/StadiumFoods-ESPN/stadium-foods_tacos.svg",score:112.86,rank:4}],year:"2019 SEASON"},{week:"Week 16",playoffTierType:"WINNERS_CONSOLATION_LADDER",winner:"HOME",team_a:[{name:"God",owner:"Michael Martinez",ownerId:"{AB884EFE-8384-4A15-884E-FE83849A1528}",logo:"https://g.espncdn.com/lm-static/logo-packs/ffl/AtTheStadium-RobbHarskamp/At_The_Stadium_16.svg",score:132.34,rank:1}],team_b:[{name:"Bombas",owner:"Armando Garcia",ownerId:"{18048C9C-ECBE-43B1-B15B-4B7472580D6D}",logo:"https://g.espncdn.com/lm-static/logo-packs/ffl/AtTheStadium-RobbHarskamp/At_The_Stadium_07.svg",score:131.56,rank:3}],year:"2019 SEASON"},{week:"Week 16",playoffTierType:"WINNERS_CONSOLATION_LADDER",winner:"HOME",team_a:[{name:"Brees",owner:"Jen Ten",ownerId:"{A54F23FC-66D8-4F47-A2AB-DDFAF68FD306}",logo:"https://g.espncdn.com/lm-static/logo-packs/ffl/TeamKinny-MartinLaksman/TeamKinny-27.svg",score:96.82,rank:5}],team_b:[{name:"Thanos",owner:"Christian Plasencia",ownerId:"{9B329FA4-4F2C-4204-8F5C-1EA6DD54ADA1}",logo:"https://g.espncdn.com/lm-static/logo-packs/core/DIS_Avengers_EndGame/DIS_Avengers_EndGame_Thanos.svg",score:78.54,rank:6}],year:"2019 SEASON"}]}]}]}}]}},pathContext:{}}}}); //# sourceMappingURL=path---index-33c0f73a6c2da276d82b.js.map
const CLIENT_ID = process.env.CLIENT_ID || '{clientId}'; const ISSUER = process.env.ISSUER || 'https://{yourOktaDomain}.com/oauth2/default'; const OKTA_TESTING_DISABLEHTTPSCHECK = process.env.OKTA_TESTING_DISABLEHTTPSCHECK || false; const REDIRECT_URI = `${window.location.origin}/login/callback`; export default { oidc: { clientId: CLIENT_ID, issuer: ISSUER, redirectUri: REDIRECT_URI, scopes: ['openid', 'profile', 'email', 'offline_access'], pkce: true, disableHttpsCheck: OKTA_TESTING_DISABLEHTTPSCHECK, }, resourceServer: { messagesUrl: 'http://localhost:8000/api/messages', }, };
var _ = require('lodash') module.exports = function DeviceControlCtrl($scope, DeviceService, GroupService, $location, $timeout, $window, $rootScope, ControlService) { $scope.showScreen = true $scope.groupTracker = DeviceService.trackGroup($scope) $scope.groupDevices = $scope.groupTracker.devices $scope.kickDevice = function(device) { if (!device || !$scope.device) { alert('No device found') return } try { // If we're trying to kick current device if (device.serial === $scope.device.serial) { // If there is more than one device left if ($scope.groupDevices.length > 1) { // Control first free device first var firstFreeDevice = _.find($scope.groupDevices, function(dev) { return dev.serial !== $scope.device.serial }) $scope.controlDevice(firstFreeDevice) // Then kick the old device GroupService.kick(device).then(function() { $scope.$digest() }) } else { // Kick the device GroupService.kick(device).then(function() { $scope.$digest() }) $location.path('/devices/') } } else { GroupService.kick(device).then(function() { $scope.$digest() }) } } catch (e) { alert(e.message) } } $scope.controlDevice = function(device) { $location.path('/control/' + device.serial) } function isPortrait(val) { var value = val if (typeof value === 'undefined' && $scope.device) { value = $scope.device.display.rotation } return (value === 0 || value === 180) } function isLandscape(val) { var value = val if (typeof value === 'undefined' && $scope.device) { value = $scope.device.display.rotation } return (value === 90 || value === 270) } $scope.tryToRotate = function(rotation) { if (rotation === 'portrait') { $scope.control.rotate(0) $timeout(function() { if (isLandscape()) { $scope.currentRotation = 'landscape' } }, 400) } else if (rotation === 'landscape') { $scope.control.rotate(90) $timeout(function() { if (isPortrait()) { $scope.currentRotation = 'portrait' } }, 400) } } $scope.currentRotation = 'portrait' $scope.$watch('device.display.rotation', function(newValue) { if (isPortrait(newValue)) { $scope.currentRotation = 'portrait' } else if (isLandscape(newValue)) { $scope.currentRotation = 'landscape' } }) // TODO: Refactor this inside control and server-side $scope.rotateLeft = function() { var angle = 0 if ($scope.device && $scope.device.display) { angle = $scope.device.display.rotation } if (angle === 0) { angle = 270 } else { angle -= 90 } $scope.control.rotate(angle) if ($rootScope.standalone) { $window.resizeTo($window.outerHeight, $window.outerWidth) } } $scope.rotateRight = function() { var angle = 0 if ($scope.device && $scope.device.display) { angle = $scope.device.display.rotation } if (angle === 270) { angle = 0 } else { angle += 90 } $scope.control.rotate(angle) if ($rootScope.standalone) { $window.resizeTo($window.outerHeight, $window.outerWidth) } } $scope.copyContent = '' $scope.copy = function() { $scope.control.paste($scope.copyContent) } console.log($scope) }
ig.module('game.levels.lighting') .requires('impact.image', 'plusplus.entities.light', 'plusplus.entities.checkpoint', 'plusplus.entities.levelchange', 'plusplus.entities.camera-atmosphere', 'plusplus.entities.conversation', 'game.entities.villain-working') .defines(function() { LevelLighting = /*JSON[*/ { "entities": [{ "type": "EntityLight", "x": 116, "y": 80, "settings": { "size": { "x": 104, "y": 104 }, "r": 1, "g": 1, "alpha": 0.5, "b": 0.35 } }, { "type": "EntityLight", "x": 308, "y": 80, "settings": { "size": { "x": 104, "y": 104 }, "castsShadows": "true", "castsShadowsMovable": "true", "performance": "movable" } }, { "type": "EntityCheckpoint", "x": 464, "y": 144, "settings": { "size": { "x": 16, "y": 32 }, "name": "right" } }, { "type": "EntityLevelchange", "x": 32, "y": 144, "settings": { "size": { "x": 16, "y": 32 }, "levelName": "camera", "playerSpawnerName": "right" } }, { "type": "EntityCheckpoint", "x": 64, "y": 144, "settings": { "size": { "x": 16, "y": 32 }, "name": "left" } }, { "type": "EntityLevelchange", "x": 496, "y": 144, "settings": { "size": { "x": 16, "y": 32 }, "levelName": "core", "playerSpawnerName": "left" } }, { "type": "EntityCameraAtmosphere", "x": 56, "y": 160, "settings": { "atmosphereFadeDuration": 0, "size": { "x": 16, "y": 16 } } }, { "type": "EntityLight", "x": 8, "y": 80, "settings": { "size": { "x": 104, "y": 104 } } }, { "type": "EntityLight", "x": 196, "y": 64, "settings": { "size": { "x": 136, "y": 136 }, "castsShadows": "true" } }, { "type": "EntityLight", "x": 416, "y": 76, "settings": { "size": { "x": 104, "y": 104 }, "pixelPerfect": "true", "gradient": "false" } }, { "type": "EntityConversation", "x": 316, "y": 72, "settings": { "size": { "x": 76, "y": 56 }, "steps": { "1": { "name": "villain", "text": "AND animation specific shadows!" } } } }, { "type": "EntityVillainWorking", "x": 444, "y": 144 }, { "type": "EntityConversation", "x": 72, "y": 160, "settings": { "size": { "x": 16, "y": 16 }, "pausing": "true", "steps": { "1": { "name": "villain", "text": "this is the lighting room!" }, "2": { "name": "villain", "text": "lighting may be too expensive for some devices, so don't be a jerk" } }, "delay": 1, "autoAdvance": "false" } }, { "type": "EntityCameraAtmosphere", "x": 472, "y": 160, "settings": { "atmosphereFadeDuration": 0, "size": { "x": 16, "y": 16 } } }, { "type": "EntityConversation", "x": 128, "y": 72, "settings": { "size": { "x": 16, "y": 104 }, "steps": { "1": { "name": "player", "text": "colored lights?" } } } }, { "type": "EntityConversation", "x": 216, "y": 72, "settings": { "size": { "x": 16, "y": 104 }, "steps": { "1": { "name": "player", "text": "static map shadows?" } } } }, { "type": "EntityConversation", "x": 316, "y": 72, "settings": { "size": { "x": 16, "y": 104 }, "steps": { "1": { "name": "player", "text": "dynamic shadows?" } } } }, { "type": "EntityConversation", "x": 432, "y": 72, "settings": { "size": { "x": 16, "y": 104 }, "steps": { "1": { "name": "villain", "text": "and don't forget about pixel perfect lights" } } } }], "layer": [{ "name": "collision", "width": 34, "height": 13, "linkWithCollision": false, "visible": 1, "tilesetName": "", "repeat": false, "preRender": false, "distance": 1, "tilesize": 16, "foreground": false, "data": [ [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0], [0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0], [0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0], [0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0], [0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0], [0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 13, 42, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0], [0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0], [0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0], [0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 13, 42, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0], [0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0], [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] ] }, { "name": "walls", "width": 34, "height": 13, "linkWithCollision": false, "visible": 1, "tilesetName": "media/tileset_walls.png", "repeat": false, "preRender": false, "distance": "1", "tilesize": 16, "foreground": false, "data": [ [2, 29, 29, 29, 30, 31, 32, 33, 33, 29, 30, 31, 32, 33, 29, 30, 31, 32, 33, 29, 29, 30, 31, 32, 29, 30, 31, 32, 33, 30, 31, 32, 33, 13], [9, 85, 89, 89, 89, 90, 89, 89, 90, 89, 89, 89, 89, 90, 90, 89, 89, 90, 89, 89, 90, 89, 89, 89, 89, 89, 89, 90, 89, 89, 89, 90, 74, 17], [5, 65, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 53, 18], [7, 65, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 54, 18], [5, 66, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 54, 19], [5, 66, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 155, 154, 154, 154, 154, 154, 154, 54, 21], [9, 66, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 155, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 53, 18], [7, 66, 154, 154, 154, 155, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 155, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 155, 54, 19], [5, 65, 152, 151, 152, 152, 152, 152, 152, 152, 151, 152, 152, 152, 152, 152, 151, 152, 152, 152, 152, 152, 151, 152, 152, 152, 152, 152, 152, 151, 152, 152, 53, 19], [5, 66, 164, 165, 166, 163, 163, 163, 164, 165, 166, 163, 163, 163, 163, 164, 165, 166, 163, 163, 164, 165, 166, 163, 163, 163, 163, 163, 163, 163, 163, 163, 54, 18], [7, 65, 154, 155, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 155, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 53, 17], [7, 114, 101, 101, 101, 101, 101, 102, 103, 101, 101, 101, 101, 101, 105, 106, 101, 107, 108, 101, 101, 101, 101, 101, 101, 101, 101, 104, 105, 101, 102, 103, 115, 21], [26, 41, 41, 41, 43, 42, 43, 44, 45, 43, 41, 41, 41, 42, 43, 44, 45, 45, 41, 42, 43, 44, 43, 41, 41, 42, 43, 44, 45, 42, 43, 44, 45, 37] ] }, { "name": "details", "width": 34, "height": 13, "linkWithCollision": false, "visible": 1, "tilesetName": "media/tileset_details.png", "repeat": false, "preRender": false, "distance": "1", "tilesize": 16, "foreground": false, "data": [ [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 87, 87, 87, 87, 87, 90, 87, 87, 86, 87, 87, 90, 87, 87, 87, 87, 87, 90, 87, 87, 86, 87, 87, 90, 87, 87, 87, 87, 87, 87, 0, 0], [0, 0, 87, 87, 86, 87, 87, 106, 0, 0, 0, 0, 0, 105, 87, 87, 86, 87, 87, 106, 0, 0, 0, 0, 0, 105, 87, 87, 86, 87, 87, 87, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 164, 0, 0, 0, 147, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 180, 181, 182, 0, 0, 147, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 196, 197, 198, 199, 0, 0, 147, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 214, 215, 0, 0, 0, 164, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 180, 181, 182, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 61, 0], [0, 79, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 196, 197, 198, 199, 0, 0, 0, 0, 0, 12, 13, 14, 15, 16, 17, 0, 78, 0], [0, 96, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 214, 215, 0, 0, 0, 0, 0, 0, 29, 30, 31, 32, 33, 34, 0, 95, 0], [0, 113, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 112, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] ] }] } /*]JSON*/ ; LevelLightingResources = [new ig.Image('media/tileset_walls.png'), new ig.Image('media/tileset_details.png')]; });
/*global define*/ define([ './SceneMode' ], function( SceneMode) { "use strict"; /** * State information about the current frame. An instance of this class * is provided to update functions. * * @param {CreditDisplay} creditDisplay Handles adding and removing credits from an HTML element * * @alias FrameState * @constructor * * @private */ var FrameState = function(context, creditDisplay) { /** * The rendering context. * @type {Context} */ this.context = context; /** * An array of rendering commands. * @type {DrawCommand[]} */ this.commandList = []; /** * The current mode of the scene. * @type {SceneMode} * @default {@link SceneMode.SCENE3D} */ this.mode = SceneMode.SCENE3D; /** * The current morph transition time between 2D/Columbus View and 3D, * with 0.0 being 2D or Columbus View and 1.0 being 3D. * * @type {Number} */ this.morphTime = SceneMode.getMorphTime(SceneMode.SCENE3D); /** * The current frame number. * * @type {Number} * @default 0 */ this.frameNumber = 0; /** * The scene's current time. * * @type {JulianDate} * @default undefined */ this.time = undefined; /** * The map projection to use in 2D and Columbus View modes. * * @type {MapProjection} * @default undefined */ this.mapProjection = undefined; /** * The current camera. * @type {Camera} * @default undefined */ this.camera = undefined; /** * The culling volume. * @type {CullingVolume} * @default undefined */ this.cullingVolume = undefined; /** * The current occluder. * @type {Occluder} * @default undefined */ this.occluder = undefined; this.passes = { /** * <code>true</code> if the primitive should update for a render pass, <code>false</code> otherwise. * @type {Boolean} * @default false */ render : false, /** * <code>true</code> if the primitive should update for a picking pass, <code>false</code> otherwise. * @type {Boolean} * @default false */ pick : false }; /** * The credit display. * @type {CreditDisplay} */ this.creditDisplay = creditDisplay; /** * An array of functions to be called at the end of the frame. This array * will be cleared after each frame. * <p> * This allows queueing up events in <code>update</code> functions and * firing them at a time when the subscribers are free to change the * scene state, e.g., manipulate the camera, instead of firing events * directly in <code>update</code> functions. * </p> * * @type {FrameState~AfterRenderCallback[]} * * @example * frameState.afterRender.push(function() { * // take some action, raise an event, etc. * }); */ this.afterRender = []; /** * Gets whether or not to optimized for 3D only. * @type {Boolean} * @default false */ this.scene3DOnly = false; }; /** * A function that will be called at the end of the frame. * @callback FrameState~AfterRenderCallback */ return FrameState; });
module.exports = [{ path: "/", name: "nav.home" }, { path: "/about_us", name: "nav.about_us" }, { path: "/services", name: "nav.services" }, { path: "/contact_us", name: "nav.contact_us" }, { path: "/testimonials", name: "nav.testimonials" }, { path: "/residential_gallery", name: "nav.residential_gallery" }];
import { filterMongoURL } from '@parameter1/sso-mongodb'; import { immediatelyThrow } from '@parameter1/utils'; import pkg from '../package.js'; import createServer from './create-server.js'; import { EXPOSED_HOST, EXPOSED_PORT, HOST, PORT, } from './env.js'; import mongodb from './mongodb.js'; process.on('unhandledRejection', immediatelyThrow); const { log } = console; (async () => { log(`Booting ${pkg.name} v${pkg.version}...`); // start services here log('Connecting to MongoDB...'); const client = await mongodb.connect(); log(`MongoDB connected on ${filterMongoURL(client)}`); const server = await createServer({ fastify: { trustProxy: ['loopback', 'linklocal', 'uniquelocal'], }, onHealthCheck: async () => { await mongodb.ping({ id: pkg.name }); return true; }, onShutdown: async () => { // stop services here await mongodb.close(); }, }); await server.listen({ host: HOST, port: PORT }); log(`Ready on http://${EXPOSED_HOST}:${EXPOSED_PORT}/graphql/materialized`); })().catch(immediatelyThrow);
// Import ES6 Promise import 'es6-promise/auto' // Import System requirements import Vue from 'vue' import VueRouter from 'vue-router' import { sync } from 'vuex-router-sync' import routes from './routes' import store from './store' // Import Helpers for filters import { domain, count, prettyDate, pluralize } from './filters' // Import Views - Top level import AppView from './components/App.vue' // Import Install and register helper items Vue.filter('count', count) Vue.filter('domain', domain) Vue.filter('prettyDate', prettyDate) Vue.filter('pluralize', pluralize) Vue.use(VueRouter) // Routing logic var router = new VueRouter({ routes: routes, mode: 'history', linkExactActiveClass: 'active', scrollBehavior: function(to, from, savedPosition) { return savedPosition || { x: 0, y: 0 } } }) // Some middleware to help us ensure the user is authenticated. router.beforeEach((to, from, next) => { if ( to.matched.some(record => record.meta.requiresAuth) && (!router.app.$store.state.token || router.app.$store.state.token === 'null') ) { // this route requires auth, check if logged in // if not, redirect to login page. window.console.log('Not authenticated') next({ path: '/login', query: { redirect: to.fullPath } }) } else { next() } }) sync(store, router) // Check local storage to handle refreshes if (window.localStorage) { var localUserString = window.localStorage.getItem('user') || 'null' var localUser = JSON.parse(localUserString) if (localUser && store.state.user !== localUser) { store.commit('SET_USER', localUser) store.commit('SET_TOKEN', window.localStorage.getItem('token')) } } // Start out app! // eslint-disable-next-line no-new new Vue({ el: '#root', router: router, store: store, render: h => h(AppView) }) // change this. demo window.bugsnagClient = window.bugsnag('02fe1c2caaf5874c50b6ee19534f5932') window.bugsnagClient.use(window.bugsnag__vue(Vue))
import i18n from 'i18next'; import { initReactI18next } from 'react-i18next'; import en from './lang/en.json'; import vi from './lang/vi.json'; // the translations // (tip move them in a JSON file and import them) const resources = { en: { translation: en, }, vi: { translation: vi, }, }; i18n .use(initReactI18next) // passes i18n down to react-i18next .init({ resources, lng: 'en', keySeparator: false, // we do not use keys in form messages.welcome interpolation: { escapeValue: false, // react already safes from xss }, }); export default i18n;
"use strict"; // http://download.intel.com/design/chipsets/datashts/29056601.pdf /** @const */ var IOAPIC_ADDRESS = 0xFEC00000; /** @const */ var IOREGSEL = 0; /** @const */ var IOWIN = 0x10; /** @const */ var IOAPIC_IRQ_COUNT = 24; /** @const */ var IOAPIC_ID = 0; // must match value in seabios /** @const */ var IOAPIC_CONFIG_TRIGGER_MODE_LEVEL = 1 << 15; /** @const */ var IOAPIC_CONFIG_MASKED = 1 << 16; /** @const */ var IOAPIC_CONFIG_DELIVS = 1 << 12; /** @const */ var IOAPIC_CONFIG_REMOTE_IRR = 1 << 14; /** @const */ var IOAPIC_CONFIG_READONLY_MASK = IOAPIC_CONFIG_REMOTE_IRR | IOAPIC_CONFIG_DELIVS | 0xFFFE0000; /** @const */ var IOAPIC_DELIVERY_FIXED = 0; /** @const */ var IOAPIC_DELIVERY_LOWEST_PRIORITY = 1; /** @const */ var IOAPIC_DELIVERY_NMI = 4; /** @const */ var IOAPIC_DELIVERY_INIT = 5; /** * @constructor * @param {CPU} cpu */ function IOAPIC(cpu) { /** @type {CPU} */ this.cpu = cpu; this.ioredtbl_config = new Int32Array(IOAPIC_IRQ_COUNT); this.ioredtbl_destination = new Int32Array(IOAPIC_IRQ_COUNT); for(var i = 0; i < this.ioredtbl_config.length; i++) { // disable interrupts this.ioredtbl_config[i] = IOAPIC_CONFIG_MASKED; } // IOAPIC register selection this.ioregsel = 0; this.ioapic_id = IOAPIC_ID; this.irr = 0; this.irq_value = 0; dbg_assert(MMAP_BLOCK_SIZE >= 0x20); cpu.io.mmap_register(IOAPIC_ADDRESS, MMAP_BLOCK_SIZE, (addr) => { addr = addr - IOAPIC_ADDRESS | 0; if(addr >= IOWIN && addr < IOWIN + 4) { const byte = addr - IOWIN; dbg_log("ioapic read8 byte " + byte + " " + h(this.ioregsel), LOG_APIC); return this.read(this.ioregsel) >> (8 * byte) & 0xFF; } else { dbg_log("Unexpected IOAPIC register read: " + h(addr >>> 0), LOG_APIC); dbg_assert(false); return 0; } }, (addr, value) => { dbg_assert(false, "unsupported write8 from ioapic: " + h(addr >>> 0)); }, (addr) => { addr = addr - IOAPIC_ADDRESS | 0; if(addr === IOREGSEL) { return this.ioregsel; } else if(addr === IOWIN) { return this.read(this.ioregsel); } else { dbg_log("Unexpected IOAPIC register read: " + h(addr >>> 0), LOG_APIC); dbg_assert(false); return 0; } }, (addr, value) => { addr = addr - IOAPIC_ADDRESS | 0; if(addr === IOREGSEL) { this.ioregsel = value; } else if(addr === IOWIN) { this.write(this.ioregsel, value); } else { dbg_log("Unexpected IOAPIC register write: " + h(addr >>> 0) + " <- " + h(value >>> 0, 8), LOG_APIC); dbg_assert(false); } }); } IOAPIC.prototype.remote_eoi = function(vector) { for(var i = 0; i < IOAPIC_IRQ_COUNT; i++) { var config = this.ioredtbl_config[i]; if((config & 0xFF) === vector && (config & IOAPIC_CONFIG_REMOTE_IRR)) { dbg_log("Clear remote IRR for irq=" + h(i), LOG_APIC); this.ioredtbl_config[i] &= ~IOAPIC_CONFIG_REMOTE_IRR; this.check_irq(i); } } }; IOAPIC.prototype.check_irq = function(irq) { var mask = 1 << irq; if((this.irr & mask) === 0) { return; } var config = this.ioredtbl_config[irq]; if((config & IOAPIC_CONFIG_MASKED) === 0) { var delivery_mode = config >> 8 & 7; var destination_mode = config >> 11 & 1; var vector = config & 0xFF; var destination = this.ioredtbl_destination[irq] >>> 24; var is_level = (config & IOAPIC_CONFIG_TRIGGER_MODE_LEVEL) === IOAPIC_CONFIG_TRIGGER_MODE_LEVEL; if((config & IOAPIC_CONFIG_TRIGGER_MODE_LEVEL) === 0) { this.irr &= ~mask; } else { this.ioredtbl_config[irq] |= IOAPIC_CONFIG_REMOTE_IRR; if(config & IOAPIC_CONFIG_REMOTE_IRR) { dbg_log("No route: level interrupt and remote IRR still set", LOG_APIC); return; } } if(delivery_mode === IOAPIC_DELIVERY_FIXED || delivery_mode === IOAPIC_DELIVERY_LOWEST_PRIORITY) { this.cpu.devices.apic.route(vector, delivery_mode, is_level, destination, destination_mode); } else { dbg_assert(false, "TODO"); } this.ioredtbl_config[irq] &= ~IOAPIC_CONFIG_DELIVS; } }; IOAPIC.prototype.set_irq = function(i) { if(i >= IOAPIC_IRQ_COUNT) { dbg_assert(false, "Bad irq: " + i, LOG_APIC); return; } var mask = 1 << i; if((this.irq_value & mask) === 0) { APIC_LOG_VERBOSE && dbg_log("apic set irq " + i, LOG_APIC); this.irq_value |= mask; var config = this.ioredtbl_config[i]; if((config & (IOAPIC_CONFIG_TRIGGER_MODE_LEVEL|IOAPIC_CONFIG_MASKED)) === IOAPIC_CONFIG_MASKED) { // edge triggered and masked return; } this.irr |= mask; this.check_irq(i); } }; IOAPIC.prototype.clear_irq = function(i) { if(i >= IOAPIC_IRQ_COUNT) { dbg_assert(false, "Bad irq: " + i, LOG_APIC); return; } var mask = 1 << i; if((this.irq_value & mask) === mask) { this.irq_value &= ~mask; var config = this.ioredtbl_config[i]; if(config & IOAPIC_CONFIG_TRIGGER_MODE_LEVEL) { this.irr &= ~mask; } } }; IOAPIC.prototype.read = function(reg) { if(reg === 0) { dbg_log("IOAPIC Read id", LOG_APIC); return this.ioapic_id << 24; } else if(reg === 1) { dbg_log("IOAPIC Read version", LOG_APIC); return 0x11 | IOAPIC_IRQ_COUNT - 1 << 16; } else if(reg === 2) { dbg_log("IOAPIC Read arbitration id", LOG_APIC); return this.ioapic_id << 24; } else if(reg >= 0x10 && reg < 0x10 + 2 * IOAPIC_IRQ_COUNT) { var irq = reg - 0x10 >> 1; var index = reg & 1; if(index) { var value = this.ioredtbl_destination[irq]; dbg_log("IOAPIC Read destination irq=" + h(irq) + " -> " + h(value, 8), LOG_APIC); } else { var value = this.ioredtbl_config[irq]; dbg_log("IOAPIC Read config irq=" + h(irq) + " -> " + h(value, 8), LOG_APIC); } return value; } else { dbg_log("IOAPIC register read outside of range " + h(reg), LOG_APIC); dbg_assert(false); return 0; } }; IOAPIC.prototype.write = function(reg, value) { //dbg_log("IOAPIC write " + h(reg) + " <- " + h(value, 8), LOG_APIC); if(reg === 0) { this.ioapic_id = value >>> 24 & 0x0F; } else if(reg === 1 || reg === 2) { dbg_log("Invalid write: " + reg, LOG_APIC); } else if(reg >= 0x10 && reg < 0x10 + 2 * IOAPIC_IRQ_COUNT) { var irq = reg - 0x10 >> 1; var index = reg & 1; if(index) { this.ioredtbl_destination[irq] = value & 0xFF000000; dbg_log("Write destination " + h(value >>> 0, 8) + " irq=" + h(irq) + " dest=" + h(value >>> 24, 2), LOG_APIC); } else { var old_value = this.ioredtbl_config[irq]; this.ioredtbl_config[irq] = value & ~IOAPIC_CONFIG_READONLY_MASK | old_value & IOAPIC_CONFIG_READONLY_MASK; var vector = value & 0xFF; var delivery_mode = value >> 8 & 7; var destination_mode = value >> 11 & 1; var is_level = value >> 15 & 1; var disabled = value >> 16 & 1; dbg_log("Write config " + h(value >>> 0, 8) + " irq=" + h(irq) + " vector=" + h(vector, 2) + " deliverymode=" + DELIVERY_MODES[delivery_mode] + " destmode=" + DESTINATION_MODES[destination_mode] + " is_level=" + is_level + " disabled=" + disabled, LOG_APIC); this.check_irq(irq); } } else { dbg_log("IOAPIC register write outside of range " + h(reg) + ": " + h(value >>> 0, 8), LOG_APIC); dbg_assert(false); } }; IOAPIC.prototype.get_state = function() { var state = []; state[0] = this.ioredtbl_config; state[1] = this.ioredtbl_destination; state[2] = this.ioregsel; state[3] = this.ioapic_id; state[4] = this.irr; state[5] = this.irq_value; return state; }; IOAPIC.prototype.set_state = function(state) { this.ioredtbl_config = state[0]; this.ioredtbl_destination = state[1]; this.ioregsel = state[2]; this.ioapic_id = state[3]; this.irr = state[4]; this.irq_value = state[5]; };
import React from 'react'; import pubs from '../data/articles'; const Publications = () => ( <div id="publications"> <h2>Publications</h2> {pubs.map(pub => ( <div key={pub.id} className="pubs"> <img src={pub.image} alt={pub.alt} height="80" width="80" /> <a href={pub.ref} target="_blank" rel="noopener noreferrer" > {pub.title} </a> </div> ))} </div> ); export default Publications;
(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : (global.vueIonicons = factory()); }(this, (function () { 'use strict'; var A_ROTATE = 'rotate'; var A_BEAT = 'beat'; var A_SHAKE = 'shake'; var IoniconsMixin = { computed: { ionClass: function ionClass() { var addClass = ''; if (this.animate === A_ROTATE) { addClass = 'ion-rotate '; } else if (this.animate === A_BEAT) { addClass = 'ion-beat '; } else if (this.animate === A_SHAKE) { addClass = 'ion-shake '; } return "".concat(this.rootClass, " ").concat(addClass); } }, props: { title: { type: String, "default": '' }, rootClass: { type: String, "default": '' }, w: { type: String, "default": '1em' }, h: { type: String, "default": '1em' }, animate: { type: String, "default": '' } } }; // var script = { name: "logo-codepen-icon", mixins: [IoniconsMixin], data: function data() { var iconTitle = this.title ? this.title : null; return { iconTitle: iconTitle }; } }; /* script */ const __vue_script__ = script; /* template */ var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.iconTitle)?_c('div',{staticClass:"ion",class:_vm.ionClass,attrs:{"title":_vm.iconTitle,"name":"logo-codepen-icon"}},[_c('svg',{staticClass:"ion__svg",attrs:{"viewBox":"0 0 512 512","width":_vm.w,"height":_vm.h}},[_c('path',{attrs:{"d":"M241.24 303.94c-15.32-10.36-30.74-20.57-46.06-30.93-2-1.38-3.43-1.48-5.5 0l-38.88 26.12C182 319.9 244 361.32 244 361.32v-53.79c0-1.22-1.55-2.78-2.76-3.59zM195.09 240.67q23.19-15.24 46.11-30.86a7.54 7.54 0 0 0 2.8-5.34v-51.7s-62 41.12-93.26 61.94c13.7 9.16 26.67 17.91 39.78 26.44 1.02.66 3.4.28 4.57-.48zM269.84 209.35q23.71 16.07 47.63 31.82a4.3 4.3 0 0 0 3.83 0l39.76-26.47L268 152.48v53.35a4.79 4.79 0 0 0 1.84 3.52zM258.11 230.37a5.27 5.27 0 0 0-4.74.17c-4.82 3-9.47 6.2-14.17 9.35-8.25 5.53-25.35 17-25.35 17l38.84 25.86a6.18 6.18 0 0 0 6.26.11l39-26s-34.07-22.66-39.84-26.49zM141 237.12v39.61l29.62-19.84L141 237.12z"}}),_c('path',{attrs:{"d":"M256 32C132.29 32 32 132.29 32 256s100.29 224 224 224 224-100.29 224-224S379.71 32 256 32zm139 265c0 5.78-2.65 9.86-7.51 13.09q-61.71 41-123.29 82.19c-5.85 3.92-11.17 3.75-17-.14q-61.17-41-122.63-81.67c-5.11-3.39-7.59-7.56-7.59-13.73V217c0-6.14 2.52-10.34 7.62-13.72 40.91-27.13 81.94-54.36 122.73-81.68 5.82-3.89 11.09-4 16.94-.09q61.54 41.21 123.26 82.19c4.68 3.11 7.45 6.95 7.45 12.66z"}}),_c('path',{attrs:{"d":"M316.25 273.23q-22.59 15.34-45.39 30.34c-2.41 1.58-2.89 3.31-2.86 6.19v51.34l93-62-38.53-25.88c-2.3-1.61-3.89-1.57-6.22.01zM370 276.68v-39.62l-29.59 19.87L370 276.68z"}})])]):_c('div',{staticClass:"ion",class:_vm.ionClass,attrs:{"name":"logo-codepen-icon"}},[_c('svg',{staticClass:"ion__svg",attrs:{"viewBox":"0 0 512 512","width":_vm.w,"height":_vm.h}},[_c('path',{attrs:{"d":"M241.24 303.94c-15.32-10.36-30.74-20.57-46.06-30.93-2-1.38-3.43-1.48-5.5 0l-38.88 26.12C182 319.9 244 361.32 244 361.32v-53.79c0-1.22-1.55-2.78-2.76-3.59zM195.09 240.67q23.19-15.24 46.11-30.86a7.54 7.54 0 0 0 2.8-5.34v-51.7s-62 41.12-93.26 61.94c13.7 9.16 26.67 17.91 39.78 26.44 1.02.66 3.4.28 4.57-.48zM269.84 209.35q23.71 16.07 47.63 31.82a4.3 4.3 0 0 0 3.83 0l39.76-26.47L268 152.48v53.35a4.79 4.79 0 0 0 1.84 3.52zM258.11 230.37a5.27 5.27 0 0 0-4.74.17c-4.82 3-9.47 6.2-14.17 9.35-8.25 5.53-25.35 17-25.35 17l38.84 25.86a6.18 6.18 0 0 0 6.26.11l39-26s-34.07-22.66-39.84-26.49zM141 237.12v39.61l29.62-19.84L141 237.12z"}}),_c('path',{attrs:{"d":"M256 32C132.29 32 32 132.29 32 256s100.29 224 224 224 224-100.29 224-224S379.71 32 256 32zm139 265c0 5.78-2.65 9.86-7.51 13.09q-61.71 41-123.29 82.19c-5.85 3.92-11.17 3.75-17-.14q-61.17-41-122.63-81.67c-5.11-3.39-7.59-7.56-7.59-13.73V217c0-6.14 2.52-10.34 7.62-13.72 40.91-27.13 81.94-54.36 122.73-81.68 5.82-3.89 11.09-4 16.94-.09q61.54 41.21 123.26 82.19c4.68 3.11 7.45 6.95 7.45 12.66z"}}),_c('path',{attrs:{"d":"M316.25 273.23q-22.59 15.34-45.39 30.34c-2.41 1.58-2.89 3.31-2.86 6.19v51.34l93-62-38.53-25.88c-2.3-1.61-3.89-1.57-6.22.01zM370 276.68v-39.62l-29.59 19.87L370 276.68z"}})])])}; var __vue_staticRenderFns__ = []; /* style */ const __vue_inject_styles__ = undefined; /* scoped */ const __vue_scope_id__ = undefined; /* module identifier */ const __vue_module_identifier__ = undefined; /* functional template */ const __vue_is_functional_template__ = false; /* component normalizer */ function __vue_normalize__( template, style, script$$1, scope, functional, moduleIdentifier, createInjector, createInjectorSSR ) { const component = (typeof script$$1 === 'function' ? script$$1.options : script$$1) || {}; // For security concerns, we use only base name in production mode. component.__file = "logo-codepen.vue"; if (!component.render) { component.render = template.render; component.staticRenderFns = template.staticRenderFns; component._compiled = true; if (functional) component.functional = true; } component._scopeId = scope; return component } /* style inject */ /* style inject SSR */ var logoCodepen = __vue_normalize__( { render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ }, __vue_inject_styles__, __vue_script__, __vue_scope_id__, __vue_is_functional_template__, __vue_module_identifier__, undefined, undefined ); return logoCodepen; })));
import React, { Component } from 'react' import PropTypes from 'prop-types' import actions from '../actions' import AddVehicleJourney from '../containers/tools/AddVehicleJourney' import DeleteVehicleJourneys from '../containers/tools/DeleteVehicleJourneys' import SelectVehicleJourneys from '../containers/tools/SelectVehicleJourneys' import CopyButton from '../containers/tools/CopyButton' import PasteButton from '../containers/tools/PasteButton' import ShiftVehicleJourney from '../containers/tools/ShiftVehicleJourney' import DuplicateVehicleJourney from '../containers/tools/DuplicateVehicleJourney' import EditVehicleJourney from '../containers/tools/EditVehicleJourney' import NotesEditVehicleJourney from '../containers/tools/NotesEditVehicleJourney' import TimetablesEditVehicleJourney from '../containers/tools/TimetablesEditVehicleJourney' import PurchaseWindowsEditVehicleJourney from '../containers/tools/PurchaseWindowsEditVehicleJourney' import ConstraintExclusionEditVehicleJourney from '../containers/tools/ConstraintExclusionEditVehicleJourney' export default class Tools extends Component { constructor(props) { super(props) this.hasPolicy = this.hasPolicy.bind(this) this.hasFeature = this.hasFeature.bind(this) this.hasDeletedVJ = this.hasDeletedVJ.bind(this) } hasPolicy(key) { // Check if the user has the policy to disable or not the action return this.props.filters.policy[`vehicle_journeys.${key}`] } hasFeature(key) { // Check if the organisation has the given feature return this.props.filters.features[key] } hasDeletedVJ() { return actions.getSelectedDeletables(this.props.vehicleJourneys).length > 0 } render() { let { hasPolicy, hasFeature, hasDeletedVJ, props: { vehicleJourneys, onCancelSelection, onCancelDeletion, editMode, selectionMode, selection } } = this return ( <div className='select_toolbox'> <ul> { !selectionMode && <AddVehicleJourney disabled={!hasPolicy("create") || !editMode} /> } { !selectionMode && <DuplicateVehicleJourney disabled={!hasPolicy("create") || !hasPolicy("update") || !editMode || hasDeletedVJ()}/> } { !selectionMode && <ShiftVehicleJourney disabled={!hasPolicy("update") || !editMode || hasDeletedVJ()}/> } { !selectionMode && <EditVehicleJourney disabled={hasDeletedVJ()}/> } <TimetablesEditVehicleJourney disabled={hasDeletedVJ()}/> { !selectionMode && hasFeature('purchase_windows') && <PurchaseWindowsEditVehicleJourney disabled={hasDeletedVJ()}/> } { !selectionMode && hasFeature('routing_constraint_zone_exclusion_in_vehicle_journey') && <ConstraintExclusionEditVehicleJourney disabled={hasDeletedVJ()} /> } { !selectionMode && <NotesEditVehicleJourney disabled={hasDeletedVJ()}/> } { !selectionMode && <DeleteVehicleJourneys disabled={!hasPolicy("destroy") || !editMode || hasDeletedVJ()}/> } { selectionMode && <CopyButton disabled={ !selection.ended } /> } { selectionMode && <PasteButton disabled={ !selection.ended } /> } <SelectVehicleJourneys disabled={!editMode}/> </ul> { !selectionMode && <div> <div className='pull-left'> <span className='info-msg left-span'>{I18n.t('vehicle_journeys.vehicle_journeys_matrix.selected_journeys', { count: actions.getSelected(vehicleJourneys).length })}</span> </div> <button className='btn btn-xs btn-link' disabled={actions.getSelected(vehicleJourneys).length == 0} onClick={onCancelSelection}> {I18n.t('vehicle_journeys.vehicle_journeys_matrix.cancel_selection')} </button> <button className='btn btn-xs btn-link pull-right' disabled={actions.getSelectedDeletables(vehicleJourneys).length == 0} onClick={onCancelDeletion}> {I18n.t('vehicle_journeys.vehicle_journeys_matrix.cancel_destroy')} </button> </div> } </div> ) } } Tools.propTypes = { vehicleJourneys : PropTypes.array.isRequired, onCancelSelection: PropTypes.func.isRequired, filters: PropTypes.object.isRequired }
import React, { Component } from 'react'; import axios from 'axios'; import DropZoneComponent from 'react-dropzone-component'; import RichTextEditor from "../forms/rich-text-editor"; export default class BlogForm extends Component { constructor(props) { super(props); this.state = { id: "", title: "", blog_status: "", content: "", featured_image: "", apiUrl: "https://sabinshrestha.devcamp.space/portfolio/portfolio_blogs", apiAction: "post" }; this.handleChange = this.handleChange.bind(this); this.handleSubmit = this.handleSubmit.bind(this); this.handleRichTextEditorChange = this.handleRichTextEditorChange.bind(this); this.componentConfig = this.componentConfig.bind(this); this.djsConfig = this.djsConfig.bind(this); this.handleFeaturedImageDrop = this.handleFeaturedImageDrop.bind(this); this.deleteImage = this.deleteImage.bind(this); this.featuredImageRef = React.createRef(); } deleteImage(imageType) { axios.delete(`https://api.devcamp.space/portfolio/delete-portfolio-blog-image/${this.props.blog.id}?image_type=${imageType}`, { withCredentials: true }).then(response => { this.props.handleFeaturedImageDelete(); }).catch(error => { console.log("deleteImage error", error); }); } componentWillMount() { if(this.props.editMode) { this.setState({ id: this.props.blog.id, title: this.props.blog.title, blog_status: this.props.blog.blog_status, content: this.props.blog.content, apiUrl: `https://sabinshrestha.devcamp.space/portfolio/portfolio_blogs/${this.props.blog.id}`, apiAction: "patch" }); } } componentConfig() { return { iconFiletypes:[".jpg", ".png"], showFiletypeIcon: true, postUrl: "https://httpbin.org/post" } } djsConfig() { return { addRemoveLinks: true, maxFiles: 1 } } handleFeaturedImageDrop() { return { addedfile: file => this.setState({ featured_image: file }) }; } handleRichTextEditorChange(content) { this.setState({ content }); } buildForm() { let formData = new FormData(); formData.append("portfolio_blog[title]", this.state.title); formData.append("portfolio_blog[blog_status]", this.state.blog_status); formData.append("portfolio_blog[content]", this.state.content); if (this.state.featured_image) { formData.append("portfolio_blog[featured_image]", this.state.featured_image); } return formData; } handleSubmit(event) { axios({ method: this.state.apiAction, url: this.state.apiUrl, data: this.buildForm(), withCredentials: true }).then(response => { if (this.state.featured_image) { this.featuredImageRef.current.dropzone.removeAllFiles() } this.setState({ title:"", blog_status: "", content: "", featured_image: "" }); if (this.props.editMode) { //update blog details this.props.handleUpdateFormSubmission(response.data.portfolio_blog); } else { this.props.handleSuccessfullFormSubmission(response.data.portfolio_blog);} }).catch(error => { console.log("handleSubmit for blog error", error); }); event.preventDefault(); } handleChange(event) { this.setState({ [event.target.name]: event.target.value }) } render() { return( <form onSubmit={this.handleSubmit} className="blog-form-wrapper"> <div className="two-column"> <input type="text" onChange={this.handleChange} name="title" placeholder="Blog Title" value={this.state.title} /> <input type="text" onChange={this.handleChange} name="blog_status" placeholder="Blog Status" value={this.state.blog_status} /> </div> <div className="one-column"> <RichTextEditor handleRichTextEditorChange={this.handleRichTextEditorChange} editMode={this.props.editMode} contentToEdit={this.props.editMode && this.props.blog.content ? this.props.blog.content : null } /> </div> <div className="image-uploaders"> {this.props.editMode && this.props.blog.featured_image_url ? ( <div className="portfolio-manager-image-wrapper"> <img src={this.props.blog.featured_image_url} /> <div className="image-removal-link"> <a onClick={() => this.deleteImage("featured_image")}>Remove file</a> </div> </div> ) : ( <DropZoneComponent ref={this.featuredImageRef} config={this.componentConfig()} djsConfig={this.djsConfig()} eventHandlers={this.handleFeaturedImageDrop()} > <div className="dz-message">Featured Image</div> </DropZoneComponent>)} </div> <button className="btn">Save</button> </form> ); } }
const { 'classes': Cc, 'interfaces': Ci, 'results': Cr, 'utils': Cu, 'Constructor': CC } = Components; Cu.import('resource://gre/modules/XPCOMUtils.jsm'); Cu.import('resource://gre/modules/FileUtils.jsm'); Cu.import('resource://gre/modules/Services.jsm'); function isSubjectToBranding(path) { return /shared[\/\\][a-zA-Z]+[\/\\]branding$/.test(path) || /branding[\/\\]initlogo.png/.test(path); } function getSubDirectories(directory) { let appsDir = new FileUtils.File(GAIA_DIR); appsDir.append(directory); let dirs = []; let files = appsDir.directoryEntries; while (files.hasMoreElements()) { let file = files.getNext().QueryInterface(Ci.nsILocalFile); if (file.isDirectory()) { dirs.push(file.leafName); } } return dirs; } /** * Returns an array of nsIFile's for a given directory * * @param {nsIFile} dir directory to read. * @param {boolean} recursive set to true in order to walk recursively. * @param {RegExp} exclude optional filter to exclude file/directories. * * @return {Array} list of nsIFile's. */ function ls(dir, recursive, exclude) { let results = []; let files = dir.directoryEntries; while (files.hasMoreElements()) { let file = files.getNext().QueryInterface(Ci.nsILocalFile); if (!exclude || !exclude.test(file.leafName)) { results.push(file); if (recursive && file.isDirectory()) { results = results.concat(ls(file, true, exclude)); } } } return results; } function getFileContent(file) { try { let fileStream = Cc['@mozilla.org/network/file-input-stream;1'] .createInstance(Ci.nsIFileInputStream); fileStream.init(file, 1, 0, false); let converterStream = Cc['@mozilla.org/intl/converter-input-stream;1'] .createInstance(Ci.nsIConverterInputStream); converterStream.init(fileStream, 'utf-8', fileStream.available(), Ci.nsIConverterInputStream.DEFAULT_REPLACEMENT_CHARACTER); let out = {}; let count = fileStream.available(); converterStream.readString(count, out); var content = out.value; converterStream.close(); fileStream.close(); } catch (e) { let msg = (file && file.path) ? '\nfile not found: ' + file.path : ''; throw new Error(' -*- build/utils.js: ' + e + msg + '\n'); } return content; } function writeContent(file, content) { var fileStream = Cc['@mozilla.org/network/file-output-stream;1'] .createInstance(Ci.nsIFileOutputStream); fileStream.init(file, 0x02 | 0x08 | 0x20, 0666, 0); let converterStream = Cc['@mozilla.org/intl/converter-output-stream;1'] .createInstance(Ci.nsIConverterOutputStream); converterStream.init(fileStream, 'utf-8', 0, 0); converterStream.writeString(content); converterStream.close(); } // Return an nsIFile by joining paths given as arguments // First path has to be an absolute one function getFile() { try { let file = new FileUtils.File(arguments[0]); if (arguments.length > 1) { for (let i = 1; i < arguments.length; i++) { file.append(arguments[i]); } } return file; } catch(e) { throw new Error(' -*- build/utils.js: Invalid file path (' + Array.slice(arguments).join(', ') + ')\n' + e + '\n'); } } function ensureFolderExists(file) { if (!file.exists()) { try { file.create(Ci.nsIFile.DIRECTORY_TYPE, parseInt('0755', 8)); } catch (e if e.result == Cr.NS_ERROR_FILE_ALREADY_EXISTS) { // Bug 808513: Ignore races between `if exists() then create()`. return; } } } function getJSON(file) { try { let content = getFileContent(file); return JSON.parse(content); } catch (e) { dump('Invalid JSON file : ' + file.path + '\n'); throw e; } } function makeWebappsObject(dirs) { return { forEach: function(fun) { let appSrcDirs = dirs.split(' '); appSrcDirs.forEach(function parseDirectory(directoryName) { let directories = getSubDirectories(directoryName); directories.forEach(function readManifests(dir) { let manifestFile = getFile(GAIA_DIR, directoryName, dir, 'manifest.webapp'); let updateFile = getFile(GAIA_DIR, directoryName, dir, 'update.webapp'); // Ignore directories without manifest if (!manifestFile.exists() && !updateFile.exists()) { return; } let manifest = manifestFile.exists() ? manifestFile : updateFile; let domain = dir + '.' + GAIA_DOMAIN; let webapp = { manifest: getJSON(manifest), manifestFile: manifest, url: GAIA_SCHEME + domain + (GAIA_PORT ? GAIA_PORT : ''), domain: domain, sourceDirectoryFile: manifestFile.parent, sourceDirectoryName: dir, sourceAppDirectoryName: directoryName }; // External webapps have a `metadata.json` file let metaData = webapp.sourceDirectoryFile.clone(); metaData.append('metadata.json'); if (metaData.exists()) { webapp.metaData = getJSON(metaData); } fun(webapp); }); }); } }; } let externalAppsDirs = ['external-apps']; // External apps are built differently from other apps by webapp-manifests.js, // and we need apps that are both external and dogfood to be treated like // external apps (to properly test external apps on dogfood devices), so we // segregate them into their own directory that we add to the list of external // apps dirs here when building a dogfood profile. if (DOGFOOD === '1') { externalAppsDirs.push('external-dogfood-apps'); } if (DOGFOOD === '0' && PRODUCTION === '0') { externalAppsDirs.push('test_external_apps'); } const Gaia = { engine: GAIA_ENGINE, sharedFolder: getFile(GAIA_DIR, 'shared'), webapps: makeWebappsObject(GAIA_APP_SRCDIRS), externalWebapps: makeWebappsObject(externalAppsDirs.join(' ')), aggregatePrefix: 'gaia_build_', customizeFolder: CUSTOMIZE }; function registerProfileDirectory() { let directoryProvider = { getFile: function provider_getFile(prop, persistent) { persistent.value = true; if (prop != 'ProfD' && prop != 'ProfLDS') { throw Cr.NS_ERROR_FAILURE; } return new FileUtils.File(PROFILE_DIR); }, QueryInterface: XPCOMUtils.generateQI([Ci.nsIDirectoryServiceProvider, Ci.nsISupports]) }; Cc['@mozilla.org/file/directory_service;1'] .getService(Ci.nsIProperties) .QueryInterface(Ci.nsIDirectoryService) .registerProvider(directoryProvider); } if (Gaia.engine === 'xpcshell') { registerProfileDirectory(); } function gaiaOriginURL(name) { return GAIA_SCHEME + name + '.' + GAIA_DOMAIN + (GAIA_PORT ? GAIA_PORT : ''); } function gaiaManifestURL(name) { return gaiaOriginURL(name) + '/manifest.webapp'; }
/** * @license * Copyright (c) 2018 amCharts (Antanas Marcelionis, Martynas Majeris) * * This sofware is provided under multiple licenses. Please see below for * links to appropriate usage. * * Free amCharts linkware license. Details and conditions: * https://github.com/amcharts/amcharts4/blob/master/LICENSE * * One of the amCharts commercial licenses. Details and pricing: * https://www.amcharts.com/online-store/ * https://www.amcharts.com/online-store/licenses-explained/ * * If in doubt, contact amCharts at contact@amcharts.com * * PLEASE DO NOT REMOVE THIS COPYRIGHT NOTICE. * @hidden */ am4internal_webpackJsonp(["d22b"],{s15t:function(e,o,t){"use strict";Object.defineProperty(o,"__esModule",{value:!0});window.am4geodata_region_usa_sdLow={type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"Polygon",coordinates:[[[-101.47,45.472],[-101.47,45.386],[-101.486,45.385],[-101.486,45.038],[-101.501,44.994],[-101.137,44.994],[-101.137,44.751],[-101.196,44.699],[-101.329,44.689],[-101.455,44.636],[-101.469,44.607],[-101.527,44.569],[-101.624,44.573],[-101.664,44.585],[-101.711,44.578],[-101.776,44.537],[-101.835,44.525],[-101.905,44.534],[-101.987,44.523],[-102.002,44.507],[-102,45.039],[-101.999,45.471],[-101.47,45.472]]]},properties:{name:"Ziebach",id:"46137",STATE:"SD",TYPE:"County",CNTRY:"USA"},id:"46137"},{type:"Feature",geometry:{type:"Polygon",coordinates:[[[-97.159,43.084],[-97.158,42.8],[-97.21,42.809],[-97.219,42.847],[-97.356,42.874],[-97.441,42.846],[-97.484,42.868],[-97.59,42.842],[-97.634,42.86],[-97.637,43.169],[-97.396,43.169],[-97.158,43.17],[-97.159,43.084]]]},properties:{name:"Yankton",id:"46135",STATE:"SD",TYPE:"County",CNTRY:"USA"},id:"46135"},{type:"Feature",geometry:{type:"Polygon",coordinates:[[[-99.71,45.595],[-99.711,45.246],[-100.262,45.247],[-100.316,45.312],[-100.278,45.384],[-100.337,45.449],[-100.341,45.473],[-100.381,45.51],[-100.471,45.519],[-100.484,45.551],[-100.43,45.595],[-99.72,45.596],[-99.71,45.595]]]},properties:{name:"Walworth",id:"46129",STATE:"SD",TYPE:"County",CNTRY:"USA"},id:"46129"},{type:"Feature",geometry:{type:"Polygon",coordinates:[[[-96.807,42.695],[-96.804,43.083],[-96.451,43.084],[-96.517,43.046],[-96.492,43.006],[-96.498,42.96],[-96.537,42.919],[-96.553,42.847],[-96.59,42.799],[-96.633,42.768],[-96.628,42.708],[-96.539,42.659],[-96.479,42.557],[-96.476,42.51],[-96.5,42.485],[-96.551,42.522],[-96.606,42.504],[-96.628,42.55],[-96.713,42.609],[-96.693,42.661],[-96.766,42.663],[-96.807,42.695]]]},properties:{name:"Union",id:"46127",STATE:"SD",TYPE:"County",CNTRY:"USA"},id:"46127"},{type:"Feature",geometry:{type:"Polygon",coordinates:[[[-96.923,43.5],[-96.922,43.084],[-97.159,43.084],[-97.158,43.17],[-97.396,43.169],[-97.401,43.5],[-97.129,43.5],[-96.923,43.5]]]},properties:{name:"Turner",id:"46125",STATE:"SD",TYPE:"County",CNTRY:"USA"},id:"46125"},{type:"Feature",geometry:{type:"Polygon",coordinates:[[[-99.533,43.5],[-99.533,42.998],[-100.198,42.998],[-100.198,43.128],[-100.214,43.128],[-100.216,43.388],[-100.215,43.476],[-100.232,43.476],[-100.233,43.71],[-100.078,43.688],[-100.026,43.698],[-99.899,43.696],[-99.866,43.669],[-99.779,43.711],[-99.746,43.705],[-99.699,43.749],[-99.644,43.759],[-99.623,43.74],[-99.621,43.499],[-99.533,43.5]]]},properties:{name:"Tripp",id:"46123",STATE:"SD",TYPE:"County",CNTRY:"USA"},id:"46123"},{type:"Feature",geometry:{type:"Polygon",coordinates:[[[-100.216,43.388],[-100.214,43.128],[-100.198,43.128],[-100.198,42.998],[-100.751,42.995],[-101.228,42.995],[-101.228,43.388],[-100.81,43.389],[-100.216,43.388]]]},properties:{name:"Todd",id:"46121",STATE:"SD",TYPE:"County",CNTRY:"USA"},id:"46121"},{type:"Feature",geometry:{type:"Polygon",coordinates:[[[-100.403,44.899],[-99.675,44.898],[-99.675,44.55],[-100.028,44.548],[-100.521,44.546],[-100.6,44.557],[-100.649,44.604],[-100.611,44.686],[-100.639,44.742],[-100.716,44.767],[-100.73,44.799],[-100.678,44.828],[-100.603,44.767],[-100.533,44.765],[-100.475,44.815],[-100.398,44.861],[-100.403,44.899]]]},properties:{name:"Sully",id:"46119",STATE:"SD",TYPE:"County",CNTRY:"USA"},id:"46119"},{type:"Feature",geometry:{type:"Polygon",coordinates:[[[-100.716,44.767],[-100.639,44.742],[-100.611,44.686],[-100.649,44.604],[-100.6,44.557],[-100.521,44.546],[-100.519,44.521],[-100.579,44.493],[-100.578,44.461],[-100.548,44.445],[-100.43,44.461],[-100.39,44.443],[-100.369,44.36],[-100.355,44.347],[-100.219,44.323],[-100.163,44.326],[-100.088,44.31],[-99.966,44.262],[-99.918,44.265],[-99.892,44.235],[-99.935,44.194],[-100.37,44.193],[-100.37,44.167],[-101.046,44.17],[-101.169,44.168],[-101.171,44.343],[-101.159,44.343],[-101.156,44.689],[-101.137,44.751],[-101.038,44.726],[-100.985,44.735],[-100.899,44.78],[-100.825,44.781],[-100.772,44.759],[-100.716,44.767]]]},properties:{name:"Stanley",id:"46117",STATE:"SD",TYPE:"County",CNTRY:"USA"},id:"46117"},{type:"Feature",geometry:{type:"Polygon",coordinates:[[[-97.977,44.632],[-98.448,44.632],[-98.707,44.635],[-98.707,44.896],[-98.719,44.896],[-98.721,45.102],[-98.718,45.245],[-97.98,45.241],[-97.981,45.155],[-97.983,44.893],[-97.977,44.892],[-97.977,44.632]]]},properties:{name:"Spink",id:"46115",STATE:"SD",TYPE:"County",CNTRY:"USA"},id:"46115"},{type:"Feature",geometry:{type:"Polygon",coordinates:[[[-102.143,43.7],[-102.142,43.475],[-102.116,43.475],[-102.116,43.389],[-102.112,43.128],[-102.086,43.128],[-102.083,42.998],[-102.508,42.999],[-102.508,43.002],[-102.999,43],[-103.001,43.476],[-103.002,43.607],[-102.933,43.62],[-102.907,43.673],[-102.815,43.666],[-102.811,43.685],[-102.18,43.687],[-102.143,43.7]]]},properties:{name:"Shannon",id:"46113",STATE:"SD",TYPE:"County",CNTRY:"USA"},id:"46113"},{type:"Feature",geometry:{type:"Polygon",coordinates:[[[-97.851,44.196],[-97.849,43.85],[-97.966,43.851],[-98.327,43.851],[-98.332,43.939],[-98.332,44.197],[-97.851,44.196]]]},properties:{name:"Sanborn",id:"46111",STATE:"SD",TYPE:"County",CNTRY:"USA"},id:"46111"},{type:"Feature",geometry:{type:"Polygon",coordinates:[[[-96.47,45.329],[-96.995,45.328],[-97.009,45.299],[-97.226,45.3],[-97.227,45.56],[-97.231,45.936],[-96.561,45.936],[-96.579,45.832],[-96.667,45.735],[-96.731,45.711],[-96.83,45.657],[-96.855,45.607],[-96.773,45.529],[-96.732,45.459],[-96.674,45.412],[-96.609,45.409],[-96.506,45.37],[-96.47,45.329]]]},properties:{name:"Roberts",id:"46109",STATE:"SD",TYPE:"County",CNTRY:"USA"},id:"46109"},{type:"Feature",geometry:{type:"Polygon",coordinates:[[[-99.711,45.246],[-99.575,45.246],[-99.573,44.898],[-99.675,44.898],[-100.403,44.899],[-100.424,44.928],[-100.426,44.984],[-100.403,45.015],[-100.358,45.027],[-100.281,45.024],[-100.321,45.062],[-100.329,45.095],[-100.281,45.158],[-100.262,45.247],[-99.711,45.246]]]},properties:{name:"Potter",id:"46107",STATE:"SD",TYPE:"County",CNTRY:"USA"},id:"46107"},{type:"Feature",geometry:{type:"Polygon",coordinates:[[[-101.999,45.944],[-101.999,45.471],[-102,45.039],[-102.47,45.039],[-102.958,45.039],[-102.959,45.213],[-102.955,45.732],[-102.944,45.731],[-102.943,45.944],[-102.422,45.944],[-101.999,45.944]]]},properties:{name:"Perkins",id:"46105",STATE:"SD",TYPE:"County",CNTRY:"USA"},id:"46105"},{type:"Feature",geometry:{type:"Polygon",coordinates:[[[-102.002,44.507],[-102.009,44.344],[-102.011,43.994],[-102.023,43.994],[-102.022,43.709],[-102.06,43.688],[-102.143,43.7],[-102.18,43.687],[-102.811,43.685],[-102.803,43.706],[-102.697,43.795],[-102.688,43.854],[-102.983,43.854],[-103.574,43.856],[-104.055,43.853],[-104.055,44.142],[-103.452,44.139],[-103.002,44.14],[-102.392,44.14],[-102.402,44.175],[-102.359,44.235],[-102.368,44.28],[-102.343,44.346],[-102.301,44.377],[-102.308,44.43],[-102.28,44.448],[-102.225,44.451],[-102.196,44.426],[-102.087,44.452],[-102.046,44.497],[-102.002,44.507]]]},properties:{name:"Pennington",id:"46103",STATE:"SD",TYPE:"County",CNTRY:"USA"},id:"46103"},{type:"Feature",geometry:{type:"Polygon",coordinates:[[[-96.454,43.85],[-96.531,43.848],[-96.89,43.85],[-96.887,44.197],[-96.454,44.198],[-96.454,43.85]]]},properties:{name:"Moody",id:"46101",STATE:"SD",TYPE:"County",CNTRY:"USA"},id:"46101"},{type:"Feature",geometry:{type:"Polygon",coordinates:[[[-96.454,43.85],[-96.454,43.503],[-96.597,43.502],[-96.923,43.5],[-97.129,43.5],[-97.129,43.85],[-96.89,43.85],[-96.531,43.848],[-96.454,43.85]]]},properties:{name:"Minnehaha",id:"46099",STATE:"SD",TYPE:"County",CNTRY:"USA"},id:"46099"},{type:"Feature",geometry:{type:"Polygon",coordinates:[[[-97.37,44.196],[-97.368,43.85],[-97.608,43.85],[-97.849,43.85],[-97.851,44.196],[-97.37,44.196]]]},properties:{name:"Miner",id:"46097",STATE:"SD",TYPE:"County",CNTRY:"USA"},id:"46097"},{type:"Feature",geometry:{type:"Polygon",coordinates:[[[-100.338,43.717],[-100.287,43.697],[-100.233,43.71],[-100.232,43.476],[-100.215,43.476],[-100.216,43.388],[-100.81,43.389],[-101.228,43.388],[-101.234,43.783],[-101.23,43.795],[-101.138,43.839],[-101.068,43.844],[-100.989,43.848],[-100.953,43.81],[-100.919,43.823],[-100.897,43.79],[-100.811,43.766],[-100.776,43.724],[-100.681,43.712],[-100.584,43.765],[-100.471,43.721],[-100.416,43.735],[-100.338,43.717]]]},properties:{name:"Mellette",id:"46095",STATE:"SD",TYPE:"County",CNTRY:"USA"},id:"46095"},{type:"Feature",geometry:{type:"Polygon",coordinates:[[[-102,45.039],[-102.002,44.507],[-102.046,44.497],[-102.087,44.452],[-102.196,44.426],[-102.225,44.451],[-102.28,44.448],[-102.308,44.43],[-102.301,44.377],[-102.343,44.346],[-102.368,44.28],[-102.359,44.235],[-102.402,44.175],[-102.392,44.14],[-103.002,44.14],[-103.452,44.139],[-103.455,44.258],[-103.574,44.258],[-103.569,44.345],[-103.567,44.604],[-102.966,44.604],[-102.959,44.69],[-102.958,45.039],[-102.47,45.039],[-102,45.039]]]},properties:{name:"Meade",id:"46093",STATE:"SD",TYPE:"County",CNTRY:"USA"},id:"46093"},{type:"Feature",geometry:{type:"Polygon",coordinates:[[[-98.727,45.937],[-98.73,45.591],[-99.346,45.594],[-99.71,45.595],[-99.72,45.596],[-99.721,45.942],[-99.005,45.939],[-98.727,45.937]]]},properties:{name:"McPherson",id:"46089",STATE:"SD",TYPE:"County",CNTRY:"USA"},id:"46089"},{type:"Feature",geometry:{type:"Polygon",coordinates:[[[-97.401,43.5],[-97.605,43.499],[-97.608,43.85],[-97.368,43.85],[-97.129,43.85],[-97.129,43.5],[-97.401,43.5]]]},properties:{name:"McCook",id:"46087",STATE:"SD",TYPE:"County",CNTRY:"USA"},id:"46087"},{type:"Feature",geometry:{type:"Polygon",coordinates:[[[-97.227,45.56],[-97.363,45.56],[-97.373,45.589],[-97.98,45.588],[-97.977,45.935],[-97.231,45.936],[-97.227,45.56]]]},properties:{name:"Marshall",id:"46091",STATE:"SD",TYPE:"County",CNTRY:"USA"},id:"46091"},{type:"Feature",geometry:{type:"Polygon",coordinates:[[[-99.356,43.934],[-99.358,43.899],[-99.306,43.854],[-99.366,43.793],[-99.414,43.761],[-99.408,43.703],[-99.454,43.688],[-99.46,43.657],[-99.38,43.655],[-99.338,43.628],[-99.332,43.57],[-99.282,43.529],[-99.292,43.5],[-99.533,43.5],[-99.621,43.499],[-99.623,43.74],[-99.644,43.759],[-99.699,43.749],[-99.746,43.705],[-99.779,43.711],[-99.866,43.669],[-99.899,43.696],[-100.026,43.698],[-100.078,43.688],[-100.233,43.71],[-100.287,43.697],[-100.338,43.717],[-100.339,43.846],[-100.366,43.846],[-100.37,44.167],[-100.37,44.193],[-99.935,44.194],[-99.884,44.13],[-99.846,44.121],[-99.776,44.135],[-99.646,44.099],[-99.597,44.117],[-99.63,44.162],[-99.686,44.17],[-99.697,44.208],[-99.662,44.217],[-99.574,44.193],[-99.54,44.157],[-99.555,44.121],[-99.544,44.081],[-99.51,44.057],[-99.426,44.042],[-99.353,43.983],[-99.356,43.934]]]},properties:{name:"Lyman",id:"46085",STATE:"SD",TYPE:"County",CNTRY:"USA"},id:"46085"},{type:"Feature",geometry:{type:"Polygon",coordinates:[[[-96.451,43.084],[-96.804,43.083],[-96.922,43.084],[-96.923,43.5],[-96.597,43.502],[-96.596,43.442],[-96.52,43.392],[-96.558,43.226],[-96.469,43.21],[-96.464,43.151],[-96.438,43.117],[-96.451,43.084]]]},properties:{name:"Lincoln",id:"46083",STATE:"SD",TYPE:"County",CNTRY:"USA"},id:"46083"},{type:"Feature",geometry:{type:"Polygon",coordinates:[[[-103.567,44.604],[-103.569,44.345],[-103.574,44.258],[-103.455,44.258],[-103.452,44.139],[-104.055,44.142],[-104.056,44.572],[-103.934,44.58],[-103.902,44.595],[-103.837,44.589],[-103.816,44.605],[-103.567,44.604]]]},properties:{name:"Lawrence",id:"46081",STATE:"SD",TYPE:"County",CNTRY:"USA"},id:"46081"},{type:"Feature",geometry:{type:"Polygon",coordinates:[[[-96.89,43.85],[-97.129,43.85],[-97.368,43.85],[-97.37,44.196],[-97.129,44.196],[-96.887,44.197],[-96.89,43.85]]]},properties:{name:"Lake",id:"46079",STATE:"SD",TYPE:"County",CNTRY:"USA"},id:"46079"},{type:"Feature",geometry:{type:"Polygon",coordinates:[[[-97.853,44.545],[-97.492,44.544],[-97.128,44.545],[-97.129,44.196],[-97.37,44.196],[-97.851,44.196],[-97.853,44.545]]]},properties:{name:"Kingsbury",id:"46077",STATE:"SD",TYPE:"County",CNTRY:"USA"},id:"46077"},{type:"Feature",geometry:{type:"Polygon",coordinates:[[[-101.046,44.17],[-100.37,44.167],[-100.366,43.846],[-100.339,43.846],[-100.338,43.717],[-100.416,43.735],[-100.471,43.721],[-100.584,43.765],[-100.681,43.712],[-100.776,43.724],[-100.811,43.766],[-100.897,43.79],[-100.919,43.823],[-100.953,43.81],[-100.989,43.848],[-101.068,43.844],[-101.066,43.995],[-101.047,43.996],[-101.046,44.17]]]},properties:{name:"Jones",id:"46075",STATE:"SD",TYPE:"County",CNTRY:"USA"},id:"46075"},{type:"Feature",geometry:{type:"Polygon",coordinates:[[[-98.332,43.939],[-98.807,43.935],[-98.926,43.936],[-98.926,44.198],[-98.701,44.198],[-98.332,44.197],[-98.332,43.939]]]},properties:{name:"Jerauld",id:"46073",STATE:"SD",TYPE:"County",CNTRY:"USA"},id:"46073"},{type:"Feature",geometry:{type:"Polygon",coordinates:[[[-101.066,43.995],[-101.068,43.844],[-101.138,43.839],[-101.23,43.795],[-101.234,43.783],[-101.228,43.388],[-101.754,43.389],[-102.116,43.389],[-102.116,43.475],[-102.142,43.475],[-102.143,43.7],[-102.06,43.688],[-102.022,43.709],[-102.023,43.994],[-102.011,43.994],[-101.648,43.994],[-101.066,43.995]]]},properties:{name:"Jackson",id:"46071",STATE:"SD",TYPE:"County",CNTRY:"USA"},id:"46071"},{type:"Feature",geometry:{type:"Polygon",coordinates:[[[-99.313,44.898],[-99.312,44.55],[-99.302,44.55],[-99.299,44.196],[-99.574,44.193],[-99.662,44.217],[-99.663,44.55],[-99.675,44.55],[-99.675,44.898],[-99.573,44.898],[-99.313,44.898]]]},properties:{name:"Hyde",id:"46069",STATE:"SD",TYPE:"County",CNTRY:"USA"},id:"46069"},{type:"Feature",geometry:{type:"Polygon",coordinates:[[[-97.401,43.5],[-97.396,43.169],[-97.637,43.169],[-98.078,43.168],[-98.109,43.196],[-98.114,43.499],[-97.962,43.498],[-97.605,43.499],[-97.401,43.5]]]},properties:{name:"Hutchinson",id:"46067",STATE:"SD",TYPE:"County",CNTRY:"USA"},id:"46067"},{type:"Feature",geometry:{type:"Polygon",coordinates:[[[-99.662,44.217],[-99.697,44.208],[-99.686,44.17],[-99.63,44.162],[-99.597,44.117],[-99.646,44.099],[-99.776,44.135],[-99.846,44.121],[-99.884,44.13],[-99.935,44.194],[-99.892,44.235],[-99.918,44.265],[-99.966,44.262],[-100.088,44.31],[-100.163,44.326],[-100.219,44.323],[-100.355,44.347],[-100.369,44.36],[-100.39,44.443],[-100.43,44.461],[-100.548,44.445],[-100.578,44.461],[-100.579,44.493],[-100.519,44.521],[-100.521,44.546],[-100.028,44.548],[-99.675,44.55],[-99.663,44.55],[-99.662,44.217]]]},properties:{name:"Hughes",id:"46065",STATE:"SD",TYPE:"County",CNTRY:"USA"},id:"46065"},{type:"Feature",geometry:{type:"Polygon",coordinates:[[[-102.959,45.213],[-103.326,45.212],[-104.041,45.214],[-104.043,45.557],[-104.044,45.944],[-102.943,45.944],[-102.944,45.731],[-102.955,45.732],[-102.959,45.213]]]},properties:{name:"Harding",id:"46063",STATE:"SD",TYPE:"County",CNTRY:"USA"},id:"46063"},{type:"Feature",geometry:{type:"Polygon",coordinates:[[[-97.608,43.85],[-97.605,43.499],[-97.962,43.498],[-97.966,43.851],[-97.849,43.85],[-97.608,43.85]]]},properties:{name:"Hanson",id:"46061",STATE:"SD",TYPE:"County",CNTRY:"USA"},id:"46061"},{type:"Feature",geometry:{type:"Polygon",coordinates:[[[-98.701,44.198],[-98.926,44.198],[-99.299,44.196],[-99.302,44.55],[-99.312,44.55],[-99.313,44.898],[-98.719,44.896],[-98.707,44.896],[-98.707,44.635],[-98.699,44.435],[-98.701,44.198]]]},properties:{name:"Hand",id:"46059",STATE:"SD",TYPE:"County",CNTRY:"USA"},id:"46059"},{type:"Feature",geometry:{type:"Polygon",coordinates:[[[-96.886,44.804],[-96.887,44.545],[-97.128,44.545],[-97.492,44.544],[-97.491,44.805],[-97.248,44.804],[-96.886,44.804]]]},properties:{name:"Hamlin",id:"46057",STATE:"SD",TYPE:"County",CNTRY:"USA"},id:"46057"},{type:"Feature",geometry:{type:"Polygon",coordinates:[[[-101.046,44.17],[-101.047,43.996],[-101.066,43.995],[-101.648,43.994],[-102.011,43.994],[-102.009,44.344],[-102.002,44.507],[-101.987,44.523],[-101.905,44.534],[-101.835,44.525],[-101.776,44.537],[-101.711,44.578],[-101.664,44.585],[-101.624,44.573],[-101.527,44.569],[-101.469,44.607],[-101.455,44.636],[-101.329,44.689],[-101.196,44.699],[-101.137,44.751],[-101.156,44.689],[-101.159,44.343],[-101.171,44.343],[-101.169,44.168],[-101.046,44.17]]]},properties:{name:"Haakon",id:"46055",STATE:"SD",TYPE:"County",CNTRY:"USA"},id:"46055"},{type:"Feature",geometry:{type:"Polygon",coordinates:[[[-98.5,42.998],[-99.253,42.997],[-99.533,42.998],[-99.533,43.5],[-99.292,43.5],[-99.305,43.461],[-99.25,43.437],[-99.165,43.434],[-99.068,43.32],[-98.983,43.255],[-98.901,43.244],[-98.865,43.216],[-98.864,43.165],[-98.823,43.145],[-98.757,43.137],[-98.68,43.069],[-98.553,43.057],[-98.5,42.998]]]},properties:{name:"Gregory",id:"46053",STATE:"SD",TYPE:"County",CNTRY:"USA"},id:"46053"},{type:"Feature",geometry:{type:"Polygon",coordinates:[[[-96.453,44.979],[-96.885,44.978],[-96.885,45.153],[-97.226,45.154],[-97.226,45.3],[-97.009,45.299],[-96.995,45.328],[-96.47,45.329],[-96.452,45.302],[-96.453,44.979]]]},properties:{name:"Grant",id:"46051",STATE:"SD",TYPE:"County",CNTRY:"USA"},id:"46051"},{type:"Feature",geometry:{type:"Polygon",coordinates:[[[-98.725,45.246],[-98.718,45.245],[-98.721,45.102],[-98.719,44.896],[-99.313,44.898],[-99.573,44.898],[-99.575,45.246],[-99.205,45.245],[-98.725,45.246]]]},properties:{name:"Faulk",id:"46049",STATE:"SD",TYPE:"County",CNTRY:"USA"},id:"46049"},{type:"Feature",geometry:{type:"Polygon",coordinates:[[[-103.001,43.476],[-102.999,43],[-103.637,43.001],[-104.053,43.003],[-104.054,43.477],[-103.459,43.476],[-103.001,43.476]]]},properties:{name:"Fall River",id:"46047",STATE:"SD",TYPE:"County",CNTRY:"USA"},id:"46047"},{type:"Feature",geometry:{type:"Polygon",coordinates:[[[-98.725,45.246],[-99.205,45.245],[-99.575,45.246],[-99.711,45.246],[-99.71,45.595],[-99.346,45.594],[-98.73,45.591],[-98.725,45.496],[-98.725,45.246]]]},properties:{name:"Edmunds",id:"46045",STATE:"SD",TYPE:"County",CNTRY:"USA"},id:"46045"},{type:"Feature",geometry:{type:"Polygon",coordinates:[[[-98.322,43.5],[-98.114,43.499],[-98.109,43.196],[-98.677,43.371],[-98.706,43.371],[-98.709,43.499],[-98.322,43.5]]]},properties:{name:"Douglas",id:"46043",STATE:"SD",TYPE:"County",CNTRY:"USA"},id:"46043"},{type:"Feature",geometry:{type:"Polygon",coordinates:[[[-100.341,45.473],[-100.337,45.449],[-100.278,45.384],[-100.316,45.312],[-100.262,45.247],[-100.281,45.158],[-100.329,45.095],[-100.321,45.062],[-100.281,45.024],[-100.358,45.027],[-100.403,45.015],[-100.426,44.984],[-100.424,44.928],[-100.403,44.899],[-100.398,44.861],[-100.475,44.815],[-100.533,44.765],[-100.603,44.767],[-100.678,44.828],[-100.73,44.799],[-100.716,44.767],[-100.772,44.759],[-100.825,44.781],[-100.899,44.78],[-100.985,44.735],[-101.038,44.726],[-101.137,44.751],[-101.137,44.994],[-101.501,44.994],[-101.486,45.038],[-101.486,45.385],[-101.47,45.386],[-101.47,45.472],[-101.005,45.472],[-100.341,45.473]]]},properties:{name:"Dewey",id:"46041",STATE:"SD",TYPE:"County",CNTRY:"USA"},id:"46041"},{type:"Feature",geometry:{type:"Polygon",coordinates:[[[-96.453,44.979],[-96.453,44.544],[-96.887,44.545],[-96.886,44.804],[-96.885,44.978],[-96.453,44.979]]]},properties:{name:"Deuel",id:"46039",STATE:"SD",TYPE:"County",CNTRY:"USA"},id:"46039"},{type:"Feature",geometry:{type:"Polygon",coordinates:[[[-97.227,45.56],[-97.226,45.3],[-97.226,45.154],[-97.495,45.154],[-97.981,45.155],[-97.98,45.241],[-97.98,45.588],[-97.373,45.589],[-97.363,45.56],[-97.227,45.56]]]},properties:{name:"Day",id:"46037",STATE:"SD",TYPE:"County",CNTRY:"USA"},id:"46037"},{type:"Feature",geometry:{type:"Polygon",coordinates:[[[-97.962,43.498],[-98.114,43.499],[-98.322,43.5],[-98.326,43.585],[-98.327,43.851],[-97.966,43.851],[-97.962,43.498]]]},properties:{name:"Davison",id:"46035",STATE:"SD",TYPE:"County",CNTRY:"USA"},id:"46035"},{type:"Feature",geometry:{type:"Polygon",coordinates:[[[-102.811,43.685],[-102.815,43.666],[-102.907,43.673],[-102.933,43.62],[-103.002,43.607],[-103.001,43.476],[-103.459,43.476],[-104.054,43.477],[-104.055,43.853],[-103.574,43.856],[-102.983,43.854],[-102.688,43.854],[-102.697,43.795],[-102.803,43.706],[-102.811,43.685]]]},properties:{name:"Custer",id:"46033",STATE:"SD",TYPE:"County",CNTRY:"USA"},id:"46033"},{type:"Feature",geometry:{type:"Polygon",coordinates:[[[-101.999,45.944],[-101.083,45.943],[-100.512,45.944],[-100.473,45.909],[-100.429,45.915],[-100.427,45.879],[-100.357,45.855],[-100.387,45.817],[-100.367,45.802],[-100.335,45.732],[-100.298,45.707],[-100.339,45.655],[-100.392,45.661],[-100.429,45.645],[-100.43,45.595],[-100.484,45.551],[-100.471,45.519],[-100.381,45.51],[-100.341,45.473],[-101.005,45.472],[-101.47,45.472],[-101.999,45.471],[-101.999,45.944]]]},properties:{name:"Corson",id:"46031",STATE:"SD",TYPE:"County",CNTRY:"USA"},id:"46031"},{type:"Feature",geometry:{type:"Polygon",coordinates:[[[-96.886,44.804],[-97.248,44.804],[-97.491,44.805],[-97.495,45.154],[-97.226,45.154],[-96.885,45.153],[-96.885,44.978],[-96.886,44.804]]]},properties:{name:"Codington",id:"46029",STATE:"SD",TYPE:"County",CNTRY:"USA"},id:"46029"},{type:"Feature",geometry:{type:"Polygon",coordinates:[[[-96.804,43.083],[-96.807,42.695],[-96.859,42.723],[-96.921,42.733],[-96.95,42.719],[-96.975,42.757],[-97.069,42.761],[-97.135,42.774],[-97.158,42.8],[-97.159,43.084],[-96.922,43.084],[-96.804,43.083]]]},properties:{name:"Clay",id:"46027",STATE:"SD",TYPE:"County",CNTRY:"USA"},id:"46027"},{type:"Feature",geometry:{type:"Polygon",coordinates:[[[-97.491,44.805],[-97.492,44.544],[-97.853,44.545],[-97.855,44.631],[-97.977,44.632],[-97.977,44.892],[-97.983,44.893],[-97.981,45.155],[-97.495,45.154],[-97.491,44.805]]]},properties:{name:"Clark",id:"46025",STATE:"SD",TYPE:"County",CNTRY:"USA"},id:"46025"},{type:"Feature",geometry:{type:"Polygon",coordinates:[[[-98.709,43.499],[-98.706,43.371],[-98.677,43.371],[-98.109,43.196],[-98.078,43.168],[-98.103,43.127],[-98.111,42.999],[-98.092,42.975],[-98.121,42.908],[-98.109,42.892],[-98.145,42.837],[-98.345,42.892],[-98.405,42.926],[-98.438,42.93],[-98.5,42.998],[-98.553,43.057],[-98.68,43.069],[-98.757,43.137],[-98.823,43.145],[-98.864,43.165],[-98.865,43.216],[-98.901,43.244],[-98.983,43.255],[-99.068,43.32],[-99.165,43.434],[-99.25,43.437],[-99.305,43.461],[-99.292,43.5],[-98.796,43.5],[-98.709,43.499]]]},properties:{name:"Charles Mix",id:"46023",STATE:"SD",TYPE:"County",CNTRY:"USA"},id:"46023"},{type:"Feature",geometry:{type:"Polygon",coordinates:[[[-99.721,45.942],[-99.72,45.596],[-100.43,45.595],[-100.429,45.645],[-100.392,45.661],[-100.339,45.655],[-100.298,45.707],[-100.335,45.732],[-100.367,45.802],[-100.387,45.817],[-100.357,45.855],[-100.427,45.879],[-100.429,45.915],[-100.473,45.909],[-100.512,45.944],[-100.007,45.942],[-99.721,45.942]]]},properties:{name:"Campbell",id:"46021",STATE:"SD",TYPE:"County",CNTRY:"USA"},id:"46021"},{type:"Feature",geometry:{type:"Polygon",coordinates:[[[-102.959,45.213],[-102.958,45.039],[-102.959,44.69],[-102.966,44.604],[-103.567,44.604],[-103.816,44.605],[-103.837,44.589],[-103.902,44.595],[-103.934,44.58],[-104.056,44.572],[-104.057,44.999],[-104.04,44.999],[-104.041,45.214],[-103.326,45.212],[-102.959,45.213]]]},properties:{name:"Butte",id:"46019",STATE:"SD",TYPE:"County",CNTRY:"USA"},id:"46019"},{type:"Feature",geometry:{type:"Polygon",coordinates:[[[-98.926,44.198],[-98.926,43.936],[-99.356,43.934],[-99.353,43.983],[-99.426,44.042],[-99.51,44.057],[-99.544,44.081],[-99.555,44.121],[-99.54,44.157],[-99.574,44.193],[-99.299,44.196],[-98.926,44.198]]]},properties:{name:"Buffalo",id:"46017",STATE:"SD",TYPE:"County",CNTRY:"USA"},id:"46017"},{type:"Feature",geometry:{type:"Polygon",coordinates:[[[-98.807,43.935],[-98.797,43.849],[-98.796,43.5],[-99.292,43.5],[-99.282,43.529],[-99.332,43.57],[-99.338,43.628],[-99.38,43.655],[-99.46,43.657],[-99.454,43.688],[-99.408,43.703],[-99.414,43.761],[-99.366,43.793],[-99.306,43.854],[-99.358,43.899],[-99.356,43.934],[-98.926,43.936],[-98.807,43.935]]]},properties:{name:"Brule",id:"46015",STATE:"SD",TYPE:"County",CNTRY:"USA"},id:"46015"},{type:"Feature",geometry:{type:"Polygon",coordinates:[[[-97.977,45.935],[-97.98,45.588],[-97.98,45.241],[-98.718,45.245],[-98.725,45.246],[-98.725,45.496],[-98.73,45.591],[-98.727,45.937],[-98.354,45.935],[-97.977,45.935]]]},properties:{name:"Brown",id:"46013",STATE:"SD",TYPE:"County",CNTRY:"USA"},id:"46013"},{type:"Feature",geometry:{type:"Polygon",coordinates:[[[-96.887,44.197],[-97.129,44.196],[-97.128,44.545],[-96.887,44.545],[-96.453,44.544],[-96.454,44.198],[-96.887,44.197]]]},properties:{name:"Brookings",id:"46011",STATE:"SD",TYPE:"County",CNTRY:"USA"},id:"46011"},{type:"Feature",geometry:{type:"Polygon",coordinates:[[[-97.637,43.169],[-97.634,42.86],[-97.682,42.833],[-97.708,42.859],[-97.792,42.84],[-97.827,42.869],[-97.876,42.857],[-97.883,42.828],[-97.942,42.776],[-98.012,42.762],[-98.067,42.785],[-98.145,42.837],[-98.109,42.892],[-98.121,42.908],[-98.092,42.975],[-98.111,42.999],[-98.103,43.127],[-98.078,43.168],[-97.637,43.169]]]},properties:{name:"Bon Homme",id:"46009",STATE:"SD",TYPE:"County",CNTRY:"USA"},id:"46009"},{type:"Feature",geometry:{type:"Polygon",coordinates:[[[-101.228,43.388],[-101.228,42.995],[-101.677,42.995],[-102.083,42.998],[-102.086,43.128],[-102.112,43.128],[-102.116,43.389],[-101.754,43.389],[-101.228,43.388]]]},properties:{name:"Bennett",id:"46007",STATE:"SD",TYPE:"County",CNTRY:"USA"},id:"46007"},{type:"Feature",geometry:{type:"Polygon",coordinates:[[[-97.853,44.545],[-97.851,44.196],[-98.332,44.197],[-98.701,44.198],[-98.699,44.435],[-98.707,44.635],[-98.448,44.632],[-97.977,44.632],[-97.855,44.631],[-97.853,44.545]]]},properties:{name:"Beadle",id:"46005",STATE:"SD",TYPE:"County",CNTRY:"USA"},id:"46005"},{type:"Feature",geometry:{type:"Polygon",coordinates:[[[-98.332,43.939],[-98.327,43.851],[-98.326,43.585],[-98.322,43.5],[-98.709,43.499],[-98.796,43.5],[-98.797,43.849],[-98.807,43.935],[-98.332,43.939]]]},properties:{name:"Aurora",id:"46003",STATE:"SD",TYPE:"County",CNTRY:"USA"},id:"46003"}]}}},["s15t"]); //# sourceMappingURL=sdLow.js.map
'use strict'; const { Collection } = require('@discordjs/collection'); const { DiscordSnowflake } = require('@sapphire/snowflake'); const { InteractionType, Routes } = require('discord-api-types/v10'); const { TypeError, Error } = require('../../errors'); const InteractionCollector = require('../InteractionCollector'); const MessageCollector = require('../MessageCollector'); const MessagePayload = require('../MessagePayload'); /** * Interface for classes that have text-channel-like features. * @interface */ class TextBasedChannel { constructor() { /** * A manager of the messages sent to this channel * @type {MessageManager} */ this.messages = new MessageManager(this); /** * The channel's last message id, if one was sent * @type {?Snowflake} */ this.lastMessageId = null; /** * The timestamp when the last pinned message was pinned, if there was one * @type {?number} */ this.lastPinTimestamp = null; } /** * The Message object of the last message in the channel, if one was sent * @type {?Message} * @readonly */ get lastMessage() { return this.messages.resolve(this.lastMessageId); } /** * The date when the last pinned message was pinned, if there was one * @type {?Date} * @readonly */ get lastPinAt() { return this.lastPinTimestamp && new Date(this.lastPinTimestamp); } /** * Base options provided when sending. * @typedef {Object} BaseMessageOptions * @property {boolean} [tts=false] Whether or not the message should be spoken aloud * @property {string} [nonce=''] The nonce for the message * @property {string} [content=''] The content for the message * @property {Embed[]|APIEmbed[]} [embeds] The embeds for the message * (see [here](https://discord.com/developers/docs/resources/channel#embed-object) for more details) * @property {MessageMentionOptions} [allowedMentions] Which mentions should be parsed from the message content * (see [here](https://discord.com/developers/docs/resources/channel#allowed-mentions-object) for more details) * @property {FileOptions[]|BufferResolvable[]|Attachment[]} [files] Files to send with the message * @property {ActionRow[]|ActionRowOptions[]} [components] * Action rows containing interactive components for the message (buttons, select menus) * @property {Array<JSONEncodable<AttachmentPayload>>} [attachments] Attachments to send in the message */ /** * Options provided when sending or editing a message. * @typedef {BaseMessageOptions} MessageOptions * @property {ReplyOptions} [reply] The options for replying to a message * @property {StickerResolvable[]} [stickers=[]] Stickers to send in the message * @property {MessageFlags} [flags] Which flags to set for the message. Only `MessageFlags.SuppressEmbeds` can be set. */ /** * Options provided to control parsing of mentions by Discord * @typedef {Object} MessageMentionOptions * @property {MessageMentionTypes[]} [parse] Types of mentions to be parsed * @property {Snowflake[]} [users] Snowflakes of Users to be parsed as mentions * @property {Snowflake[]} [roles] Snowflakes of Roles to be parsed as mentions * @property {boolean} [repliedUser=true] Whether the author of the Message being replied to should be pinged */ /** * Types of mentions to enable in MessageMentionOptions. * - `roles` * - `users` * - `everyone` * @typedef {string} MessageMentionTypes */ /** * @typedef {Object} FileOptions * @property {BufferResolvable} attachment File to attach * @property {string} [name='file.jpg'] Filename of the attachment * @property {string} description The description of the file */ /** * Options for sending a message with a reply. * @typedef {Object} ReplyOptions * @property {MessageResolvable} messageReference The message to reply to (must be in the same channel and not system) * @property {boolean} [failIfNotExists=this.client.options.failIfNotExists] Whether to error if the referenced * message does not exist (creates a standard message in this case when false) */ /** * Sends a message to this channel. * @param {string|MessagePayload|MessageOptions} options The options to provide * @returns {Promise<Message>} * @example * // Send a basic message * channel.send('hello!') * .then(message => console.log(`Sent message: ${message.content}`)) * .catch(console.error); * @example * // Send a remote file * channel.send({ * files: ['https://cdn.discordapp.com/icons/222078108977594368/6e1019b3179d71046e463a75915e7244.png?size=2048'] * }) * .then(console.log) * .catch(console.error); * @example * // Send a local file * channel.send({ * files: [{ * attachment: 'entire/path/to/file.jpg', * name: 'file.jpg', * description: 'A description of the file' * }] * }) * .then(console.log) * .catch(console.error); * @example * // Send an embed with a local image inside * channel.send({ * content: 'This is an embed', * embeds: [ * { * thumbnail: { * url: 'attachment://file.jpg' * } * } * ], * files: [{ * attachment: 'entire/path/to/file.jpg', * name: 'file.jpg', * description: 'A description of the file' * }] * }) * .then(console.log) * .catch(console.error); */ async send(options) { const User = require('../User'); const { GuildMember } = require('../GuildMember'); if (this instanceof User || this instanceof GuildMember) { const dm = await this.createDM(); return dm.send(options); } let messagePayload; if (options instanceof MessagePayload) { messagePayload = options.resolveBody(); } else { messagePayload = MessagePayload.create(this, options).resolveBody(); } const { body, files } = await messagePayload.resolveFiles(); const d = await this.client.rest.post(Routes.channelMessages(this.id), { body, files }); return this.messages.cache.get(d.id) ?? this.messages._add(d); } /** * Sends a typing indicator in the channel. * @returns {Promise<void>} Resolves upon the typing status being sent * @example * // Start typing in a channel * channel.sendTyping(); */ async sendTyping() { await this.client.rest.post(Routes.channelTyping(this.id)); } /** * Creates a Message Collector. * @param {MessageCollectorOptions} [options={}] The options to pass to the collector * @returns {MessageCollector} * @example * // Create a message collector * const filter = m => m.content.includes('discord'); * const collector = channel.createMessageCollector({ filter, time: 15_000 }); * collector.on('collect', m => console.log(`Collected ${m.content}`)); * collector.on('end', collected => console.log(`Collected ${collected.size} items`)); */ createMessageCollector(options = {}) { return new MessageCollector(this, options); } /** * An object containing the same properties as CollectorOptions, but a few more: * @typedef {MessageCollectorOptions} AwaitMessagesOptions * @property {string[]} [errors] Stop/end reasons that cause the promise to reject */ /** * Similar to createMessageCollector but in promise form. * Resolves with a collection of messages that pass the specified filter. * @param {AwaitMessagesOptions} [options={}] Optional options to pass to the internal collector * @returns {Promise<Collection<Snowflake, Message>>} * @example * // Await !vote messages * const filter = m => m.content.startsWith('!vote'); * // Errors: ['time'] treats ending because of the time limit as an error * channel.awaitMessages({ filter, max: 4, time: 60_000, errors: ['time'] }) * .then(collected => console.log(collected.size)) * .catch(collected => console.log(`After a minute, only ${collected.size} out of 4 voted.`)); */ awaitMessages(options = {}) { return new Promise((resolve, reject) => { const collector = this.createMessageCollector(options); collector.once('end', (collection, reason) => { if (options.errors?.includes(reason)) { reject(collection); } else { resolve(collection); } }); }); } /** * Creates a component interaction collector. * @param {MessageComponentCollectorOptions} [options={}] Options to send to the collector * @returns {InteractionCollector} * @example * // Create a button interaction collector * const filter = (interaction) => interaction.customId === 'button' && interaction.user.id === 'someId'; * const collector = channel.createMessageComponentCollector({ filter, time: 15_000 }); * collector.on('collect', i => console.log(`Collected ${i.customId}`)); * collector.on('end', collected => console.log(`Collected ${collected.size} items`)); */ createMessageComponentCollector(options = {}) { return new InteractionCollector(this.client, { ...options, interactionType: InteractionType.MessageComponent, channel: this, }); } /** * Collects a single component interaction that passes the filter. * The Promise will reject if the time expires. * @param {AwaitMessageComponentOptions} [options={}] Options to pass to the internal collector * @returns {Promise<MessageComponentInteraction>} * @example * // Collect a message component interaction * const filter = (interaction) => interaction.customId === 'button' && interaction.user.id === 'someId'; * channel.awaitMessageComponent({ filter, time: 15_000 }) * .then(interaction => console.log(`${interaction.customId} was clicked!`)) * .catch(console.error); */ awaitMessageComponent(options = {}) { const _options = { ...options, max: 1 }; return new Promise((resolve, reject) => { const collector = this.createMessageComponentCollector(_options); collector.once('end', (interactions, reason) => { const interaction = interactions.first(); if (interaction) resolve(interaction); else reject(new Error('INTERACTION_COLLECTOR_ERROR', reason)); }); }); } /** * Bulk deletes given messages that are newer than two weeks. * @param {Collection<Snowflake, Message>|MessageResolvable[]|number} messages * Messages or number of messages to delete * @param {boolean} [filterOld=false] Filter messages to remove those which are older than two weeks automatically * @returns {Promise<Collection<Snowflake, Message>>} Returns the deleted messages * @example * // Bulk delete messages * channel.bulkDelete(5) * .then(messages => console.log(`Bulk deleted ${messages.size} messages`)) * .catch(console.error); */ async bulkDelete(messages, filterOld = false) { if (Array.isArray(messages) || messages instanceof Collection) { let messageIds = messages instanceof Collection ? [...messages.keys()] : messages.map(m => m.id ?? m); if (filterOld) { messageIds = messageIds.filter(id => Date.now() - DiscordSnowflake.timestampFrom(id) < 1_209_600_000); } if (messageIds.length === 0) return new Collection(); if (messageIds.length === 1) { const message = this.client.actions.MessageDelete.getMessage( { message_id: messageIds[0], }, this, ); await this.client.rest.delete(Routes.channelMessage(this.id, messageIds[0])); return message ? new Collection([[message.id, message]]) : new Collection(); } await this.client.rest.post(Routes.channelBulkDelete(this.id), { body: { messages: messageIds } }); return messageIds.reduce( (col, id) => col.set( id, this.client.actions.MessageDeleteBulk.getMessage( { message_id: id, }, this, ), ), new Collection(), ); } if (!isNaN(messages)) { const msgs = await this.messages.fetch({ limit: messages }); return this.bulkDelete(msgs, filterOld); } throw new TypeError('MESSAGE_BULK_DELETE_TYPE'); } /** * Fetches all webhooks for the channel. * @returns {Promise<Collection<Snowflake, Webhook>>} * @example * // Fetch webhooks * channel.fetchWebhooks() * .then(hooks => console.log(`This channel has ${hooks.size} hooks`)) * .catch(console.error); */ fetchWebhooks() { return this.guild.channels.fetchWebhooks(this.id); } /** * Options used to create a {@link Webhook} in a {@link TextChannel} or a {@link NewsChannel}. * @typedef {Object} ChannelWebhookCreateOptions * @property {?(BufferResolvable|Base64Resolvable)} [avatar] Avatar for the webhook * @property {string} [reason] Reason for creating the webhook */ /** * Creates a webhook for the channel. * @param {string} name The name of the webhook * @param {ChannelWebhookCreateOptions} [options] Options for creating the webhook * @returns {Promise<Webhook>} Returns the created Webhook * @example * // Create a webhook for the current channel * channel.createWebhook('Snek', { * avatar: 'https://i.imgur.com/mI8XcpG.jpg', * reason: 'Needed a cool new Webhook' * }) * .then(console.log) * .catch(console.error) */ createWebhook(name, options = {}) { return this.guild.channels.createWebhook(this.id, name, options); } static applyToClass(structure, full = false, ignore = []) { const props = ['send']; if (full) { props.push( 'lastMessage', 'lastPinAt', 'bulkDelete', 'sendTyping', 'createMessageCollector', 'awaitMessages', 'createMessageComponentCollector', 'awaitMessageComponent', 'fetchWebhooks', 'createWebhook', ); } for (const prop of props) { if (ignore.includes(prop)) continue; Object.defineProperty( structure.prototype, prop, Object.getOwnPropertyDescriptor(TextBasedChannel.prototype, prop), ); } } } module.exports = TextBasedChannel; // Fixes Circular // eslint-disable-next-line import/order const MessageManager = require('../../managers/MessageManager');
import React from 'react'; import Product from './Product'; import Ingredients from './Ingredients'; const Results = () => ( <div> This is from Results component. <Ingredients/> <Product/> </div> ); export default Results;
import { render } from '@testing-library/react'; import Nav from '../../components/Nav'; describe('Nav', () => { it('renders a text', () => { const { getByText } = render( <Nav />, ); const logo = getByText(/Hello Stranger/i); expect(logo).toBeInTheDocument(); }); });
/** * Copyright (C) 2000-2014 Geometria Contributors * http://geocentral.net/geometria * * Geometria is free software released under the MIT License * http://opensource.org/licenses/MIT */ define([ "dojo/_base/lang", "dojo/Deferred", "dijit/form/ValidationTextBox", "dijit/layout/ContentPane", "dijit/layout/LayoutContainer", "geometria/GDictionary", "geometria/GFace", "geometria/GFiguresContainer", "geometria/GMainContainer", "geometria/GMath", "geometria/GMeasurement", "geometria/GNotepadContainer", "geometria/GNotepadRecord", "geometria/GPoint", "geometria/GUtils", "geometria/GVariable", "geometria/GWidgets" ], function(lang, Deferred, ValidationTextBox, ContentPane, LayoutContainer, dict, GFace, figuresContainer, mainContainer, math, GMeasurement, notepadContainer, GNotepadRecord, GPoint, utils, GVariable, widgets) { var helpTopic = "MeasureAngle"; var measurementType = "angle"; var validatePoints = function(props, results) { results = results || { points: [{}, {}, {}], variable: {} }; var solid = figuresContainer.getFigure(props.figureName).solid; var pointsValid = true; $.each(props.points, function(index, label) { if (solid.points[label]) { results.points[index].valid = true; } else { pointsValid = false; results.points[index].error = dict.get("NoSuchPointInSelectedFigure"); } }); if (!pointsValid) { return false; } if (props.points[0] == props.points[1] || props.points[0] == props.points[2] || props.points[1] == props.points[2]) { return false; } return true; }; var validateVariable = function(props, results) { results = results || { points: [{}, {}, {}], variable: {} }; if (!utils.variableRegex.test(props.variableName)) { results.variable.error = dict.get("VariableRule"); return false; } if (notepadContainer.getRecord(props.variableName)) { results.variable.error = dict.get("VariableAlreadyExists", props.variableName); return false; } results.variable.valid = true; return true; }; var validate = function(props, results) { var pointsValid = validatePoints(props, results) var variableValid = validateVariable(props, results); return pointsValid && variableValid; }; var validateExternal = function(props) { if (!Array.isArray(props.points) || props.points.length != 3 || !props.figureName) { return false; } var figure = figuresContainer.getFigure(props.figureName); if (!figure) { return false; } return validate(props); }; var validateSelection = function() { var figure = figuresContainer.getSelectedFigure(); var solid = figure.solid; var selectedElements = []; $.each(solid.selection, function(code, element) { selectedElements.push(element); }); var props; if (selectedElements.length == 2) { if (!(selectedElements[0] instanceof GPoint || selectedElements[0] instanceof GFace || selectedElements[1] instanceof GPoint || selectedElements[1] instanceof GFace)) { var labels; var labels1 = [selectedElements[0].p1.label, selectedElements[0].p2.label]; var labels2 = [selectedElements[1].p1.label, selectedElements[1].p2.label]; if (labels1[0] == labels2[0]) { labels = [labels1[1], labels1[0], labels2[1]]; } else if (labels1[0] == labels2[1]) { labels = [labels1[1], labels1[0], labels2[0]]; } else if (labels1[1] == labels2[0]) { labels = [labels1[0], labels1[1], labels2[1]]; } else if (labels1[1] == labels2[1]) { labels = [labels1[0], labels1[1], labels2[0]]; } if (labels) { var props = { figureName: figure.name, points: labels }; if (validatePoints(props)) { return props; } } } } return null; }; var apply = function(props) { var figure = figuresContainer.getFigure(props.figureName); var solid = figure.solid; var ps = []; $.each(props.points, function(index, label) { ps.push(solid.points[label]); }); var angle = math.angle(ps[0].crds, ps[1].crds, ps[2].crds); var variable = new GVariable(props.variableName, angle); var expression = new GMeasurement(measurementType, props); var record = new GNotepadRecord(variable, expression); notepadContainer.add(record); return props; }; return { loggable: true, figureSpecific: true, icon: "geometriaIcon24 geometriaIcon24MeasureAngle", label: dict.get("action.MeasureAngle"), measurementType: measurementType, expressionRegex: /^\<([A-Z][0-9]*)([A-Z][0-9]*)([A-Z][0-9]*)$/, execute: function() { var selectionProps = validateSelection(); var dialogDeferred = new Deferred(); var dialog; var figure = figuresContainer.getSelectedFigure(); var container = new LayoutContainer(); var topContainer = new LayoutContainer({ region: "center" }); var pInputs = []; var inputEnters = []; var createInputPane = function(region) { var pInputDeferred = new Deferred(); var pInput = widgets.validationTextBox({ "class": "geometria_pointinput", onKeyUp: function(event) { if (event.keyCode == 13 && !dialog.okButton.get("disabled")) { pInputDeferred.resolve(); } } }); pInputs.push(pInput); inputEnters.push(pInputDeferred.promise); var pContainer = new LayoutContainer({ "class": "geometria_inputcontainer", region: region }); var pPane = new ContentPane({ "class": "geometria_inputpane", region: region, content: pInput }); pContainer.addChild(pPane); return pContainer; }; var rightPane = new LayoutContainer({ "class": "geometria_inputcontainer", region: "right" }); var leftPane = new LayoutContainer({ "class": "geometria_inputcontainer", region: "left" }); var pPane1 = createInputPane("top"); rightPane.addChild(pPane1); leftPane.addChild(new ContentPane({ "style": "height:10%", region: "top" })); var pPane2 = createInputPane("center"); leftPane.addChild(pPane2); leftPane.addChild(new ContentPane({ "style": "height:10%", region: "bottom" })); var pPane3 = createInputPane("bottom"); rightPane.addChild(pPane3); topContainer.addChild(leftPane); topContainer.addChild(rightPane); var iconPane = new ContentPane({ "class": "geometriaIconMeasureAngle", region: "center" }); topContainer.addChild(iconPane); container.addChild(topContainer); if (selectionProps) { $.each([0, 1, 2], function(index) { pInputs[this].set("value", selectionProps.points[index]); }); } var bottomContainer = new LayoutContainer({ region: "bottom", style: "height:40px;" }); bottomContainer.addChild(new ContentPane({ region: "left", content: dict.get("AssignToVariable") })); var variableInputDeferred = new Deferred(); var variableInput = widgets.validationTextBox({ onKeyUp: function(event) { if (event.keyCode == 13 && !dialog.okButton.get("disabled")) { variableInputDeferred.resolve(); } } }); var variablePane = new ContentPane({ "class": "geometria_inputpane", region: "center", content: variableInput }); inputEnters.push(variableInputDeferred.promise); bottomContainer.addChild(variablePane); container.addChild(bottomContainer); dialog = widgets.okCancelHelpDialog(container, helpTopic, "geometria_measureangle", dict.get("MeasureAngle"), inputEnters); dialog.okButton.set("disabled", true); $.each(pInputs, function(inputIndex) { this.set("validator", function() { var inputProps = { figureName: figure.name, variableName: variableInput.get("value").trim(), points: [pInputs[0].get("value").trim().toUpperCase(), pInputs[1].get("value").trim().toUpperCase(), pInputs[2].get("value").trim().toUpperCase()] }; var results = { points: [{}, {}, {}], variable: {} }; var valid = validate(inputProps, results); if (results.points[inputIndex].error) { this.invalidMessage = results.points[inputIndex].error; } dialog.okButton.set("disabled", !valid); return results.points[inputIndex].valid || !inputProps.points[inputIndex].length; }); }); variableInput.set("validator", function() { var inputProps = { figureName: figure.name, variableName: variableInput.get("value").trim(), points: [pInputs[0].get("value").trim().toUpperCase(), pInputs[1].get("value").trim().toUpperCase(), pInputs[2].get("value").trim().toUpperCase()] }; var results = { points: [{}, {}, {}], variable: {} }; var valid = validate(inputProps, results); if (results.variable.error) { this.invalidMessage = results.variable.error; } dialog.okButton.set("disabled", !valid); return results.variable.valid || !inputProps.variableName.length; }); dialog.ok.then(function() { var figure = figuresContainer.getSelectedFigure(); var inputProps = { figureName: figure.name, variableName: variableInput.get("value").trim(), points: [pInputs[0].get("value").trim().toUpperCase(), pInputs[1].get("value").trim().toUpperCase(), pInputs[2].get("value").trim().toUpperCase()] }; var outProps = apply(inputProps); figure.solid.selection = {}; figure.draw(); mainContainer.setDocumentModified(true); dialogDeferred.resolve(outProps); }); return dialogDeferred.promise; }, getExpression: function(props) { return "<" + props.points[0] + props.points[1] + props.points[2]; }, validateSelection: validateSelection, undo: function(props) { notepadContainer.removeLastRecord(); }, playBack: function(props, external) { if (external && !validateExternal(props)) { return null; } return apply(props); }, evaluate: function(props) { var outProps = { figureName: props.figureName, variableName: props.variableName }; var match = new RegExp(this.expressionRegex).exec(props.expression); outProps.points = [match[1], match[2], match[3]]; if (!validateExternal(outProps)) { return null; } return apply(outProps); }, toTooltip: function(props) { return this.toLog(props); }, toLog: function(props) { return dict.get("MeasureAngleInFigure", props.variableName, props.points[0], props.points[1], props.points[2], props.figureName); }, toJson: function(props) { return { "action": "measureAngleAction", "props": { "figureName": props.figureName, "variableName": props.variableName, "points": props.points } }; } }; });
var f = require('../lib/file.js'); var $ = require('../lib/base.js'); var child = require("child_process"); var path = require('path'); var expect = require('expect.js'); describe('##jdf output...', function(){ this.timeout(10000); var css_background_url = f.read('result/css_background_url/css_background_url.css').split('\r\n'); var css_background_url_build = ''; var css_background_sprite_base64 = f.read('result/css_background_sprite_base64/css_background_sprite_base64.css').split('\r\n'); var css_background_sprite_base64_build = ''; var css_hack = f.read('result/css_hack/css_hack.css').split('\r\n'); var css_hack_build = ''; var js_cmd_define = f.read('result/js_cmd_define/js_cmd_define.js'); var js_cmd_define_build = ''; var js_seajs_use = f.read('result/js_seajs_use/js_seajs_use.js'); var js_seajs_use_build = ''; var sass_import_lib = f.read('result/sass_import_lib/sass_import_lib.css'); var sass_import_lib_build = ''; before(function(done){ child.exec('jdf o', function(error, stdout, stderr){ if(!error){ css_background_url_build = f.read('build/jdf-test/widget/css_background_url/css_background_url.css'); css_background_sprite_base64_build = f.read('build/jdf-test/widget/css_background_sprite_base64/css_background_sprite_base64.css'); css_hack_build = f.read('build/jdf-test/widget/css_hack/css_hack.css'); js_cmd_define_build = f.read('build/jdf-test/widget/js_cmd_define/js_cmd_define.js'); js_seajs_use_build = f.read('build/jdf-test/widget/js_seajs_use/js_seajs_use.js'); sass_import_lib_build = f.read('build/jdf-test/widget/sass_import_lib/sass_import_lib.css'); done(); } }); }); describe('#css_background_url', function(){ css_background_url.forEach(function(item, index){ it('test' + (index + 1) + ' should equal', function(){ var css_result = css_background_url[index]; if(css_result){ expect(css_background_url_build).to.contain(css_result); } }); }); }); describe('#css_background_sprite_base64', function(){ css_background_sprite_base64.forEach(function(item, index){ it('test' + (index + 1) + ' should equal', function(){ var css_result = css_background_sprite_base64[index]; if(css_result){ setTimeout(function(){ expect(css_background_sprite_base64_build).to.contain(css_result); }, 200) } }); }); }); describe('#css_hack', function(){ css_hack.forEach(function(item, index){ it('test' + (index + 1) + ' should equal', function(){ var css_result = css_hack[index]; if(css_result){ expect(css_hack_build).to.contain(css_result); } }); }); }); describe('#js_cmd_define', function(){ it('add cdn and project path for dependence', function(){ expect(js_cmd_define_build).to.contain(js_cmd_define); }) }); describe('#js_seajs_use', function(){ it('add cdn and project path for seajs use', function(){ expect(js_seajs_use_build).to.contain(js_seajs_use); }) }); describe('#sass_import_lib', function(){ it('import lib in sass file', function(){ expect(sass_import_lib_build).to.contain(sass_import_lib); }) }); });
/** * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE */ export * from './anchor-link.component'; export * from './anchor.component'; export * from './anchor.module'; //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljLWFwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL2NvbXBvbmVudHMvYW5jaG9yL3B1YmxpYy1hcGkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7OztHQUdHO0FBRUgsY0FBYyx5QkFBeUIsQ0FBQztBQUN4QyxjQUFjLG9CQUFvQixDQUFDO0FBQ25DLGNBQWMsaUJBQWlCLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIFVzZSBvZiB0aGlzIHNvdXJjZSBjb2RlIGlzIGdvdmVybmVkIGJ5IGFuIE1JVC1zdHlsZSBsaWNlbnNlIHRoYXQgY2FuIGJlXG4gKiBmb3VuZCBpbiB0aGUgTElDRU5TRSBmaWxlIGF0IGh0dHBzOi8vZ2l0aHViLmNvbS9ORy1aT1JSTy9uZy16b3Jyby1hbnRkL2Jsb2IvbWFzdGVyL0xJQ0VOU0VcbiAqL1xuXG5leHBvcnQgKiBmcm9tICcuL2FuY2hvci1saW5rLmNvbXBvbmVudCc7XG5leHBvcnQgKiBmcm9tICcuL2FuY2hvci5jb21wb25lbnQnO1xuZXhwb3J0ICogZnJvbSAnLi9hbmNob3IubW9kdWxlJztcbiJdfQ==
import React from 'react'; import Helmet from 'react-helmet'; import styles from './Layout.module.scss'; const Layout = ({ children, title, description }) => ( <div className={styles.layout}> <Helmet> <html lang="en" /> <title>{title}</title> <meta name="description" content={description} /> </Helmet> {children} </div> ); export default Layout;
import React from "react"; import { Wrapper, Logo, Link, Panel } from "./styles"; const Sidebar = ({ onCloseSidebar }) => { return ( <> <Panel onClick={onCloseSidebar} /> <Wrapper> <Logo to={"/"} onClick={onCloseSidebar}> Havoc Tracker </Logo> <Link to={"/add-survivor"} onClick={onCloseSidebar}> Add Survivor </Link> <Link to={"/survivors"} onClick={onCloseSidebar}> List Survivors </Link> <Link to={"/update-location"} onClick={onCloseSidebar}> Update Location </Link> <Link to={"/trade"} onClick={onCloseSidebar}> Trade Items </Link> <Link to={"/flag-infected"} onClick={onCloseSidebar}> Flag Infected </Link> <Link to={"/reports"} onClick={onCloseSidebar}> Reports </Link> </Wrapper> </> ); }; export default Sidebar;
const CorsBypass = require('./lib') const cors = new CorsBypass('https://rebit.ph', 2000) cors.start() console.log('\n', JSON.stringify(cors.info(), null, 2)) /** * do an HTTP GET request to http://localhost:2000/api/v1/rates * or * curl http://localhost:2000/api/v1/rates * */
/** * @fileoverview added by tsickle * @suppress {checkTypes} checked by tsc */ import { Component, EventEmitter, Input, Output } from '@angular/core'; import { BsNavigationDirection } from '../../models'; import { BsDatepickerConfig } from '../../bs-datepicker.config'; var BsDaysCalendarViewComponent = /** @class */ (function () { function BsDaysCalendarViewComponent(_config) { this._config = _config; this.onNavigate = new EventEmitter(); this.onViewMode = new EventEmitter(); this.onSelect = new EventEmitter(); this.onHover = new EventEmitter(); this.onHoverWeek = new EventEmitter(); } /** * @param {?} event * @return {?} */ BsDaysCalendarViewComponent.prototype.navigateTo = /** * @param {?} event * @return {?} */ function (event) { var /** @type {?} */ step = BsNavigationDirection.DOWN === event ? -1 : 1; this.onNavigate.emit({ step: { month: step } }); }; /** * @param {?} event * @return {?} */ BsDaysCalendarViewComponent.prototype.changeViewMode = /** * @param {?} event * @return {?} */ function (event) { this.onViewMode.emit(event); }; /** * @param {?} event * @return {?} */ BsDaysCalendarViewComponent.prototype.selectDay = /** * @param {?} event * @return {?} */ function (event) { this.onSelect.emit(event); }; /** * @param {?} week * @return {?} */ BsDaysCalendarViewComponent.prototype.selectWeek = /** * @param {?} week * @return {?} */ function (week) { var _this = this; if (!this._config.selectWeek) { return; } if (week.days && week.days[0] && !week.days[0].isDisabled && this._config.selectFromOtherMonth) { this.onSelect.emit(week.days[0]); return; } if (week.days.length === 0) { return; } var /** @type {?} */ selectedDay = week.days.find(function (day) { return _this._config.selectFromOtherMonth ? !day.isDisabled : !day.isOtherMonth && !day.isDisabled; }); this.onSelect.emit(selectedDay); }; /** * @param {?} cell * @param {?} isHovered * @return {?} */ BsDaysCalendarViewComponent.prototype.weekHoverHandler = /** * @param {?} cell * @param {?} isHovered * @return {?} */ function (cell, isHovered) { var _this = this; if (!this._config.selectWeek) { return; } var /** @type {?} */ hasActiveDays = cell.days.find(function (day) { return _this._config.selectFromOtherMonth ? !day.isDisabled : !day.isOtherMonth && !day.isDisabled; }); if (hasActiveDays) { cell.isHovered = isHovered; this.isWeekHovered = isHovered; this.onHoverWeek.emit(cell); } }; /** * @param {?} cell * @param {?} isHovered * @return {?} */ BsDaysCalendarViewComponent.prototype.hoverDay = /** * @param {?} cell * @param {?} isHovered * @return {?} */ function (cell, isHovered) { if (this._config.selectFromOtherMonth && cell.isOtherMonth) { cell.isOtherMonthHovered = isHovered; } this.onHover.emit({ cell: cell, isHovered: isHovered }); }; BsDaysCalendarViewComponent.decorators = [ { type: Component, args: [{ selector: 'bs-days-calendar-view', // changeDetection: ChangeDetectionStrategy.OnPush, template: "\n <bs-calendar-layout>\n <bs-datepicker-navigation-view\n [calendar]=\"calendar\"\n (onNavigate)=\"navigateTo($event)\"\n (onViewMode)=\"changeViewMode($event)\"\n ></bs-datepicker-navigation-view>\n\n <!--days matrix-->\n <table role=\"grid\" class=\"days weeks\">\n <thead>\n <tr>\n <!--if show weeks-->\n <th *ngIf=\"options.showWeekNumbers\"></th>\n <th *ngFor=\"let weekday of calendar.weekdays; let i = index\"\n aria-label=\"weekday\">{{ calendar.weekdays[i] }}\n </th>\n </tr>\n </thead>\n <tbody>\n <tr *ngFor=\"let week of calendar.weeks; let i = index\">\n <td class=\"week\" [class.active-week]=\"isWeekHovered\" *ngIf=\"options.showWeekNumbers\">\n <span\n (click)=\"selectWeek(week)\"\n (mouseenter)=\"weekHoverHandler(week, true)\"\n (mouseleave)=\"weekHoverHandler(week, false)\">{{ calendar.weekNumbers[i] }}</span>\n </td>\n <td *ngFor=\"let day of week.days\" role=\"gridcell\">\n <span bsDatepickerDayDecorator\n [day]=\"day\"\n (click)=\"selectDay(day)\"\n (mouseenter)=\"hoverDay(day, true)\"\n (mouseleave)=\"hoverDay(day, false)\">{{ day.label }}</span>\n </td>\n </tr>\n </tbody>\n </table>\n\n </bs-calendar-layout>\n " }] } ]; /** @nocollapse */ BsDaysCalendarViewComponent.ctorParameters = function () { return [ { type: BsDatepickerConfig, }, ]; }; BsDaysCalendarViewComponent.propDecorators = { "calendar": [{ type: Input },], "options": [{ type: Input },], "onNavigate": [{ type: Output },], "onViewMode": [{ type: Output },], "onSelect": [{ type: Output },], "onHover": [{ type: Output },], "onHoverWeek": [{ type: Output },], }; return BsDaysCalendarViewComponent; }()); export { BsDaysCalendarViewComponent }; function BsDaysCalendarViewComponent_tsickle_Closure_declarations() { /** @type {!Array<{type: !Function, args: (undefined|!Array<?>)}>} */ BsDaysCalendarViewComponent.decorators; /** * @nocollapse * @type {function(): !Array<(null|{type: ?, decorators: (undefined|!Array<{type: !Function, args: (undefined|!Array<?>)}>)})>} */ BsDaysCalendarViewComponent.ctorParameters; /** @type {!Object<string,!Array<{type: !Function, args: (undefined|!Array<?>)}>>} */ BsDaysCalendarViewComponent.propDecorators; /** @type {?} */ BsDaysCalendarViewComponent.prototype.calendar; /** @type {?} */ BsDaysCalendarViewComponent.prototype.options; /** @type {?} */ BsDaysCalendarViewComponent.prototype.onNavigate; /** @type {?} */ BsDaysCalendarViewComponent.prototype.onViewMode; /** @type {?} */ BsDaysCalendarViewComponent.prototype.onSelect; /** @type {?} */ BsDaysCalendarViewComponent.prototype.onHover; /** @type {?} */ BsDaysCalendarViewComponent.prototype.onHoverWeek; /** @type {?} */ BsDaysCalendarViewComponent.prototype.isWeekHovered; /** @type {?} */ BsDaysCalendarViewComponent.prototype._config; } //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYnMtZGF5cy1jYWxlbmRhci12aWV3LmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiJuZzovL25neC1ib290c3RyYXAvZGF0ZXBpY2tlci8iLCJzb3VyY2VzIjpbInRoZW1lcy9icy9icy1kYXlzLWNhbGVuZGFyLXZpZXcuY29tcG9uZW50LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7QUFBQSxPQUFPLEVBQ0wsU0FBUyxFQUNULFlBQVksRUFDWixLQUFLLEVBQ0wsTUFBTSxFQUNQLE1BQU0sZUFBZSxDQUFDO0FBQ3ZCLE9BQU8sRUFFTCxxQkFBcUIsRUFNdEIsTUFBTSxjQUFjLENBQUM7QUFDdEIsT0FBTyxFQUFFLGtCQUFrQixFQUFFLE1BQU0sNEJBQTRCLENBQUM7O0lBMkQ5RCxxQ0FBb0IsT0FBMkI7UUFBM0IsWUFBTyxHQUFQLE9BQU8sQ0FBb0I7MEJBVHhCLElBQUksWUFBWSxFQUFxQjswQkFDckMsSUFBSSxZQUFZLEVBQXdCO3dCQUUxQyxJQUFJLFlBQVksRUFBZ0I7dUJBQ2pDLElBQUksWUFBWSxFQUFrQjsyQkFDOUIsSUFBSSxZQUFZLEVBQWlCO0tBSUw7Ozs7O0lBRXBELGdEQUFVOzs7O0lBQVYsVUFBVyxLQUE0QjtRQUNyQyxxQkFBTSxJQUFJLEdBQUcscUJBQXFCLENBQUMsSUFBSSxLQUFLLEtBQUssQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztRQUMzRCxJQUFJLENBQUMsVUFBVSxDQUFDLElBQUksQ0FBQyxFQUFFLElBQUksRUFBRSxFQUFFLEtBQUssRUFBRSxJQUFJLEVBQUUsRUFBRSxDQUFDLENBQUM7S0FDakQ7Ozs7O0lBRUQsb0RBQWM7Ozs7SUFBZCxVQUFlLEtBQTJCO1FBQ3hDLElBQUksQ0FBQyxVQUFVLENBQUMsSUFBSSxDQUFDLEtBQUssQ0FBQyxDQUFDO0tBQzdCOzs7OztJQUVELCtDQUFTOzs7O0lBQVQsVUFBVSxLQUFtQjtRQUMzQixJQUFJLENBQUMsUUFBUSxDQUFDLElBQUksQ0FBQyxLQUFLLENBQUMsQ0FBQztLQUMzQjs7Ozs7SUFFRCxnREFBVTs7OztJQUFWLFVBQVcsSUFBbUI7UUFBOUIsaUJBMEJDO1FBekJDLEVBQUUsQ0FBQyxDQUFDLENBQUMsSUFBSSxDQUFDLE9BQU8sQ0FBQyxVQUFVLENBQUMsQ0FBQyxDQUFDO1lBQzdCLE1BQU0sQ0FBQztTQUNSO1FBRUQsRUFBRSxDQUFDLENBQUMsSUFBSSxDQUFDLElBQUk7ZUFDUixJQUFJLENBQUMsSUFBSSxDQUFDLENBQUMsQ0FBQztlQUNaLENBQUMsSUFBSSxDQUFDLElBQUksQ0FBQyxDQUFDLENBQUMsQ0FBQyxVQUFVO2VBQ3hCLElBQUksQ0FBQyxPQUFPLENBQUMsb0JBQW9CLENBQUMsQ0FBQyxDQUFDO1lBRXZDLElBQUksQ0FBQyxRQUFRLENBQUMsSUFBSSxDQUFDLElBQUksQ0FBQyxJQUFJLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztZQUVqQyxNQUFNLENBQUM7U0FDUjtRQUVELEVBQUUsQ0FBQyxDQUFDLElBQUksQ0FBQyxJQUFJLENBQUMsTUFBTSxLQUFLLENBQUMsQ0FBQyxDQUFDLENBQUM7WUFDM0IsTUFBTSxDQUFDO1NBQ1I7UUFFRCxxQkFBTSxXQUFXLEdBQUcsSUFBSSxDQUFDLElBQUksQ0FBQyxJQUFJLENBQUMsVUFBQyxHQUFpQjtZQUNuRCxNQUFNLENBQUMsS0FBSSxDQUFDLE9BQU8sQ0FBQyxvQkFBb0I7Z0JBQ3RDLENBQUMsQ0FBQyxDQUFDLEdBQUcsQ0FBQyxVQUFVO2dCQUNqQixDQUFDLENBQUMsQ0FBQyxHQUFHLENBQUMsWUFBWSxJQUFJLENBQUMsR0FBRyxDQUFDLFVBQVUsQ0FBQztTQUMxQyxDQUFDLENBQUM7UUFFSCxJQUFJLENBQUMsUUFBUSxDQUFDLElBQUksQ0FBQyxXQUFXLENBQUMsQ0FBQztLQUNqQzs7Ozs7O0lBRUQsc0RBQWdCOzs7OztJQUFoQixVQUFpQixJQUFtQixFQUFFLFNBQWtCO1FBQXhELGlCQWdCQztRQWZDLEVBQUUsQ0FBQyxDQUFDLENBQUMsSUFBSSxDQUFDLE9BQU8sQ0FBQyxVQUFVLENBQUMsQ0FBQyxDQUFDO1lBQzdCLE1BQU0sQ0FBQztTQUNSO1FBRUQscUJBQU0sYUFBYSxHQUFHLElBQUksQ0FBQyxJQUFJLENBQUMsSUFBSSxDQUFDLFVBQUMsR0FBaUI7WUFDckQsTUFBTSxDQUFDLEtBQUksQ0FBQyxPQUFPLENBQUMsb0JBQW9CO2dCQUN0QyxDQUFDLENBQUMsQ0FBQyxHQUFHLENBQUMsVUFBVTtnQkFDakIsQ0FBQyxDQUFDLENBQUMsR0FBRyxDQUFDLFlBQVksSUFBSSxDQUFDLEdBQUcsQ0FBQyxVQUFVLENBQUM7U0FDMUMsQ0FBQyxDQUFDO1FBRUgsRUFBRSxDQUFDLENBQUMsYUFBYSxDQUFDLENBQUMsQ0FBQztZQUNsQixJQUFJLENBQUMsU0FBUyxHQUFHLFNBQVMsQ0FBQztZQUMzQixJQUFJLENBQUMsYUFBYSxHQUFHLFNBQVMsQ0FBQztZQUMvQixJQUFJLENBQUMsV0FBVyxDQUFDLElBQUksQ0FBQyxJQUFJLENBQUMsQ0FBQztTQUM3QjtLQUNGOzs7Ozs7SUFFRCw4Q0FBUTs7Ozs7SUFBUixVQUFTLElBQWtCLEVBQUUsU0FBa0I7UUFDN0MsRUFBRSxDQUFDLENBQUMsSUFBSSxDQUFDLE9BQU8sQ0FBQyxvQkFBb0IsSUFBSSxJQUFJLENBQUMsWUFBWSxDQUFDLENBQUMsQ0FBQztZQUMzRCxJQUFJLENBQUMsbUJBQW1CLEdBQUcsU0FBUyxDQUFDO1NBQ3RDO1FBRUQsSUFBSSxDQUFDLE9BQU8sQ0FBQyxJQUFJLENBQUMsRUFBRSxJQUFJLE1BQUEsRUFBRSxTQUFTLFdBQUEsRUFBRSxDQUFDLENBQUM7S0FDeEM7O2dCQTVIRixTQUFTLFNBQUM7b0JBQ1QsUUFBUSxFQUFFLHVCQUF1Qjs7b0JBRWpDLFFBQVEsRUFBRSwyN0NBdUNUO2lCQUNGOzs7O2dCQTdDUSxrQkFBa0I7Ozs2QkErQ3hCLEtBQUs7NEJBQ0wsS0FBSzsrQkFFTCxNQUFNOytCQUNOLE1BQU07NkJBRU4sTUFBTTs0QkFDTixNQUFNO2dDQUNOLE1BQU07O3NDQXRFVDs7U0E2RGEsMkJBQTJCIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHtcclxuICBDb21wb25lbnQsXHJcbiAgRXZlbnRFbWl0dGVyLFxyXG4gIElucHV0LFxyXG4gIE91dHB1dFxyXG59IGZyb20gJ0Bhbmd1bGFyL2NvcmUnO1xyXG5pbXBvcnQge1xyXG4gIEJzRGF0ZXBpY2tlclZpZXdNb2RlLFxyXG4gIEJzTmF2aWdhdGlvbkRpcmVjdGlvbixcclxuICBCc05hdmlnYXRpb25FdmVudCxcclxuICBDZWxsSG92ZXJFdmVudCxcclxuICBEYXRlcGlja2VyUmVuZGVyT3B0aW9ucyxcclxuICBEYXlzQ2FsZW5kYXJWaWV3TW9kZWwsXHJcbiAgRGF5Vmlld01vZGVsLCBXZWVrVmlld01vZGVsXHJcbn0gZnJvbSAnLi4vLi4vbW9kZWxzJztcclxuaW1wb3J0IHsgQnNEYXRlcGlja2VyQ29uZmlnIH0gZnJvbSAnLi4vLi4vYnMtZGF0ZXBpY2tlci5jb25maWcnO1xyXG5cclxuQENvbXBvbmVudCh7XHJcbiAgc2VsZWN0b3I6ICdicy1kYXlzLWNhbGVuZGFyLXZpZXcnLFxyXG4gIC8vIGNoYW5nZURldGVjdGlvbjogQ2hhbmdlRGV0ZWN0aW9uU3RyYXRlZ3kuT25QdXNoLFxyXG4gIHRlbXBsYXRlOiBgXHJcbiAgICA8YnMtY2FsZW5kYXItbGF5b3V0PlxyXG4gICAgICA8YnMtZGF0ZXBpY2tlci1uYXZpZ2F0aW9uLXZpZXdcclxuICAgICAgICBbY2FsZW5kYXJdPVwiY2FsZW5kYXJcIlxyXG4gICAgICAgIChvbk5hdmlnYXRlKT1cIm5hdmlnYXRlVG8oJGV2ZW50KVwiXHJcbiAgICAgICAgKG9uVmlld01vZGUpPVwiY2hhbmdlVmlld01vZGUoJGV2ZW50KVwiXHJcbiAgICAgID48L2JzLWRhdGVwaWNrZXItbmF2aWdhdGlvbi12aWV3PlxyXG5cclxuICAgICAgPCEtLWRheXMgbWF0cml4LS0+XHJcbiAgICAgIDx0YWJsZSByb2xlPVwiZ3JpZFwiIGNsYXNzPVwiZGF5cyB3ZWVrc1wiPlxyXG4gICAgICAgIDx0aGVhZD5cclxuICAgICAgICA8dHI+XHJcbiAgICAgICAgICA8IS0taWYgc2hvdyB3ZWVrcy0tPlxyXG4gICAgICAgICAgPHRoICpuZ0lmPVwib3B0aW9ucy5zaG93V2Vla051bWJlcnNcIj48L3RoPlxyXG4gICAgICAgICAgPHRoICpuZ0Zvcj1cImxldCB3ZWVrZGF5IG9mIGNhbGVuZGFyLndlZWtkYXlzOyBsZXQgaSA9IGluZGV4XCJcclxuICAgICAgICAgICAgICBhcmlhLWxhYmVsPVwid2Vla2RheVwiPnt7IGNhbGVuZGFyLndlZWtkYXlzW2ldIH19XHJcbiAgICAgICAgICA8L3RoPlxyXG4gICAgICAgIDwvdHI+XHJcbiAgICAgICAgPC90aGVhZD5cclxuICAgICAgICA8dGJvZHk+XHJcbiAgICAgICAgPHRyICpuZ0Zvcj1cImxldCB3ZWVrIG9mIGNhbGVuZGFyLndlZWtzOyBsZXQgaSA9IGluZGV4XCI+XHJcbiAgICAgICAgICA8dGQgY2xhc3M9XCJ3ZWVrXCIgW2NsYXNzLmFjdGl2ZS13ZWVrXT1cImlzV2Vla0hvdmVyZWRcIiAgKm5nSWY9XCJvcHRpb25zLnNob3dXZWVrTnVtYmVyc1wiPlxyXG4gICAgICAgICAgICA8c3BhblxyXG4gICAgICAgICAgICAgICAgKGNsaWNrKT1cInNlbGVjdFdlZWsod2VlaylcIlxyXG4gICAgICAgICAgICAgICAgKG1vdXNlZW50ZXIpPVwid2Vla0hvdmVySGFuZGxlcih3ZWVrLCB0cnVlKVwiXHJcbiAgICAgICAgICAgICAgICAobW91c2VsZWF2ZSk9XCJ3ZWVrSG92ZXJIYW5kbGVyKHdlZWssIGZhbHNlKVwiPnt7IGNhbGVuZGFyLndlZWtOdW1iZXJzW2ldIH19PC9zcGFuPlxyXG4gICAgICAgICAgPC90ZD5cclxuICAgICAgICAgIDx0ZCAqbmdGb3I9XCJsZXQgZGF5IG9mIHdlZWsuZGF5c1wiIHJvbGU9XCJncmlkY2VsbFwiPlxyXG4gICAgICAgICAgPHNwYW4gYnNEYXRlcGlja2VyRGF5RGVjb3JhdG9yXHJcbiAgICAgICAgICAgICAgICBbZGF5XT1cImRheVwiXHJcbiAgICAgICAgICAgICAgICAoY2xpY2spPVwic2VsZWN0RGF5KGRheSlcIlxyXG4gICAgICAgICAgICAgICAgKG1vdXNlZW50ZXIpPVwiaG92ZXJEYXkoZGF5LCB0cnVlKVwiXHJcbiAgICAgICAgICAgICAgICAobW91c2VsZWF2ZSk9XCJob3ZlckRheShkYXksIGZhbHNlKVwiPnt7IGRheS5sYWJlbCB9fTwvc3Bhbj5cclxuICAgICAgICAgIDwvdGQ+XHJcbiAgICAgICAgPC90cj5cclxuICAgICAgICA8L3Rib2R5PlxyXG4gICAgICA8L3RhYmxlPlxyXG5cclxuICAgIDwvYnMtY2FsZW5kYXItbGF5b3V0PlxyXG4gIGBcclxufSlcclxuZXhwb3J0IGNsYXNzIEJzRGF5c0NhbGVuZGFyVmlld0NvbXBvbmVudCAge1xyXG4gIEBJbnB1dCgpIGNhbGVuZGFyOiBEYXlzQ2FsZW5kYXJWaWV3TW9kZWw7XHJcbiAgQElucHV0KCkgb3B0aW9uczogRGF0ZXBpY2tlclJlbmRlck9wdGlvbnM7XHJcblxyXG4gIEBPdXRwdXQoKSBvbk5hdmlnYXRlID0gbmV3IEV2ZW50RW1pdHRlcjxCc05hdmlnYXRpb25FdmVudD4oKTtcclxuICBAT3V0cHV0KCkgb25WaWV3TW9kZSA9IG5ldyBFdmVudEVtaXR0ZXI8QnNEYXRlcGlja2VyVmlld01vZGU+KCk7XHJcblxyXG4gIEBPdXRwdXQoKSBvblNlbGVjdCA9IG5ldyBFdmVudEVtaXR0ZXI8RGF5Vmlld01vZGVsPigpO1xyXG4gIEBPdXRwdXQoKSBvbkhvdmVyID0gbmV3IEV2ZW50RW1pdHRlcjxDZWxsSG92ZXJFdmVudD4oKTtcclxuICBAT3V0cHV0KCkgb25Ib3ZlcldlZWsgPSBuZXcgRXZlbnRFbWl0dGVyPFdlZWtWaWV3TW9kZWw+KCk7XHJcblxyXG4gIGlzV2Vla0hvdmVyZWQ6IGJvb2xlYW47XHJcblxyXG4gIGNvbnN0cnVjdG9yKHByaXZhdGUgX2NvbmZpZzogQnNEYXRlcGlja2VyQ29uZmlnKSB7IH1cclxuXHJcbiAgbmF2aWdhdGVUbyhldmVudDogQnNOYXZpZ2F0aW9uRGlyZWN0aW9uKTogdm9pZCB7XHJcbiAgICBjb25zdCBzdGVwID0gQnNOYXZpZ2F0aW9uRGlyZWN0aW9uLkRPV04gPT09IGV2ZW50ID8gLTEgOiAxO1xyXG4gICAgdGhpcy5vbk5hdmlnYXRlLmVtaXQoeyBzdGVwOiB7IG1vbnRoOiBzdGVwIH0gfSk7XHJcbiAgfVxyXG5cclxuICBjaGFuZ2VWaWV3TW9kZShldmVudDogQnNEYXRlcGlja2VyVmlld01vZGUpOiB2b2lkIHtcclxuICAgIHRoaXMub25WaWV3TW9kZS5lbWl0KGV2ZW50KTtcclxuICB9XHJcblxyXG4gIHNlbGVjdERheShldmVudDogRGF5Vmlld01vZGVsKTogdm9pZCB7XHJcbiAgICB0aGlzLm9uU2VsZWN0LmVtaXQoZXZlbnQpO1xyXG4gIH1cclxuXHJcbiAgc2VsZWN0V2Vlayh3ZWVrOiBXZWVrVmlld01vZGVsKTogdm9pZCB7XHJcbiAgICBpZiAoIXRoaXMuX2NvbmZpZy5zZWxlY3RXZWVrKSB7XHJcbiAgICAgIHJldHVybjtcclxuICAgIH1cclxuXHJcbiAgICBpZiAod2Vlay5kYXlzXHJcbiAgICAgICYmIHdlZWsuZGF5c1swXVxyXG4gICAgICAmJiAhd2Vlay5kYXlzWzBdLmlzRGlzYWJsZWRcclxuICAgICAgJiYgdGhpcy5fY29uZmlnLnNlbGVjdEZyb21PdGhlck1vbnRoKSB7XHJcblxyXG4gICAgICB0aGlzLm9uU2VsZWN0LmVtaXQod2Vlay5kYXlzWzBdKTtcclxuXHJcbiAgICAgIHJldHVybjtcclxuICAgIH1cclxuXHJcbiAgICBpZiAod2Vlay5kYXlzLmxlbmd0aCA9PT0gMCkge1xyXG4gICAgICByZXR1cm47XHJcbiAgICB9XHJcblxyXG4gICAgY29uc3Qgc2VsZWN0ZWREYXkgPSB3ZWVrLmRheXMuZmluZCgoZGF5OiBEYXlWaWV3TW9kZWwpID0+IHtcclxuICAgICAgcmV0dXJuIHRoaXMuX2NvbmZpZy5zZWxlY3RGcm9tT3RoZXJNb250aFxyXG4gICAgICAgID8gIWRheS5pc0Rpc2FibGVkXHJcbiAgICAgICAgOiAhZGF5LmlzT3RoZXJNb250aCAmJiAhZGF5LmlzRGlzYWJsZWQ7XHJcbiAgICB9KTtcclxuXHJcbiAgICB0aGlzLm9uU2VsZWN0LmVtaXQoc2VsZWN0ZWREYXkpO1xyXG4gIH1cclxuXHJcbiAgd2Vla0hvdmVySGFuZGxlcihjZWxsOiBXZWVrVmlld01vZGVsLCBpc0hvdmVyZWQ6IGJvb2xlYW4pOiB2b2lkIHtcclxuICAgIGlmICghdGhpcy5fY29uZmlnLnNlbGVjdFdlZWspIHtcclxuICAgICAgcmV0dXJuO1xyXG4gICAgfVxyXG5cclxuICAgIGNvbnN0IGhhc0FjdGl2ZURheXMgPSBjZWxsLmRheXMuZmluZCgoZGF5OiBEYXlWaWV3TW9kZWwpID0+IHtcclxuICAgICAgcmV0dXJuIHRoaXMuX2NvbmZpZy5zZWxlY3RGcm9tT3RoZXJNb250aFxyXG4gICAgICAgID8gIWRheS5pc0Rpc2FibGVkXHJcbiAgICAgICAgOiAhZGF5LmlzT3RoZXJNb250aCAmJiAhZGF5LmlzRGlzYWJsZWQ7XHJcbiAgICB9KTtcclxuXHJcbiAgICBpZiAoaGFzQWN0aXZlRGF5cykge1xyXG4gICAgICBjZWxsLmlzSG92ZXJlZCA9IGlzSG92ZXJlZDtcclxuICAgICAgdGhpcy5pc1dlZWtIb3ZlcmVkID0gaXNIb3ZlcmVkO1xyXG4gICAgICB0aGlzLm9uSG92ZXJXZWVrLmVtaXQoY2VsbCk7XHJcbiAgICB9XHJcbiAgfVxyXG5cclxuICBob3ZlckRheShjZWxsOiBEYXlWaWV3TW9kZWwsIGlzSG92ZXJlZDogYm9vbGVhbik6IHZvaWQge1xyXG4gICAgaWYgKHRoaXMuX2NvbmZpZy5zZWxlY3RGcm9tT3RoZXJNb250aCAmJiBjZWxsLmlzT3RoZXJNb250aCkge1xyXG4gICAgICBjZWxsLmlzT3RoZXJNb250aEhvdmVyZWQgPSBpc0hvdmVyZWQ7XHJcbiAgICB9XHJcblxyXG4gICAgdGhpcy5vbkhvdmVyLmVtaXQoeyBjZWxsLCBpc0hvdmVyZWQgfSk7XHJcbiAgfVxyXG59XHJcbiJdfQ==
import React, {Component} from 'react'; import { View, Text, StyleSheet, TextInput, Dimensions, TouchableOpacity, Image, ActivityIndicator, Alert, Keyboard, } from 'react-native'; import {API_URL, MAIN_COLOR, TEXT_COLOR} from '../../../constants'; import Icon from 'react-native-vector-icons/Ionicons'; import PopUpComponent from '../../../components/PopUpComponent'; import {ChannelIO} from 'react-native-channel-plugin'; const {width, height} = Dimensions.get('window'); class LogInScreen1 extends Component { state = { username: '', isFocused: false, isSubmitting: false, hide: true, }; componentDidMount = () => { this.guestLogin(); this.setState({ username: '', }); }; render() { const { navigation, route: { params: {catchFromAsk}, }, } = this.props; const {username} = this.state; return ( <View style={styles.container}> <View style={styles.header}> <TouchableOpacity style={styles.menuIcon} onPressOut={() => { navigation.goBack(null); ChannelIO.show(true); }}> <Icon name="ios-arrow-back" size={26} color="black" /> </TouchableOpacity> <Image style={{width: width * 0.26}} source={require('../../../assets/images/logo.jpeg')} resizeMode={'contain'} /> </View> <View style={styles.body}> <Text style={{margin: 20, fontSize: 15}}> 신규 또는 기존 아이디를 입력해 주세요. </Text> <TextInput placeholder="아이디" style={[ styles.textInput, this.state.isFocused ? styles.focused : styles.unFocused, ]} autoCapitalize={'none'} autoCorrect={false} autoFocus={true} value={this.state.username} onChangeText={this._changeUsername} returnKeyType={'next'} onSubmitEditing={() => { this._searchByID(); this._onOutFocus(); }} onEndEditing={this._onOutFocus} onFocus={this._onFocus} blurOnSubmit={true} /> </View> <View style={styles.btnContainer}> <TouchableOpacity style={styles.button} onPressOut={this._searchByID}> {this.state.isSubmitting ? ( <ActivityIndicator size="small" color="white" /> ) : ( <Text style={styles.btnText}>확인</Text> )} </TouchableOpacity> </View> <PopUpComponent title={'등록되어 있지 않습니다.'} body={'회원 가입 하시겠습니까?'} hide={this.state.hide} onConfirm={() => { this.setState({hide: true}); { navigation.navigate('LogIn2', { catchFromAsk, username, guest_token: this.state.guest_token, }); } }} onCancel={() => this.setState({hide: true})} /> </View> ); } _onFocus = () => { this.setState({ isFocused: true, }); }; _onOutFocus = () => { this.setState({ isFocused: false, }); }; _changeUsername = text => { this.setState({ username: text, }); }; _searchByID = async () => { const {username, isSubmitting} = this.state; const { navigation, route: { params: {catchFromAsk}, }, } = this.props; if (!isSubmitting) { this.setState({ isSubmitting: true, }); if (username.length > 4) { const fetchResult = await fetch( `${API_URL}/users/check/?usernameforcheck=${username}`, { headers: { Authorization: `JWT ${this.state.guest_token}`, }, }, ) .then(response => response.json()) .then(json => { if (json.length == 0) { this.setState({ isSubmitting: false, }); return true; } else { this.setState({ isSubmitting: false, }); return false; } }); if (fetchResult) { this.setState({ hide: false, }); Keyboard.dismiss(); } else { navigation.navigate('LogIn3', { username: this.state.username, catchFromAsk, guest_token: this.state.guest_token, }); } } else { this.setState({ isSubmitting: false, }); Alert.alert('아이디가 너무 짧습니다!'); } } }; guestLogin = () => { fetch(`${API_URL}/rest-auth/login/`, { method: 'POST', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({ username: 'guest', password: 'qudwns12', }), }) .then(response => response.json()) .then(json => { if (json.token) { this.setState({ guest_token: json.token, }); } }); }; } const styles = StyleSheet.create({ container: { backgroundColor: 'white', flex: 1, paddingTop: 5, }, header: { backgroundColor: 'white', width, height: width * 0.16, justifyContent: 'space-between', flexDirection: 'row', alignItems: 'center', paddingRight: 18, marginTop: 10, }, menuIcon: { padding: 17, }, body: { alignItems: 'center', paddingTop: 20, }, textInput: { fontSize: 16, width: width * 0.85, borderBottomWidth: 1, padding: 14, color: MAIN_COLOR, marginTop: 15, }, focused: { borderBottomColor: MAIN_COLOR, }, unFocused: { borderBottomColor: 'lightgrey', }, btnContainer: { alignItems: 'center', }, button: { backgroundColor: MAIN_COLOR, width: width * 0.8, height: width * 0.12, alignItems: 'center', justifyContent: 'center', borderRadius: 3, marginTop: 57, }, btnText: { color: 'white', fontSize: 15, }, }); export default LogInScreen1;
import { getCube } from './helper.js'; export const createWallWoodStrips = () => { getCube("url(rtextures/wood.jpg)", 5, 10, 465, -600, 390, -448); getCube("url(rtextures/wood.jpg)", 5, 10, 465, -590, 390, -448); getCube("url(rtextures/wood.jpg)", 5, 10, 465, -580, 390, -448); getCube("url(rtextures/wood.jpg)", 5, 10, 465, -570, 390, -448); getCube("url(rtextures/wood.jpg)", 5, 10, 465, -560, 390, -448); getCube("url(rtextures/wood.jpg)", 5, 10, 465, -550, 390, -448); getCube("url(rtextures/wood.jpg)", 5, 10, 465, -540, 390, -448); getCube("url(rtextures/wood.jpg)", 5, 10, 465, -530, 390, -448); getCube("url(rtextures/wood.jpg)", 5, 10, 465, -520, 390, -448); getCube("url(rtextures/wood.jpg)", 5, 10, 465, -510, 390, -448); getCube("url(rtextures/wood.jpg)", 10, 10, 465, -500, 390, -448); getCube("url(rtextures/moss.jpg)", 20, 10, 465, -490, 390, -448, 0, 0, 0, true); getCube("url(rtextures/wood.jpg)", 20, 10, 465, -470, 390, -448); }; export const createCeilingWoodStrips = () => { getCube("url(rtextures/wood.jpg)", 5, 800, 10, -600, -400, -440); getCube("url(rtextures/wood.jpg)", 5, 800, 10, -590, -400, -440); getCube("url(rtextures/wood.jpg)", 5, 800, 10, -580, -400, -440); getCube("url(rtextures/wood.jpg)", 5, 800, 10, -570, -400, -440); getCube("url(rtextures/wood.jpg)", 5, 800, 10, -560, -400, -440); getCube("url(rtextures/wood.jpg)", 5, 800, 10, -550, -400, -440); getCube("url(rtextures/wood.jpg)", 5, 800, 10, -540, -400, -440); getCube("url(rtextures/wood.jpg)", 5, 800, 10, -530, -400, -440); getCube("url(rtextures/wood.jpg)", 5, 800, 10, -520, -400, -440); getCube("url(rtextures/wood.jpg)", 5, 800, 10, -510, -400, -440); getCube("url(rtextures/wood.jpg)", 10, 800, 10, -500, -400, -440); getCube("url(rtextures/moss.jpg)", 20, 800, 10, -490, -400, -440); getCube("url(rtextures/wood.jpg)", 20, 800, 10, -470, -400, -440); };
console.log(process.env) console.log(process.exit(1))
/*! Copyright (c) 2010 Brandon Aaron (http://brandonaaron.net) * Licensed under the MIT License (LICENSE.txt). * * Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers. * Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix. * Thanks to: Seamus Leahy for adding deltaX and deltaY * * Version: 3.0.4 * * Requires: 1.2.2+ */ (function($) { var types = ['DOMMouseScroll', 'mousewheel']; $.event.special.mousewheel = { setup: function() { if ( this.addEventListener ) { for ( var i=types.length; i; ) { this.addEventListener( types[--i], handler, false ); } } else { this.onmousewheel = handler; } }, teardown: function() { if ( this.removeEventListener ) { for ( var i=types.length; i; ) { this.removeEventListener( types[--i], handler, false ); } } else { this.onmousewheel = null; } } }; $.fn.extend({ mousewheel: function(fn) { return fn ? this.bind("mousewheel", fn) : this.trigger("mousewheel"); }, unmousewheel: function(fn) { return this.unbind("mousewheel", fn); } }); function handler(event) { var orgEvent = event || window.event, args = [].slice.call( arguments, 1 ), delta = 0, returnValue = true, deltaX = 0, deltaY = 0; event = $.event.fix(orgEvent); event.type = "mousewheel"; // Old school scrollwheel delta if ( event.wheelDelta ) { delta = event.wheelDelta/120; } if ( event.detail ) { delta = -event.detail/3; } // New school multidimensional scroll (touchpads) deltas deltaY = delta; // Gecko if ( orgEvent.axis !== undefined && orgEvent.axis === orgEvent.HORIZONTAL_AXIS ) { deltaY = 0; deltaX = -1*delta; } // Webkit if ( orgEvent.wheelDeltaY !== undefined ) { deltaY = orgEvent.wheelDeltaY/120; } if ( orgEvent.wheelDeltaX !== undefined ) { deltaX = -1*orgEvent.wheelDeltaX/120; } // Add event and delta to the front of the arguments args.unshift(event, delta, deltaX, deltaY); return $.event.handle.apply(this, args); } })(jQuery); /* contentcarousel */ (function($) { var aux = { // navigates left / right navigate : function( dir, $el, $wrapper, opts, cache ) { var scroll = opts.scroll, factor = 1, idxClicked = 0; if( cache.expanded ) { scroll = 1; // scroll is always 1 in full mode factor = 3; // the width of the expanded item will be 3 times bigger than 1 collapsed item idxClicked = cache.idxClicked; // the index of the clicked item } // clone the elements on the right / left and append / prepend them according to dir and scroll if( dir === 1 ) { $wrapper.find('div.ca-item:lt(' + scroll + ')').each(function(i) { $(this).clone(true).css( 'left', ( cache.totalItems - idxClicked + i ) * cache.itemW * factor + 'px' ).appendTo( $wrapper ); }); } else { var $first = $wrapper.children().eq(0); $wrapper.find('div.ca-item:gt(' + ( cache.totalItems - 1 - scroll ) + ')').each(function(i) { // insert before $first so they stay in the right order $(this).clone(true).css( 'left', - ( scroll - i + idxClicked ) * cache.itemW * factor + 'px' ).insertBefore( $first ); }); } // animate the left of each item // the calculations are dependent on dir and on the cache.expanded value $wrapper.find('div.ca-item').each(function(i) { var $item = $(this); $item.stop().animate({ left : ( dir === 1 ) ? '-=' + ( cache.itemW * factor * scroll ) + 'px' : '+=' + ( cache.itemW * factor * scroll ) + 'px' }, opts.sliderSpeed, opts.sliderEasing, function() { if( ( dir === 1 && $item.position().left < - idxClicked * cache.itemW * factor ) || ( dir === -1 && $item.position().left > ( ( cache.totalItems - 1 - idxClicked ) * cache.itemW * factor ) ) ) { // remove the item that was cloned $item.remove(); } cache.isAnimating = false; }); }); }, // gets the item's position (1, 2, or 3) on the viewport (the visible items) // val is the left of the item getWinPos : function( val, cache ) { switch( val ) { case 0 : return 1; break; case cache.itemW : return 2; break; case cache.itemW * 2 : return 3; break; } } }, methods = { init : function( options ) { if( this.length ) { var settings = { sliderSpeed : 500, // speed for the sliding animation sliderEasing : 'easeOutExpo',// easing for the sliding animation itemSpeed : 100, // speed for the item animation (open / close) itemEasing : 'easeOutExpo',// easing for the item animation (open / close) scroll : 1 // number of items to scroll at a time }; return this.each(function() { // if options exist, lets merge them with our default settings if ( options ) { $.extend( settings, options ); } var $el = $(this), $wrapper = $el.find('div.ca-wrapper'), $items = $wrapper.children('div.ca-item'), cache = {}; // save the with of one item cache.itemW = $items.width(); // save the number of total items cache.totalItems = $items.length; // add navigation buttons if( cache.totalItems > 3 ) $el.prepend('<div class="ca-nav"><span class="ca-nav-prev"><</span><span class="ca-nav-next">></span></div>') // control the scroll value if( settings.scroll < 1 ) settings.scroll = 1; else if( settings.scroll > 3 ) settings.scroll = 3; var $navPrev = $el.find('span.ca-nav-prev'), $navNext = $el.find('span.ca-nav-next'); // hide the items except the first 3 $wrapper.css( 'overflow', 'hidden' ); // the items will have position absolute // calculate the left of each item $items.each(function(i) { $(this).css({ position : 'absolute', left : i * cache.itemW + 'px' }); }); $(window).resize(function(){ cache.itemW = $items.width(); $items.each(function(i) { $(this).css({ position : 'absolute', left : i * cache.itemW + 'px' }); }); }); // navigate left $navPrev.bind('click.contentcarousel', function( event ) { if( cache.isAnimating ) return false; cache.isAnimating = true; aux.navigate( -1, $el, $wrapper, settings, cache ); }); // navigate right $navNext.bind('click.contentcarousel', function( event ) { if( cache.isAnimating ) return false; cache.isAnimating = true; aux.navigate( 1, $el, $wrapper, settings, cache ); }); // adds events to the mouse $el.bind('mousewheel.contentcarousel', function(e, delta) { if(delta > 0) { if( cache.isAnimating ) return false; cache.isAnimating = true; aux.navigate( -1, $el, $wrapper, settings, cache ); } else { if( cache.isAnimating ) return false; cache.isAnimating = true; aux.navigate( 1, $el, $wrapper, settings, cache ); } return false; }); }); } } }; $.fn.contentcarousel = function(method) { if ( methods[method] ) { return methods[method].apply( this, Array.prototype.slice.call( arguments, 1 )); } else if ( typeof method === 'object' || ! method ) { return methods.init.apply( this, arguments ); } else { $.error( 'Method ' + method + ' does not exist on jQuery.contentcarousel' ); } }; })(jQuery);
'use strict'; var fizzbuzz = require('./lib/fizzbuzz'); fizzbuzz.print(15);