;
684 | if (emitter) {
685 | emitter.emit(params ? [visTimeline].concat(params) : visTimeline);
686 | }
687 | if (preventDefault && params.event) {
688 | params.event.preventDefault();
689 | }
690 | });
691 |
692 | return true;
693 | }
694 |
695 | return false;
696 | }
697 |
698 | /**
699 | * Deactivates an event.
700 | *
701 | * @param {string} visTimeline The timeline name/identifier.
702 | * @param {VisTimelineEvents} eventName The event name.
703 | *
704 | * @memberOf VisTimelineService
705 | */
706 | public off(visTimeline: string, eventName: VisTimelineEvents): void {
707 | if (this.timelines[visTimeline]) {
708 | this.timelines[visTimeline].off(eventName, undefined);
709 | }
710 | }
711 |
712 | private doesNotExistError(visTimeline: string): string {
713 | return `Timeline with id ${visTimeline} does not exist.`;
714 | }
715 |
716 | private alreadyExistsError(visTimeline: string): string {
717 | return `Timeline with id ${visTimeline} already exists.`;
718 | }
719 | }
720 |
--------------------------------------------------------------------------------
/demo/assets/css/example.css:
--------------------------------------------------------------------------------
1 | body {
2 | padding-top: 20px;
3 | padding-bottom: 20px;
4 | font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
5 | }
6 |
7 | /* Everything but the jumbotron gets side spacing for mobile first views */
8 | .header,
9 | .marketing,
10 | .footer {
11 | padding-right: 15px;
12 | padding-left: 15px;
13 | }
14 |
15 | /* Custom page header */
16 | .header {
17 | padding-bottom: 20px;
18 | border-bottom: 1px solid #e5e5e5;
19 | }
20 | /* Make the masthead heading the same height as the navigation */
21 | .header h3 {
22 | margin-top: 0;
23 | margin-bottom: 0;
24 | line-height: 40px;
25 | }
26 |
27 | /* Custom page footer */
28 | .footer {
29 | padding-top: 19px;
30 | color: #777;
31 | border-top: 1px solid #e5e5e5;
32 | }
33 |
34 | /* Main marketing message and sign up button */
35 | .jumbotron {
36 | text-align: center;
37 | border-bottom: 1px solid #e5e5e5;
38 | }
39 | .jumbotron .btn {
40 | padding: 14px 24px;
41 | font-size: 21px;
42 | }
43 |
44 | /* Supporting marketing content */
45 | .marketing {
46 | margin: 40px 0;
47 | }
48 | .marketing p + h4 {
49 | margin-top: 28px;
50 | }
51 |
52 | /* Responsive: Portrait tablets and up */
53 | @media screen and (min-width: 768px) {
54 | /* Remove the padding we set earlier */
55 | .header,
56 | .marketing,
57 | .footer {
58 | padding-right: 0;
59 | padding-left: 0;
60 | }
61 | /* Space out the masthead */
62 | .header {
63 | margin-bottom: 30px;
64 | }
65 | /* Remove the bottom border on the jumbotron for visual effect */
66 | .jumbotron {
67 | border-bottom: 0;
68 | }
69 | }
70 |
--------------------------------------------------------------------------------
/demo/assets/css/vis.min.css:
--------------------------------------------------------------------------------
1 | .vis-background,.vis-labelset,.vis-timeline{overflow:hidden}.vis .overlay{position:absolute;top:0;left:0;width:100%;height:100%;z-index:10}.vis-active{box-shadow:0 0 10px #86d5f8}.vis [class*=span]{min-height:0;width:auto}div.vis-configuration{position:relative;display:block;float:left;font-size:12px}div.vis-configuration-wrapper{display:block;width:700px}div.vis-configuration-wrapper::after{clear:both;content:"";display:block}div.vis-configuration.vis-config-option-container{display:block;width:495px;background-color:#fff;border:2px solid #f7f8fa;border-radius:4px;margin-top:20px;left:10px;padding-left:5px}div.vis-configuration.vis-config-button{display:block;width:495px;height:25px;vertical-align:middle;line-height:25px;background-color:#f7f8fa;border:2px solid #ceced0;border-radius:4px;margin-top:20px;left:10px;padding-left:5px;cursor:pointer;margin-bottom:30px}div.vis-configuration.vis-config-button.hover{background-color:#4588e6;border:2px solid #214373;color:#fff}div.vis-configuration.vis-config-item{display:block;float:left;width:495px;height:25px;vertical-align:middle;line-height:25px}div.vis-configuration.vis-config-item.vis-config-s2{left:10px;background-color:#f7f8fa;padding-left:5px;border-radius:3px}div.vis-configuration.vis-config-item.vis-config-s3{left:20px;background-color:#e4e9f0;padding-left:5px;border-radius:3px}div.vis-configuration.vis-config-item.vis-config-s4{left:30px;background-color:#cfd8e6;padding-left:5px;border-radius:3px}div.vis-configuration.vis-config-header{font-size:18px;font-weight:700}div.vis-configuration.vis-config-label{width:120px;height:25px;line-height:25px}div.vis-configuration.vis-config-label.vis-config-s3{width:110px}div.vis-configuration.vis-config-label.vis-config-s4{width:100px}div.vis-configuration.vis-config-colorBlock{top:1px;width:30px;height:19px;border:1px solid #444;border-radius:2px;padding:0;margin:0;cursor:pointer}input.vis-configuration.vis-config-checkbox{left:-5px}input.vis-configuration.vis-config-rangeinput{position:relative;top:-5px;width:60px;padding:1px;margin:0;pointer-events:none}.vis-panel,.vis-timeline{padding:0;box-sizing:border-box}input.vis-configuration.vis-config-range{-webkit-appearance:none;border:0 solid #fff;background-color:rgba(0,0,0,0);width:300px;height:20px}input.vis-configuration.vis-config-range::-webkit-slider-runnable-track{width:300px;height:5px;background:#dedede;background:-moz-linear-gradient(top,#dedede 0,#c8c8c8 99%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,#dedede),color-stop(99%,#c8c8c8));background:-webkit-linear-gradient(top,#dedede 0,#c8c8c8 99%);background:-o-linear-gradient(top,#dedede 0,#c8c8c8 99%);background:-ms-linear-gradient(top,#dedede 0,#c8c8c8 99%);background:linear-gradient(to bottom,#dedede 0,#c8c8c8 99%);filter:progid:DXImageTransform.Microsoft.gradient( startColorstr='#dedede', endColorstr='#c8c8c8', GradientType=0 );border:1px solid #999;box-shadow:#aaa 0 0 3px 0;border-radius:3px}input.vis-configuration.vis-config-range::-webkit-slider-thumb{-webkit-appearance:none;border:1px solid #14334b;height:17px;width:17px;border-radius:50%;background:#3876c2;background:-moz-linear-gradient(top,#3876c2 0,#385380 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,#3876c2),color-stop(100%,#385380));background:-webkit-linear-gradient(top,#3876c2 0,#385380 100%);background:-o-linear-gradient(top,#3876c2 0,#385380 100%);background:-ms-linear-gradient(top,#3876c2 0,#385380 100%);background:linear-gradient(to bottom,#3876c2 0,#385380 100%);filter:progid:DXImageTransform.Microsoft.gradient( startColorstr='#3876c2', endColorstr='#385380', GradientType=0 );box-shadow:#111927 0 0 1px 0;margin-top:-7px}input.vis-configuration.vis-config-range:focus{outline:0}input.vis-configuration.vis-config-range:focus::-webkit-slider-runnable-track{background:#9d9d9d;background:-moz-linear-gradient(top,#9d9d9d 0,#c8c8c8 99%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,#9d9d9d),color-stop(99%,#c8c8c8));background:-webkit-linear-gradient(top,#9d9d9d 0,#c8c8c8 99%);background:-o-linear-gradient(top,#9d9d9d 0,#c8c8c8 99%);background:-ms-linear-gradient(top,#9d9d9d 0,#c8c8c8 99%);background:linear-gradient(to bottom,#9d9d9d 0,#c8c8c8 99%);filter:progid:DXImageTransform.Microsoft.gradient( startColorstr='#9d9d9d', endColorstr='#c8c8c8', GradientType=0 )}input.vis-configuration.vis-config-range::-moz-range-track{width:300px;height:10px;background:#dedede;background:-moz-linear-gradient(top,#dedede 0,#c8c8c8 99%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,#dedede),color-stop(99%,#c8c8c8));background:-webkit-linear-gradient(top,#dedede 0,#c8c8c8 99%);background:-o-linear-gradient(top,#dedede 0,#c8c8c8 99%);background:-ms-linear-gradient(top,#dedede 0,#c8c8c8 99%);background:linear-gradient(to bottom,#dedede 0,#c8c8c8 99%);filter:progid:DXImageTransform.Microsoft.gradient( startColorstr='#dedede', endColorstr='#c8c8c8', GradientType=0 );border:1px solid #999;box-shadow:#aaa 0 0 3px 0;border-radius:3px}input.vis-configuration.vis-config-range::-moz-range-thumb{border:none;height:16px;width:16px;border-radius:50%;background:#385380}input.vis-configuration.vis-config-range:-moz-focusring{outline:#fff solid 1px;outline-offset:-1px}input.vis-configuration.vis-config-range::-ms-track{width:300px;height:5px;background:0 0;border-color:transparent;border-width:6px 0;color:transparent}input.vis-configuration.vis-config-range::-ms-fill-lower{background:#777;border-radius:10px}input.vis-configuration.vis-config-range::-ms-fill-upper{background:#ddd;border-radius:10px}input.vis-configuration.vis-config-range::-ms-thumb{border:none;height:16px;width:16px;border-radius:50%;background:#385380}input.vis-configuration.vis-config-range:focus::-ms-fill-lower{background:#888}input.vis-configuration.vis-config-range:focus::-ms-fill-upper{background:#ccc}.vis-configuration-popup{position:absolute;background:rgba(57,76,89,.85);border:2px solid #f2faff;line-height:30px;height:30px;width:150px;text-align:center;color:#fff;font-size:14px;border-radius:4px;-webkit-transition:opacity .3s ease-in-out;-moz-transition:opacity .3s ease-in-out;transition:opacity .3s ease-in-out}.vis-configuration-popup:after,.vis-configuration-popup:before{left:100%;top:50%;border:solid transparent;content:" ";height:0;width:0;position:absolute;pointer-events:none}.vis-configuration-popup:after{border-color:rgba(136,183,213,0);border-left-color:rgba(57,76,89,.85);border-width:8px;margin-top:-8px}.vis-configuration-popup:before{border-color:rgba(194,225,245,0);border-left-color:#f2faff;border-width:12px;margin-top:-12px}.vis-timeline{position:relative;border:1px solid #bfbfbf;margin:0}.vis-panel{position:absolute;margin:0}.vis-panel.vis-bottom,.vis-panel.vis-center,.vis-panel.vis-left,.vis-panel.vis-right,.vis-panel.vis-top{border:1px #bfbfbf}.vis-panel.vis-center,.vis-panel.vis-left,.vis-panel.vis-right{border-top-style:solid;border-bottom-style:solid;overflow:hidden}.vis-panel.vis-bottom,.vis-panel.vis-center,.vis-panel.vis-top{border-left-style:solid;border-right-style:solid}.vis-panel>.vis-content{position:relative}.vis-panel .vis-shadow{position:absolute;width:100%;height:1px;box-shadow:0 0 10px rgba(0,0,0,.8)}.vis-itemset,.vis-labelset,.vis-labelset .vis-label{position:relative;box-sizing:border-box}.vis-panel .vis-shadow.vis-top{top:-1px;left:0}.vis-panel .vis-shadow.vis-bottom{bottom:-1px;left:0}.vis-labelset .vis-label{left:0;top:0;width:100%;color:#4d4d4d;border-bottom:1px solid #bfbfbf}.vis-labelset .vis-label.draggable{cursor:pointer}.vis-labelset .vis-label:last-child{border-bottom:none}.vis-labelset .vis-label .vis-inner{display:inline-block;padding:5px}.vis-labelset .vis-label .vis-inner.vis-hidden{padding:0}.vis-itemset{padding:0;margin:0}.vis-itemset .vis-background,.vis-itemset .vis-foreground{position:absolute;width:100%;height:100%;overflow:visible}.vis-axis{position:absolute;width:100%;height:0;left:0;z-index:1}.vis-foreground .vis-group{position:relative;box-sizing:border-box;border-bottom:1px solid #bfbfbf}.vis-foreground .vis-group:last-child{border-bottom:none}.vis-overlay{position:absolute;top:0;left:0;width:100%;height:100%;z-index:10}.vis-item{position:absolute;color:#1A1A1A;border-color:#97B0F8;border-width:1px;background-color:#D5DDF6;display:inline-block}.vis-item.vis-point.vis-selected,.vis-item.vis-selected{background-color:#FFF785}.vis-item.vis-selected{border-color:#FFC200;z-index:2}.vis-editable.vis-selected{cursor:move}.vis-item.vis-box{text-align:center;border-style:solid;border-radius:2px}.vis-item.vis-point{background:0 0}.vis-item.vis-dot{position:absolute;padding:0;border-width:4px;border-style:solid;border-radius:4px}.vis-item.vis-range{border-style:solid;border-radius:2px;box-sizing:border-box}.vis-item.vis-background{border:none;background-color:rgba(213,221,246,.4);box-sizing:border-box;padding:0;margin:0}.vis-item .vis-item-overflow{position:relative;width:100%;height:100%;padding:0;margin:0;overflow:hidden}.vis-item .vis-delete,.vis-item .vis-delete-rtl{background:url(img/timeline/delete.png) center no-repeat;height:24px;top:-4px;cursor:pointer}.vis-item.vis-range .vis-item-content{position:relative;display:inline-block}.vis-item.vis-background .vis-item-content{position:absolute;display:inline-block}.vis-item.vis-line{padding:0;position:absolute;width:0;border-left-width:1px;border-left-style:solid}.vis-item .vis-item-content{white-space:nowrap;box-sizing:border-box;padding:5px}.vis-item .vis-delete{position:absolute;width:24px;right:-24px}.vis-item .vis-delete-rtl{position:absolute;width:24px;left:-24px}.vis-item.vis-range .vis-drag-left{position:absolute;width:24px;max-width:20%;min-width:2px;height:100%;top:0;left:-4px;cursor:w-resize}.vis-item.vis-range .vis-drag-right{position:absolute;width:24px;max-width:20%;min-width:2px;height:100%;top:0;right:-4px;cursor:e-resize}.vis-range.vis-item.vis-readonly .vis-drag-left,.vis-range.vis-item.vis-readonly .vis-drag-right{cursor:auto}.vis-time-axis{position:relative;overflow:hidden}.vis-time-axis.vis-foreground{top:0;left:0;width:100%}.vis-time-axis.vis-background{position:absolute;top:0;left:0;width:100%;height:100%}.vis-time-axis .vis-text{position:absolute;color:#4d4d4d;padding:3px;overflow:hidden;box-sizing:border-box;white-space:nowrap}.vis-time-axis .vis-text.vis-measure{position:absolute;padding-left:0;padding-right:0;margin-left:0;margin-right:0;visibility:hidden}.vis-time-axis .vis-grid.vis-vertical{position:absolute;border-left:1px solid}.vis-time-axis .vis-grid.vis-vertical-rtl{position:absolute;border-right:1px solid}.vis-time-axis .vis-grid.vis-minor{border-color:#e5e5e5}.vis-time-axis .vis-grid.vis-major{border-color:#bfbfbf}.vis-current-time{background-color:#FF7F6E;width:2px;z-index:1}.vis-custom-time{background-color:#6E94FF;width:2px;cursor:move;z-index:1}div.vis-network div.vis-close,div.vis-network div.vis-edit-mode div.vis-button,div.vis-network div.vis-manipulation div.vis-button{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-webkit-touch-callout:none;-khtml-user-select:none}.vis-panel.vis-background.vis-horizontal .vis-grid.vis-horizontal{position:absolute;width:100%;height:0;border-bottom:1px solid}.vis-panel.vis-background.vis-horizontal .vis-grid.vis-minor{border-color:#e5e5e5}.vis-panel.vis-background.vis-horizontal .vis-grid.vis-major{border-color:#bfbfbf}.vis-data-axis .vis-y-axis.vis-major{width:100%;position:absolute;color:#4d4d4d;white-space:nowrap}.vis-data-axis .vis-y-axis.vis-major.vis-measure{padding:0;margin:0;border:0;visibility:hidden;width:auto}.vis-data-axis .vis-y-axis.vis-minor{position:absolute;width:100%;color:#bebebe;white-space:nowrap}.vis-data-axis .vis-y-axis.vis-minor.vis-measure{padding:0;margin:0;border:0;visibility:hidden;width:auto}.vis-data-axis .vis-y-axis.vis-title{position:absolute;color:#4d4d4d;white-space:nowrap;bottom:20px;text-align:center}.vis-data-axis .vis-y-axis.vis-title.vis-measure{padding:0;margin:0;visibility:hidden;width:auto}.vis-data-axis .vis-y-axis.vis-title.vis-left{bottom:0;-webkit-transform-origin:left top;-moz-transform-origin:left top;-ms-transform-origin:left top;-o-transform-origin:left top;transform-origin:left bottom;-webkit-transform:rotate(-90deg);-moz-transform:rotate(-90deg);-ms-transform:rotate(-90deg);-o-transform:rotate(-90deg);transform:rotate(-90deg)}.vis-data-axis .vis-y-axis.vis-title.vis-right{bottom:0;-webkit-transform-origin:right bottom;-moz-transform-origin:right bottom;-ms-transform-origin:right bottom;-o-transform-origin:right bottom;transform-origin:right bottom;-webkit-transform:rotate(90deg);-moz-transform:rotate(90deg);-ms-transform:rotate(90deg);-o-transform:rotate(90deg);transform:rotate(90deg)}.vis-legend{background-color:rgba(247,252,255,.65);padding:5px;border:1px solid #b3b3b3;box-shadow:2px 2px 10px rgba(154,154,154,.55)}.vis-legend-text{white-space:nowrap;display:inline-block}.vis-graph-group0{fill:#4f81bd;fill-opacity:0;stroke-width:2px;stroke:#4f81bd}.vis-graph-group1{fill:#f79646;fill-opacity:0;stroke-width:2px;stroke:#f79646}.vis-graph-group2{fill:#8c51cf;fill-opacity:0;stroke-width:2px;stroke:#8c51cf}.vis-graph-group3{fill:#75c841;fill-opacity:0;stroke-width:2px;stroke:#75c841}.vis-graph-group4{fill:#ff0100;fill-opacity:0;stroke-width:2px;stroke:#ff0100}.vis-graph-group5{fill:#37d8e6;fill-opacity:0;stroke-width:2px;stroke:#37d8e6}.vis-graph-group6{fill:#042662;fill-opacity:0;stroke-width:2px;stroke:#042662}.vis-graph-group7{fill:#00ff26;fill-opacity:0;stroke-width:2px;stroke:#00ff26}.vis-graph-group8{fill:#f0f;fill-opacity:0;stroke-width:2px;stroke:#f0f}.vis-graph-group9{fill:#8f3938;fill-opacity:0;stroke-width:2px;stroke:#8f3938}.vis-timeline .vis-fill{fill-opacity:.1;stroke:none}.vis-timeline .vis-bar{fill-opacity:.5;stroke-width:1px}.vis-timeline .vis-point{stroke-width:2px;fill-opacity:1}.vis-timeline .vis-legend-background{stroke-width:1px;fill-opacity:.9;fill:#fff;stroke:#c2c2c2}.vis-timeline .vis-outline{stroke-width:1px;fill-opacity:1;fill:#fff;stroke:#e5e5e5}.vis-timeline .vis-icon-fill{fill-opacity:.3;stroke:none}div.vis-network div.vis-manipulation{border-width:0;border-bottom:1px;border-style:solid;border-color:#d6d9d8;background:#fff;background:-moz-linear-gradient(top,#fff 0,#fcfcfc 48%,#fafafa 50%,#fcfcfc 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,#fff),color-stop(48%,#fcfcfc),color-stop(50%,#fafafa),color-stop(100%,#fcfcfc));background:-webkit-linear-gradient(top,#fff 0,#fcfcfc 48%,#fafafa 50%,#fcfcfc 100%);background:-o-linear-gradient(top,#fff 0,#fcfcfc 48%,#fafafa 50%,#fcfcfc 100%);background:-ms-linear-gradient(top,#fff 0,#fcfcfc 48%,#fafafa 50%,#fcfcfc 100%);background:linear-gradient(to bottom,#fff 0,#fcfcfc 48%,#fafafa 50%,#fcfcfc 100%);filter:progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#fcfcfc', GradientType=0 );padding-top:4px;position:absolute;left:0;top:0;width:100%;height:28px}div.vis-network div.vis-edit-mode{position:absolute;left:0;top:5px;height:30px}div.vis-network div.vis-close{position:absolute;right:0;top:0;width:30px;height:30px;background-position:20px 3px;background-repeat:no-repeat;background-image:url(img/network/cross.png);user-select:none}div.vis-network div.vis-close:hover{opacity:.6}div.vis-network div.vis-edit-mode div.vis-button,div.vis-network div.vis-manipulation div.vis-button{float:left;font-family:verdana;font-size:12px;-moz-border-radius:15px;border-radius:15px;display:inline-block;background-position:0 0;background-repeat:no-repeat;height:24px;margin-left:10px;padding:0 8px;user-select:none}div.vis-network div.vis-manipulation div.vis-button:hover{box-shadow:1px 1px 8px rgba(0,0,0,.2)}div.vis-network div.vis-manipulation div.vis-button:active{box-shadow:1px 1px 8px rgba(0,0,0,.5)}div.vis-network div.vis-manipulation div.vis-button.vis-back{background-image:url(img/network/backIcon.png)}div.vis-network div.vis-manipulation div.vis-button.vis-none:hover{box-shadow:1px 1px 8px transparent;cursor:default}div.vis-network div.vis-manipulation div.vis-button.vis-none:active{box-shadow:1px 1px 8px transparent}div.vis-network div.vis-manipulation div.vis-button.vis-none{padding:0}div.vis-network div.vis-manipulation div.notification{margin:2px;font-weight:700}div.vis-network div.vis-manipulation div.vis-button.vis-add{background-image:url(img/network/addNodeIcon.png)}div.vis-network div.vis-edit-mode div.vis-button.vis-edit,div.vis-network div.vis-manipulation div.vis-button.vis-edit{background-image:url(img/network/editIcon.png)}div.vis-network div.vis-edit-mode div.vis-button.vis-edit.vis-edit-mode{background-color:#fcfcfc;border:1px solid #ccc}div.vis-network div.vis-manipulation div.vis-button.vis-connect{background-image:url(img/network/connectIcon.png)}div.vis-network div.vis-manipulation div.vis-button.vis-delete{background-image:url(img/network/deleteIcon.png)}div.vis-network div.vis-edit-mode div.vis-label,div.vis-network div.vis-manipulation div.vis-label{margin:0 0 0 23px;line-height:25px}div.vis-network div.vis-manipulation div.vis-separator-line{float:left;display:inline-block;width:1px;height:21px;background-color:#bdbdbd;margin:0 7px 0 15px}div.vis-network-tooltip{position:absolute;visibility:hidden;padding:5px;white-space:nowrap;font-family:verdana;font-size:14px;color:#000;background-color:#f5f4ed;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;border:1px solid #808074;box-shadow:3px 3px 10px rgba(0,0,0,.2);pointer-events:none}div.vis-network div.vis-navigation div.vis-button{width:34px;height:34px;-moz-border-radius:17px;border-radius:17px;position:absolute;display:inline-block;background-position:2px 2px;background-repeat:no-repeat;cursor:pointer;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}div.vis-network div.vis-navigation div.vis-button:hover{box-shadow:0 0 3px 3px rgba(56,207,21,.3)}div.vis-network div.vis-navigation div.vis-button:active{box-shadow:0 0 1px 3px rgba(56,207,21,.95)}div.vis-network div.vis-navigation div.vis-button.vis-up{background-image:url(img/network/upArrow.png);bottom:50px;left:55px}div.vis-network div.vis-navigation div.vis-button.vis-down{background-image:url(img/network/downArrow.png);bottom:10px;left:55px}div.vis-network div.vis-navigation div.vis-button.vis-left{background-image:url(img/network/leftArrow.png);bottom:10px;left:15px}div.vis-network div.vis-navigation div.vis-button.vis-right{background-image:url(img/network/rightArrow.png);bottom:10px;left:95px}div.vis-network div.vis-navigation div.vis-button.vis-zoomIn{background-image:url(img/network/plus.png);bottom:10px;right:15px}div.vis-network div.vis-navigation div.vis-button.vis-zoomOut{background-image:url(img/network/minus.png);bottom:10px;right:55px}div.vis-network div.vis-navigation div.vis-button.vis-zoomExtends{background-image:url(img/network/zoomExtends.png);bottom:50px;right:15px}div.vis-color-picker{position:absolute;top:0;left:30px;margin-top:-140px;margin-left:30px;width:310px;height:444px;z-index:1;padding:10px;border-radius:15px;background-color:#fff;display:none;box-shadow:rgba(0,0,0,.5) 0 0 10px 0}div.vis-color-picker div.vis-arrow{position:absolute;top:147px;left:5px}div.vis-color-picker div.vis-arrow::after,div.vis-color-picker div.vis-arrow::before{right:100%;top:50%;border:solid transparent;content:" ";height:0;width:0;position:absolute;pointer-events:none}div.vis-color-picker div.vis-arrow:after{border-color:rgba(255,255,255,0);border-right-color:#fff;border-width:30px;margin-top:-30px}div.vis-color-picker div.vis-color{position:absolute;width:289px;height:289px;cursor:pointer}div.vis-color-picker div.vis-brightness{position:absolute;top:313px}div.vis-color-picker div.vis-opacity{position:absolute;top:350px}div.vis-color-picker div.vis-selector{position:absolute;top:137px;left:137px;width:15px;height:15px;border-radius:15px;border:1px solid #fff;background:#4c4c4c;background:-moz-linear-gradient(top,#4c4c4c 0,#595959 12%,#666 25%,#474747 39%,#2c2c2c 50%,#000 51%,#111 60%,#2b2b2b 76%,#1c1c1c 91%,#131313 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,#4c4c4c),color-stop(12%,#595959),color-stop(25%,#666),color-stop(39%,#474747),color-stop(50%,#2c2c2c),color-stop(51%,#000),color-stop(60%,#111),color-stop(76%,#2b2b2b),color-stop(91%,#1c1c1c),color-stop(100%,#131313));background:-webkit-linear-gradient(top,#4c4c4c 0,#595959 12%,#666 25%,#474747 39%,#2c2c2c 50%,#000 51%,#111 60%,#2b2b2b 76%,#1c1c1c 91%,#131313 100%);background:-o-linear-gradient(top,#4c4c4c 0,#595959 12%,#666 25%,#474747 39%,#2c2c2c 50%,#000 51%,#111 60%,#2b2b2b 76%,#1c1c1c 91%,#131313 100%);background:-ms-linear-gradient(top,#4c4c4c 0,#595959 12%,#666 25%,#474747 39%,#2c2c2c 50%,#000 51%,#111 60%,#2b2b2b 76%,#1c1c1c 91%,#131313 100%);background:linear-gradient(to bottom,#4c4c4c 0,#595959 12%,#666 25%,#474747 39%,#2c2c2c 50%,#000 51%,#111 60%,#2b2b2b 76%,#1c1c1c 91%,#131313 100%);filter:progid:DXImageTransform.Microsoft.gradient( startColorstr='#4c4c4c', endColorstr='#131313', GradientType=0 )}div.vis-color-picker div.vis-initial-color,div.vis-color-picker div.vis-new-color{width:140px;height:20px;top:380px;font-size:10px;color:rgba(0,0,0,.4);line-height:20px;position:absolute;vertical-align:middle}div.vis-color-picker div.vis-new-color{border:1px solid rgba(0,0,0,.1);border-radius:5px;left:159px;text-align:right;padding-right:2px}div.vis-color-picker div.vis-initial-color{border:1px solid rgba(0,0,0,.1);border-radius:5px;left:10px;text-align:left;padding-left:2px}div.vis-color-picker div.vis-label{position:absolute;width:300px;left:10px}div.vis-color-picker div.vis-label.vis-brightness{top:300px}div.vis-color-picker div.vis-label.vis-opacity{top:338px}div.vis-color-picker div.vis-button{position:absolute;width:68px;height:25px;border-radius:10px;vertical-align:middle;text-align:center;line-height:25px;top:410px;border:2px solid #d9d9d9;background-color:#f7f7f7;cursor:pointer}div.vis-color-picker div.vis-button.vis-cancel{left:5px}div.vis-color-picker div.vis-button.vis-load{left:82px}div.vis-color-picker div.vis-button.vis-apply{left:159px}div.vis-color-picker div.vis-button.vis-save{left:236px}div.vis-color-picker input.vis-range{width:290px;height:20px}
--------------------------------------------------------------------------------
/demo/assets/img/network/acceptDeleteIcon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/seveves/angular-vis/efc52100c1c03634989c4aa06ec2b6e38d3c82fe/demo/assets/img/network/acceptDeleteIcon.png
--------------------------------------------------------------------------------
/demo/assets/img/network/addNodeIcon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/seveves/angular-vis/efc52100c1c03634989c4aa06ec2b6e38d3c82fe/demo/assets/img/network/addNodeIcon.png
--------------------------------------------------------------------------------
/demo/assets/img/network/backIcon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/seveves/angular-vis/efc52100c1c03634989c4aa06ec2b6e38d3c82fe/demo/assets/img/network/backIcon.png
--------------------------------------------------------------------------------
/demo/assets/img/network/connectIcon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/seveves/angular-vis/efc52100c1c03634989c4aa06ec2b6e38d3c82fe/demo/assets/img/network/connectIcon.png
--------------------------------------------------------------------------------
/demo/assets/img/network/cross.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/seveves/angular-vis/efc52100c1c03634989c4aa06ec2b6e38d3c82fe/demo/assets/img/network/cross.png
--------------------------------------------------------------------------------
/demo/assets/img/network/cross2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/seveves/angular-vis/efc52100c1c03634989c4aa06ec2b6e38d3c82fe/demo/assets/img/network/cross2.png
--------------------------------------------------------------------------------
/demo/assets/img/network/deleteIcon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/seveves/angular-vis/efc52100c1c03634989c4aa06ec2b6e38d3c82fe/demo/assets/img/network/deleteIcon.png
--------------------------------------------------------------------------------
/demo/assets/img/network/downArrow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/seveves/angular-vis/efc52100c1c03634989c4aa06ec2b6e38d3c82fe/demo/assets/img/network/downArrow.png
--------------------------------------------------------------------------------
/demo/assets/img/network/editIcon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/seveves/angular-vis/efc52100c1c03634989c4aa06ec2b6e38d3c82fe/demo/assets/img/network/editIcon.png
--------------------------------------------------------------------------------
/demo/assets/img/network/leftArrow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/seveves/angular-vis/efc52100c1c03634989c4aa06ec2b6e38d3c82fe/demo/assets/img/network/leftArrow.png
--------------------------------------------------------------------------------
/demo/assets/img/network/minus.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/seveves/angular-vis/efc52100c1c03634989c4aa06ec2b6e38d3c82fe/demo/assets/img/network/minus.png
--------------------------------------------------------------------------------
/demo/assets/img/network/plus.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/seveves/angular-vis/efc52100c1c03634989c4aa06ec2b6e38d3c82fe/demo/assets/img/network/plus.png
--------------------------------------------------------------------------------
/demo/assets/img/network/rightArrow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/seveves/angular-vis/efc52100c1c03634989c4aa06ec2b6e38d3c82fe/demo/assets/img/network/rightArrow.png
--------------------------------------------------------------------------------
/demo/assets/img/network/upArrow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/seveves/angular-vis/efc52100c1c03634989c4aa06ec2b6e38d3c82fe/demo/assets/img/network/upArrow.png
--------------------------------------------------------------------------------
/demo/assets/img/network/zoomExtends.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/seveves/angular-vis/efc52100c1c03634989c4aa06ec2b6e38d3c82fe/demo/assets/img/network/zoomExtends.png
--------------------------------------------------------------------------------
/demo/assets/img/timeline/delete.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/seveves/angular-vis/efc52100c1c03634989c4aa06ec2b6e38d3c82fe/demo/assets/img/timeline/delete.png
--------------------------------------------------------------------------------
/demo/demo.component.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 |
3 | @Component({
4 | selector: 'example-app',
5 | template: `
6 |
7 |
17 |
18 |
19 | `,
20 | })
21 | export class DemoComponent { }
22 |
--------------------------------------------------------------------------------
/demo/demo.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule } from '@angular/core';
2 | import { FormsModule } from '@angular/forms';
3 | import { BrowserModule } from '@angular/platform-browser';
4 | import { CommonModule } from '@angular/common';
5 | import { RouterModule } from '@angular/router';
6 |
7 | import { VisNetworkExampleComponent } from './network/network-example.component';
8 | import { VisTimelineExampleComponent } from './timeline/timeline-example.component';
9 | import { VisModule } from '../ng2-vis';
10 | import { DemoComponent } from './demo.component';
11 | import { HomeComponent } from './home/home.component';
12 |
13 | @NgModule({
14 | declarations: [
15 | DemoComponent,
16 | HomeComponent,
17 | VisNetworkExampleComponent,
18 | VisTimelineExampleComponent
19 | ],
20 | imports: [
21 | BrowserModule,
22 | FormsModule,
23 | VisModule,
24 | CommonModule,
25 | RouterModule.forRoot([
26 | { path: 'timeline', component: VisTimelineExampleComponent },
27 | { path: '', redirectTo: '/home', pathMatch: 'full' },
28 | { path: 'home', component: HomeComponent },
29 | { path: 'network', component: VisNetworkExampleComponent },
30 | { path: '**', component: HomeComponent }
31 | ])
32 | ],
33 | providers: [],
34 | bootstrap: [DemoComponent]
35 | })
36 | export class VisDemoModule { }
37 |
--------------------------------------------------------------------------------
/demo/home/home.component.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 |
3 | @Component({
4 | selector: 'home-example',
5 | template: `
6 |
14 | Examples
15 |
16 |
17 |
18 |

19 |
20 |
Network
21 |
Display dynamic, automatically organised, customizable network views.
22 |
Examples
23 |
24 |
25 |
26 |
27 |
28 |

29 |
30 |
Timeline
31 |
Create a fully customizable, interactive timeline with items and ranges.
32 |
Examples
33 |
34 |
35 |
36 |
37 | `,
38 | })
39 | export class HomeComponent {}
--------------------------------------------------------------------------------
/demo/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | ng2-vis
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 | Loading...
23 |
24 |
25 |
--------------------------------------------------------------------------------
/demo/index.ts:
--------------------------------------------------------------------------------
1 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
2 |
3 | import { VisDemoModule } from './demo.module';
4 | platformBrowserDynamic().bootstrapModule(VisDemoModule);
5 |
--------------------------------------------------------------------------------
/demo/network/network-example.component.ts:
--------------------------------------------------------------------------------
1 | import { Component, OnInit, OnDestroy } from '@angular/core';
2 |
3 | import {
4 | VisNode,
5 | VisNodes,
6 | VisEdges,
7 | VisNetworkService,
8 | VisNetworkData,
9 | VisNetworkOptions } from '../../components/network';
10 |
11 | class ExampleNetworkData implements VisNetworkData {
12 | public nodes: VisNodes;
13 | public edges: VisEdges;
14 | }
15 |
16 | @Component({
17 | selector: 'network-example',
18 | styles: [
19 | `.network-canvas {
20 | width: 100%;
21 | height: 400px;
22 | border: 1px solid lightgray;
23 | }`,
24 | ],
25 | template: `
26 | Network
27 | Basic usage
28 |
33 |
34 |
35 | Note: Open your dev tools to see the console output when the network receives click events.
36 |
37 | `,
38 | })
39 | export class VisNetworkExampleComponent implements OnInit, OnDestroy {
40 |
41 | public visNetwork: string = 'networkId1';
42 | public visNetworkData: ExampleNetworkData;
43 | public visNetworkOptions: VisNetworkOptions;
44 |
45 | public constructor(private visNetworkService: VisNetworkService) { }
46 |
47 | public addNode(): void {
48 | const newId = this.visNetworkData.nodes.getLength() + 1;
49 | this.visNetworkData.nodes.add({ id: newId.toString(), label: 'Node ' + newId });
50 | this.visNetworkService.fit(this.visNetwork);
51 | }
52 |
53 | public networkInitialized(): void {
54 | // now we can use the service to register on events
55 | this.visNetworkService.on(this.visNetwork, 'click');
56 |
57 | // open your console/dev tools to see the click params
58 | this.visNetworkService.click
59 | .subscribe((eventData: any[]) => {
60 | if (eventData[0] === this.visNetwork) {
61 | console.log(eventData[1]);
62 | }
63 | });
64 | }
65 |
66 | public ngOnInit(): void {
67 | const nodes = new VisNodes([
68 | { id: '1', label: 'Node 1' },
69 | { id: '2', label: 'Node 2' },
70 | { id: '3', label: 'Node 3' },
71 | { id: '4', label: 'Node 4' },
72 | { id: '5', label: 'Node 5', title: 'Title of Node 5' }]);
73 |
74 | const edges = new VisEdges([
75 | { from: '1', to: '3' },
76 | { from: '1', to: '2' },
77 | { from: '2', to: '4' },
78 | { from: '2', to: '5' }]);
79 |
80 | this.visNetworkData = {
81 | nodes,
82 | edges,
83 | };
84 |
85 | this.visNetworkOptions = {};
86 | }
87 |
88 | public ngOnDestroy(): void {
89 | this.visNetworkService.off(this.visNetwork, 'click');
90 | }
91 | }
92 |
--------------------------------------------------------------------------------
/demo/polyfills.ts:
--------------------------------------------------------------------------------
1 | // This file includes polyfills needed by Angular 2 and is loaded before
2 | // the app. You can add your own extra polyfills to this file.
3 |
4 | // Typescript emit helpers polyfill
5 | import 'ts-helpers';
6 |
7 | import 'core-js/es6/symbol';
8 | import 'core-js/es6/object';
9 | import 'core-js/es6/function';
10 | import 'core-js/es6/parse-int';
11 | import 'core-js/es6/parse-float';
12 | import 'core-js/es6/number';
13 | import 'core-js/es6/math';
14 | import 'core-js/es6/string';
15 | import 'core-js/es6/date';
16 | import 'core-js/es6/array';
17 | import 'core-js/es6/regexp';
18 | import 'core-js/es6/map';
19 | import 'core-js/es6/set';
20 | import 'core-js/es6/reflect';
21 |
22 | import 'core-js/es7/reflect';
23 | import 'zone.js/dist/zone';
24 |
--------------------------------------------------------------------------------
/demo/timeline/timeline-example.component.ts:
--------------------------------------------------------------------------------
1 | import { Component, OnInit, OnDestroy } from '@angular/core';
2 |
3 | import { VisTimelineService, VisTimelineItems } from '../../components/timeline';
4 |
5 | @Component({
6 | selector: 'timeline-example',
7 | template: `
8 | Timeline
9 | Basic usage
10 |
13 |
14 |
15 | Note: Open your dev tools to see the console output when the timeline receives click events.
16 |
17 | `,
18 | })
19 | export class VisTimelineExampleComponent implements OnInit, OnDestroy {
20 |
21 | public visTimeline: string = 'timelineId1';
22 | public visTimelineItems: VisTimelineItems;
23 |
24 | public constructor(private visTimelineService: VisTimelineService) {}
25 |
26 | public timelineInitialized(): void {
27 | console.log('timeline initialized');
28 |
29 | // now we can use the service to register on events
30 | this.visTimelineService.on(this.visTimeline, 'click');
31 |
32 | // open your console/dev tools to see the click params
33 | this.visTimelineService.click
34 | .subscribe((eventData: any[]) => {
35 | if (eventData[0] === this.visTimeline) {
36 | console.log(eventData[1]);
37 | }
38 | });
39 | }
40 |
41 | public addItem(): void {
42 | const newLength = this.visTimelineItems.getLength() + 1;
43 | this.visTimelineItems.add(
44 | {id: newLength, content: 'item ' + newLength, start: Date.now() }
45 | );
46 | this.visTimelineService.focusOnIds(this.visTimeline, [1, newLength]);
47 | }
48 |
49 | public ngOnInit(): void {
50 | this.visTimelineItems = new VisTimelineItems([
51 | {id: 1, content: 'item 1', start: '2016-04-20'},
52 | {id: 2, content: 'item 2', start: '2016-04-14'},
53 | {id: 3, content: 'item 3', start: '2016-04-18'},
54 | {id: 4, content: 'item 4', start: '2016-04-16', end: '2016-04-19'},
55 | {id: 5, content: 'item 5', start: '2016-04-25'},
56 | {id: 6, content: 'item 6', start: '2016-04-27', type: 'point'}
57 | ]);
58 | }
59 |
60 | public ngOnDestroy(): void {
61 | this.visTimelineService.off(this.visTimeline, 'click');
62 | }
63 | }
--------------------------------------------------------------------------------
/demo/vendor.ts:
--------------------------------------------------------------------------------
1 | // For vendors for example jQuery, Lodash, angular2-jwt just import them here unless you plan on
2 | // chunking vendors files for async loading. You would need to import the async loaded vendors
3 | // at the entry point of the async loaded file. Also see custom-typings.d.ts as you also need to
4 | // run `typings install x` where `x` is your module
5 |
6 | // Angular 2
7 | import '@angular/common';
8 | import '@angular/core';
9 | import '@angular/forms';
10 | import '@angular/platform-browser';
11 | import '@angular/platform-browser-dynamic';
12 |
13 | import 'vis';
14 |
--------------------------------------------------------------------------------
/gulp-tasks/lint.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | const gulp = require('gulp');
4 | const tslint = require('gulp-tslint');
5 | const gitignore = require('gitignore-to-glob')();
6 |
7 | gitignore.push('components/**/*.ts');
8 | gitignore.push('ng2-vis.ts');
9 |
10 | gulp.task('tslint', () =>
11 | gulp
12 | .src(gitignore)
13 | .pipe(tslint({
14 | formatter: 'verbose',
15 | emitError: true,
16 | summarizeFailureOutput: true,
17 | reportLimit: 50
18 | }))
19 | .pipe(tslint.report())
20 | );
21 |
22 | gulp.task('lint', ['tslint']);
23 |
--------------------------------------------------------------------------------
/gulpfile.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | const gulp = require('gulp');
4 |
5 | require('require-dir')('./gulp-tasks');
6 |
7 | gulp.task('default', () => {
8 | gulp.start('lint');
9 | });
10 |
--------------------------------------------------------------------------------
/karma.conf.js:
--------------------------------------------------------------------------------
1 | /**
2 | * @author: @AngularClass
3 | */
4 | 'use strict';
5 |
6 | // Look in ./config for karma.conf.js
7 | const config = require('./.ng2-config');
8 |
9 | config.src = '/';
10 |
11 | module.exports = require('./.config/karma.conf')(config);
12 |
--------------------------------------------------------------------------------
/ng2-vis.ts:
--------------------------------------------------------------------------------
1 | import { NgModule } from '@angular/core';
2 |
3 | import { VisNetworkDirective, VisNetworkService } from './components/network/index';
4 | import { VisTimelineDirective, VisTimelineService } from './components/timeline/index';
5 |
6 | export * from './components/index';
7 |
8 | @NgModule({
9 | declarations: [VisNetworkDirective, VisTimelineDirective],
10 | exports: [VisNetworkDirective, VisTimelineDirective],
11 | providers: [VisNetworkService, VisTimelineService],
12 | })
13 | export class VisModule { }
14 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "ng2-vis",
3 | "version": "0.0.6",
4 | "main": "ng2-vis.js",
5 | "types": "ng2-vis.d.ts",
6 | "description": "Angular 2 components for using vis.js",
7 | "repository": {
8 | "type": "git",
9 | "url": "git+https://github.com/seveves/ng2-vis.git"
10 | },
11 | "keywords": [
12 | "angular2",
13 | "ng2",
14 | "vis",
15 | "angular2-vis",
16 | "ng2-vis"
17 | ],
18 | "author": "Severin Friede ",
19 | "license": "MIT",
20 | "bugs": {
21 | "url": "https://github.com/seveves/ng2-vis/issues"
22 | },
23 | "homepage": "https://github.com/seveves/ng2-vis#readme",
24 | "scripts": {
25 | "flow.compile": "npm run flow.compile:common && npm run flow.compile:system && npm run flow.extract-metadata",
26 | "flow.compile:tsc": "./node_modules/.bin/tsc -p tsconfig.publish.json",
27 | "flow.compile:common": "npm run flow.compile:tsc",
28 | "flow.compile:system": "node ./.config/bundle-system.js",
29 | "flow.copy:src": "./node_modules/.bin/cpy ng2-vis.ts \"components/*.ts\" ts --parents",
30 | "flow.clean": "./node_modules/.bin/rimraf bundles coverage dist demo-build \"components/**/*.+(metadata.json|js|d.ts|js.map)\" dist \"ng2-vis.+(js|d.ts|js.map)\"",
31 | "flow.eslint": "./node_modules/.bin/eslint --ignore-path .gitignore --ext js --fix . .config",
32 | "flow.extract-metadata": "./node_modules/.bin/ngc -p tsconfig.publish.json",
33 | "flow.tslint": "./node_modules/.bin/gulp lint",
34 | "flow.lint": "npm run flow.eslint && npm run flow.tslint",
35 | "flow.build:prod": "./node_modules/.bin/cross-env NODE_ENV=production ./node_modules/.bin/webpack --config .config/webpack.prod.js --progress --color",
36 | "flow.build:dev": "./node_modules/.bin/webpack --progress --color",
37 | "flow.serve:dev": "./node_modules/.bin/webpack-dev-server --hot --inline --colors",
38 | "flow.serve:prod": "./node_modules/.bin/cross-env NODE_ENV=production ./node_modules/.bin/webpack-dev-server --config .config/webpack.prod.js --hot --inline --colors",
39 | "serve": "npm run flow.serve:dev",
40 | "clean": "npm run flow.clean",
41 | "build": "npm run flow.compile",
42 | "pretest": "npm run flow.lint",
43 | "test": "./node_modules/.bin/karma start",
44 | "test:watch": "./node_modules/.bin/cross-env NODE_ENV=test ./node_modules/.bin/karma start --auto-watch --no-single-run",
45 | "preversion": "npm test",
46 | "version": "git add -A",
47 | "postversion": "git push origin master && git push --tags"
48 | },
49 | "dependencies": {
50 | "vis": "4.17.0",
51 | "@types/vis": "4.17.4"
52 | },
53 | "peerDependencies": {
54 | "@angular/common": "^2.4.10",
55 | "@angular/core": "^2.4.10",
56 | "@angular/compiler": "^2.4.10"
57 | },
58 | "devDependencies": {
59 | "@angular/common": "^2.4.10",
60 | "@angular/compiler": "^2.4.10",
61 | "@angular/compiler-cli": "^2.4.10",
62 | "@angular/core": "^2.4.10",
63 | "@angular/forms": "^2.4.10",
64 | "@angular/platform-browser": "^2.4.10",
65 | "@angular/platform-browser-dynamic": "^2.4.10",
66 | "@angular/platform-server": "^2.4.10",
67 | "@angular/router": "^3.4.10",
68 | "@types/jasmine": "^2.5.46",
69 | "@types/node": "^7.0.8",
70 | "@types/webpack": "^2.2.11",
71 | "angular2-template-loader": "^0.6.2",
72 | "awesome-typescript-loader": "^3.1.2",
73 | "codecov": "^2.0.2",
74 | "copy-webpack-plugin": "^4.0.1",
75 | "cpy-cli": "^1.0.1",
76 | "cross-env": "^3.2.4",
77 | "css-loader": "^0.27.3",
78 | "es6-promise": "^4.1.0",
79 | "es6-shim": "^0.35.3",
80 | "eslint": "^3.18.0",
81 | "extract-text-webpack-plugin": "^2.1.0",
82 | "file-loader": "^0.10.1",
83 | "gitignore-to-glob": "^0.3.0",
84 | "gulp": "3.9.1",
85 | "gulp-tslint": "^7.1.0",
86 | "html-loader": "^0.4.5",
87 | "istanbul-instrumenter-loader": "^2.0.0",
88 | "jasmine-core": "^2.5.2",
89 | "karma": "^1.5.0",
90 | "karma-coverage": "^1.1.1",
91 | "karma-firefox-launcher": "^1.0.1",
92 | "karma-jasmine": "^1.1.0",
93 | "karma-mocha": "^1.3.0",
94 | "karma-mocha-reporter": "^2.2.2",
95 | "karma-sourcemap-loader": "^0.3.7",
96 | "karma-webpack": "^2.0.3",
97 | "null-loader": "^0.1.1",
98 | "pre-commit": "^1.2.2",
99 | "raw-loader": "^0.5.1",
100 | "reflect-metadata": "^0.1.10",
101 | "require-dir": "^0.3.1",
102 | "rimraf": "^2.6.1",
103 | "rxjs": "^5.0.1",
104 | "source-map-loader": "^0.2.0",
105 | "style-loader": "^0.14.1",
106 | "systemjs-builder": "^0.16.4",
107 | "to-string-loader": "^1.1.5",
108 | "ts-helpers": "^1.1.2",
109 | "tslint": "^4.5.1",
110 | "tslint-loader": "^3.4.3",
111 | "typescript": "^2.2.1",
112 | "typings": "^2.1.0",
113 | "webpack": "^2.2.1",
114 | "webpack-dev-server": "^2.4.2",
115 | "webpack-merge": "^4.1.0",
116 | "zone.js": "^0.8.4"
117 | }
118 | }
119 |
--------------------------------------------------------------------------------
/spec-bundle.js:
--------------------------------------------------------------------------------
1 | /* eslint no-var: 0, vars-on-top: 0 */
2 | /**
3 | * @author: @AngularClass
4 | */
5 |
6 | /*
7 | * When testing with webpack and ES6, we have to do some extra
8 | * things to get testing to work right. Because we are gonna write tests
9 | * in ES6 too, we have to compile those as well. That's handled in
10 | * karma.conf.js with the karma-webpack plugin. This is the entry
11 | * file for webpack test. Just like webpack will create a bundle.js
12 | * file for our client, when we run test, it will compile and bundle them
13 | * all here! Crazy huh. So we need to do some setup
14 | */
15 | 'use strict';
16 | Error.stackTraceLimit = Infinity;
17 |
18 | require('core-js');
19 |
20 | // Typescript emit helpers polyfill
21 | require('ts-helpers');
22 |
23 | require('zone.js/dist/zone');
24 | require('zone.js/dist/long-stack-trace-zone');
25 | require('zone.js/dist/async-test');
26 | require('zone.js/dist/fake-async-test');
27 | require('zone.js/dist/sync-test');
28 | require('zone.js/dist/proxy');
29 | require('zone.js/dist/jasmine-patch');
30 |
31 | // RxJS
32 | require('rxjs/Rx');
33 |
34 | var testing = require('@angular/core/testing');
35 | var browser = require('@angular/platform-browser-dynamic/testing');
36 |
37 | testing.TestBed.initTestEnvironment(
38 | browser.BrowserDynamicTestingModule,
39 | browser.platformBrowserDynamicTesting()
40 | );
41 |
42 | Object.assign(global, testing);
43 |
44 | /*
45 | * Ok, this is kinda crazy. We can use the the context method on
46 | * require that webpack created in order to tell webpack
47 | * what files we actually want to require or import.
48 | * Below, context will be an function/object with file names as keys.
49 | * using that regex we are saying look in ./src/app and ./test then find
50 | * any file that ends with spec.js and get its path. By passing in true
51 | * we say do this recursively
52 | */
53 | var testContext = require.context('./components', true, /\.spec\.ts/);
54 |
55 | /*
56 | * get all the files, for each file, call the context function
57 | * that will require the file and load it up here. Context will
58 | * loop and require those spec files here
59 | */
60 | function requireAll(requireContext) {
61 | return requireContext.keys().map(requireContext);
62 | }
63 |
64 | // requires and returns all modules that match
65 | requireAll(testContext);
66 |
--------------------------------------------------------------------------------
/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "es5",
4 | "module": "commonjs",
5 | "moduleResolution": "node",
6 | "emitDecoratorMetadata": true,
7 | "experimentalDecorators": true,
8 | "sourceMap": true,
9 | "noEmitHelpers": true,
10 | "noImplicitAny": true,
11 | "declaration": false,
12 | "skipLibCheck": true,
13 | "stripInternal": true,
14 | "lib": ["dom", "es6"],
15 | "typeRoots": [
16 | "./node_modules/@types"
17 | ],
18 | "types": [
19 | "node",
20 | "jasmine",
21 | "webpack",
22 | "vis"
23 | ]
24 | },
25 | "exclude": [
26 | "node_modules", "bundles", "dist"
27 | ],
28 | "files": [
29 | "./ng2-vis.ts"
30 | ],
31 | "atom": { "rewriteTsconfig": false }
32 | }
33 |
--------------------------------------------------------------------------------
/tsconfig.publish.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "es5",
4 | "module": "commonjs",
5 | "moduleResolution": "node",
6 | "emitDecoratorMetadata": true,
7 | "experimentalDecorators": true,
8 | "sourceMap": false,
9 | "noEmitHelpers": false,
10 | "noImplicitAny": true,
11 | "declaration": true,
12 | "skipLibCheck": true,
13 | "stripInternal": true,
14 | "lib": ["dom", "es6"],
15 | "typeRoots": [
16 | "./node_modules/@types"
17 | ],
18 | "types": [
19 | "node",
20 | "jasmine",
21 | "webpack",
22 | "vis"
23 | ]
24 | },
25 | "exclude": [
26 | "node_modules"
27 | ],
28 | "files": [
29 | "./ng2-vis.ts"
30 | ],
31 | "angularCompilerOptions": {
32 | "genDir": "factories"
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/tslint.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "tslint:latest",
3 | "rules": {
4 | "quotemark": false,
5 | "only-arrow-functions": false,
6 | "no-string-literal": false,
7 | "linebreak-style": false,
8 | "interface-name": [false],
9 | "no-reference": false,
10 | "max-classes-per-file": false,
11 | "no-empty-interface": false
12 | }
13 | }
--------------------------------------------------------------------------------
/typings.json:
--------------------------------------------------------------------------------
1 | {
2 | "globalDependencies": {
3 | "vs": "github:seveves/typings-vis#6696261117e363878b0b3a0472dadae93f43fe27"
4 | }
5 | }
6 |
--------------------------------------------------------------------------------
/webpack.config.js:
--------------------------------------------------------------------------------
1 | /* eslint no-process-env: 0, global-require:0 */
2 | 'use strict';
3 |
4 | module.exports = require('./.config/webpack.dev.js');
--------------------------------------------------------------------------------