You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streampipes.apache.org by ze...@apache.org on 2020/10/01 21:04:40 UTC
[incubator-streampipes] 01/02: Move labels component
This is an automated email from the ASF dual-hosted git repository.
zehnder pushed a commit to branch STREAMPIPES-234
in repository https://gitbox.apache.org/repos/asf/incubator-streampipes.git
commit edbc416a02c6a4d4497a980a9a5e0b196e560a43
Author: Philipp Zehnder <ze...@fzi.de>
AuthorDate: Thu Oct 1 22:23:42 2020 +0200
Move labels component
---
ui/src/app/core-ui/core-ui.module.ts | 114 ++++++++++-----------
.../image-categorize.component.html | 4 +-
.../image-categorize/image-categorize.component.ts | 2 +-
.../image-labeling/image-labeling.component.html | 4 +-
.../image-labeling/image-labeling.component.ts | 2 +-
.../configure-labels.component.css | 0
.../configure-labels.component.html | 1 +
.../configure-labels/configure-labels.component.ts | 15 +++
.../select-label/select-label.component.css} | 0
.../select-label/select-label.component.html} | 0
.../select-label/select-label.component.ts} | 10 +-
.../line-chart/line-chart-widget.component.html | 4 +-
12 files changed, 86 insertions(+), 70 deletions(-)
diff --git a/ui/src/app/core-ui/core-ui.module.ts b/ui/src/app/core-ui/core-ui.module.ts
index dd54a06..80d04b8 100644
--- a/ui/src/app/core-ui/core-ui.module.ts
+++ b/ui/src/app/core-ui/core-ui.module.ts
@@ -16,63 +16,63 @@
*
*/
-import {CommonModule} from '@angular/common';
-import {NgModule} from '@angular/core';
-import {FlexLayoutModule} from '@angular/flex-layout';
+import { CommonModule } from '@angular/common';
+import { NgModule } from '@angular/core';
+import { FlexLayoutModule } from '@angular/flex-layout';
-import {CdkTableModule} from '@angular/cdk/table';
-import {FormsModule, ReactiveFormsModule} from '@angular/forms';
-import {MatNativeDateModule} from '@angular/material/core';
-import {MatDatepickerModule} from '@angular/material/datepicker';
-import {MatProgressSpinnerModule} from '@angular/material/progress-spinner';
-import {MatSnackBarModule} from '@angular/material/snack-bar';
-import {CustomMaterialModule} from '../CustomMaterial/custom-material.module';
+import { CdkTableModule } from '@angular/cdk/table';
+import { FormsModule, ReactiveFormsModule } from '@angular/forms';
+import { MatNativeDateModule } from '@angular/material/core';
+import { MatDatepickerModule } from '@angular/material/datepicker';
+import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
+import { MatSnackBarModule } from '@angular/material/snack-bar';
+import { CustomMaterialModule } from '../CustomMaterial/custom-material.module';
-import {MatChipsModule} from '@angular/material/chips';
-import {MatSliderModule} from '@angular/material/slider';
-import {PlotlyViaWindowModule} from 'angular-plotly.js';
-import {ImageAnnotationsComponent} from './image/components/image-annotations/image-annotations.component';
-import {ImageBarComponent} from './image/components/image-bar/image-bar.component';
-import {ImageContainerComponent} from './image/components/image-container/image-container.component';
-import {ImageLabelsComponent} from './image/components/image-labels/image-labels.component';
-import {ImageCategorizeComponent} from './image/image-categorize/image-categorize.component';
-import {ImageLabelingComponent} from './image/image-labeling/image-labeling.component';
-import {ImageViewerComponent} from './image/image-viewer/image-viewer.component';
-import {ImageComponent} from './image/image.component';
-import {BrushLabelingService} from './image/services/BrushLabeling.service';
-import {ColorService} from './image/services/color.service';
-import {PolygonLabelingService} from './image/services/PolygonLabeling.service';
-import {ReactLabelingService} from './image/services/ReactLabeling.service';
-import {CocoFormatService} from "./image/services/CocoFormat.service";
-import {LabelingModeService} from "./image/services/LabelingMode.service";
-import {StandardDialogComponent} from "./dialog/standard-dialog/standard-dialog.component";
-import {PanelDialogComponent} from "./dialog/panel-dialog/panel-dialog.component";
-import {DialogService} from "./dialog/base-dialog/base-dialog.service";
-import {PortalModule} from "@angular/cdk/portal";
-import {OverlayModule} from "@angular/cdk/overlay";
-import {ConfirmDialogComponent} from "./dialog/confirm-dialog/confirm-dialog.component";
-import {StaticAnyInput} from "./static-properties/static-any-input/static-any-input.component";
-import {StaticPropertyComponent} from "./static-properties/static-property.component";
-import {StaticFreeInputComponent} from "./static-properties/static-free-input/static-free-input.component";
-import {StaticSecretInputComponent} from "./static-properties/static-secret-input/static-secret-input.component";
-import {StaticFileInputComponent} from "./static-properties/static-file-input/static-file-input.component";
-import {StaticMappingNaryComponent} from "./static-properties/static-mapping-nary/static-mapping-nary.component";
-import {StaticMappingUnaryComponent} from "./static-properties/static-mapping-unary/static-mapping-unary.component";
-import {StaticGroupComponent} from "./static-properties/static-group/static-group.component";
-import {StaticAlternativesComponent} from "./static-properties/static-alternatives/static-alternatives.component";
-import {StaticCollectionComponent} from "./static-properties/static-collection/static-collection.component";
-import {StaticColorPickerComponent} from "./static-properties/static-color-picker/static-color-picker.component";
-import {StaticCodeInputComponent} from "./static-properties/static-code-input/static-code-input.component";
-import {StaticOneOfInputComponent} from "./static-properties/static-one-of-input/static-one-of-input.component";
-import {StaticRuntimeResolvableAnyInputComponent} from "./static-properties/static-runtime-resolvable-any-input/static-runtime-resolvable-any-input.component";
-import {StaticRuntimeResolvableOneOfInputComponent} from "./static-properties/static-runtime-resolvable-oneof-input/static-runtime-resolvable-oneof-input.component";
-import {RuntimeResolvableService} from "./static-properties/static-runtime-resolvable-input/runtime-resolvable.service";
-import {StaticFileRestService} from "./static-properties/static-file-input/static-file-rest.service";
-import {DisplayRecommendedPipe} from "./static-properties/filter/display-recommended.pipe";
-import {ColorPickerModule} from "ngx-color-picker";
-import {QuillModule} from "ngx-quill";
-import {CodemirrorModule} from "@ctrl/ngx-codemirror";
-import {MatAutocompleteModule} from "@angular/material/autocomplete";
+import { MatChipsModule } from '@angular/material/chips';
+import { MatSliderModule } from '@angular/material/slider';
+import { PlotlyViaWindowModule } from 'angular-plotly.js';
+import { ImageAnnotationsComponent } from './image/components/image-annotations/image-annotations.component';
+import { ImageBarComponent } from './image/components/image-bar/image-bar.component';
+import { ImageContainerComponent } from './image/components/image-container/image-container.component';
+import { SelectLabelComponent } from './labels/components/select-label/select-label.component';
+import { ImageCategorizeComponent } from './image/image-categorize/image-categorize.component';
+import { ImageLabelingComponent } from './image/image-labeling/image-labeling.component';
+import { ImageViewerComponent } from './image/image-viewer/image-viewer.component';
+import { ImageComponent } from './image/image.component';
+import { BrushLabelingService } from './image/services/BrushLabeling.service';
+import { ColorService } from './image/services/color.service';
+import { PolygonLabelingService } from './image/services/PolygonLabeling.service';
+import { ReactLabelingService } from './image/services/ReactLabeling.service';
+import { CocoFormatService } from './image/services/CocoFormat.service';
+import { LabelingModeService } from './image/services/LabelingMode.service';
+import { StandardDialogComponent } from './dialog/standard-dialog/standard-dialog.component';
+import { PanelDialogComponent } from './dialog/panel-dialog/panel-dialog.component';
+import { DialogService } from './dialog/base-dialog/base-dialog.service';
+import { PortalModule } from '@angular/cdk/portal';
+import { OverlayModule } from '@angular/cdk/overlay';
+import { ConfirmDialogComponent } from './dialog/confirm-dialog/confirm-dialog.component';
+import { StaticAnyInput } from './static-properties/static-any-input/static-any-input.component';
+import { StaticPropertyComponent } from './static-properties/static-property.component';
+import { StaticFreeInputComponent } from './static-properties/static-free-input/static-free-input.component';
+import { StaticSecretInputComponent } from './static-properties/static-secret-input/static-secret-input.component';
+import { StaticFileInputComponent } from './static-properties/static-file-input/static-file-input.component';
+import { StaticMappingNaryComponent } from './static-properties/static-mapping-nary/static-mapping-nary.component';
+import { StaticMappingUnaryComponent } from './static-properties/static-mapping-unary/static-mapping-unary.component';
+import { StaticGroupComponent } from './static-properties/static-group/static-group.component';
+import { StaticAlternativesComponent } from './static-properties/static-alternatives/static-alternatives.component';
+import { StaticCollectionComponent } from './static-properties/static-collection/static-collection.component';
+import { StaticColorPickerComponent } from './static-properties/static-color-picker/static-color-picker.component';
+import { StaticCodeInputComponent } from './static-properties/static-code-input/static-code-input.component';
+import { StaticOneOfInputComponent } from './static-properties/static-one-of-input/static-one-of-input.component';
+import { StaticRuntimeResolvableAnyInputComponent } from './static-properties/static-runtime-resolvable-any-input/static-runtime-resolvable-any-input.component';
+import { StaticRuntimeResolvableOneOfInputComponent } from './static-properties/static-runtime-resolvable-oneof-input/static-runtime-resolvable-oneof-input.component';
+import { RuntimeResolvableService } from './static-properties/static-runtime-resolvable-input/runtime-resolvable.service';
+import { StaticFileRestService } from './static-properties/static-file-input/static-file-rest.service';
+import { DisplayRecommendedPipe } from './static-properties/filter/display-recommended.pipe';
+import { ColorPickerModule } from 'ngx-color-picker';
+import { QuillModule } from 'ngx-quill';
+import { CodemirrorModule } from '@ctrl/ngx-codemirror';
+import { MatAutocompleteModule } from '@angular/material/autocomplete';
@NgModule({
imports: [
@@ -102,7 +102,7 @@ import {MatAutocompleteModule} from "@angular/material/autocomplete";
ImageComponent,
ImageContainerComponent,
ImageLabelingComponent,
- ImageLabelsComponent,
+ SelectLabelComponent,
ImageBarComponent,
ImageAnnotationsComponent,
ImageCategorizeComponent,
@@ -143,7 +143,7 @@ import {MatAutocompleteModule} from "@angular/material/autocomplete";
exports: [
ImageComponent,
ImageLabelingComponent,
- ImageLabelsComponent,
+ SelectLabelComponent,
StandardDialogComponent,
PanelDialogComponent,
ConfirmDialogComponent,
diff --git a/ui/src/app/core-ui/image/image-categorize/image-categorize.component.html b/ui/src/app/core-ui/image/image-categorize/image-categorize.component.html
index 1cb3110..6f50352 100644
--- a/ui/src/app/core-ui/image/image-categorize/image-categorize.component.html
+++ b/ui/src/app/core-ui/image/image-categorize/image-categorize.component.html
@@ -20,11 +20,11 @@
<div fxLayout="column" fxLayoutAlign="space-between " >
<div fxLayout="row" fxLayoutAlign="space-around start">
- <sp-image-labels
+ <sp-select-label
[labels]="labels"
[enableShortCuts]="true"
(labelChange)="handleLabelChange($event)">
- </sp-image-labels>
+ </sp-select-label>
<div fxLayout="column" fxLayoutAlign="space-between " >
<div fxLayout="row" fxLayoutAlign="center center" >
diff --git a/ui/src/app/core-ui/image/image-categorize/image-categorize.component.ts b/ui/src/app/core-ui/image/image-categorize/image-categorize.component.ts
index bead55f..dac99d0 100644
--- a/ui/src/app/core-ui/image/image-categorize/image-categorize.component.ts
+++ b/ui/src/app/core-ui/image/image-categorize/image-categorize.component.ts
@@ -116,7 +116,7 @@ export class ImageCategorizeComponent implements OnInit, AfterViewInit {
/* sp-image-view handler */
- /* sp-image-labels handler */
+ /* sp-select-label handler */
handleLabelChange(label: {category, label}) {
this.selectedLabels.push(label);
}
diff --git a/ui/src/app/core-ui/image/image-labeling/image-labeling.component.html b/ui/src/app/core-ui/image/image-labeling/image-labeling.component.html
index 005943f..8940538 100644
--- a/ui/src/app/core-ui/image/image-labeling/image-labeling.component.html
+++ b/ui/src/app/core-ui/image/image-labeling/image-labeling.component.html
@@ -21,11 +21,11 @@
<div fxLayout="column" fxLayoutAlign="space-between " >
<div fxLayout="row" fxLayoutAlign="space-around start">
- <sp-image-labels style="width: 270px"
+ <sp-select-label style="width: 270px"
[labels]="labels"
[enableShortCuts]="isHoverComponent"
(labelChange)="handleLabelChange($event)">
- </sp-image-labels>
+ </sp-select-label>
<div fxLayout="column" fxLayoutAlign="space-between " >
<div style="display: flex; position: relative">
diff --git a/ui/src/app/core-ui/image/image-labeling/image-labeling.component.ts b/ui/src/app/core-ui/image/image-labeling/image-labeling.component.ts
index 16c82c8..1fe46db 100644
--- a/ui/src/app/core-ui/image/image-labeling/image-labeling.component.ts
+++ b/ui/src/app/core-ui/image/image-labeling/image-labeling.component.ts
@@ -206,7 +206,7 @@ export class ImageLabelingComponent implements OnInit {
this.isDrawing = bool;
}
- /* sp-image-labels handler */
+ /* sp-select-label handler */
handleLabelChange(label: {category, label}) {
this.selectedLabel = label;
}
diff --git a/ui/src/app/core-ui/labels/components/configure-labels/configure-labels.component.css b/ui/src/app/core-ui/labels/components/configure-labels/configure-labels.component.css
new file mode 100644
index 0000000..e69de29
diff --git a/ui/src/app/core-ui/labels/components/configure-labels/configure-labels.component.html b/ui/src/app/core-ui/labels/components/configure-labels/configure-labels.component.html
new file mode 100644
index 0000000..2dfb465
--- /dev/null
+++ b/ui/src/app/core-ui/labels/components/configure-labels/configure-labels.component.html
@@ -0,0 +1 @@
+<p>configure-labels works!</p>
diff --git a/ui/src/app/core-ui/labels/components/configure-labels/configure-labels.component.ts b/ui/src/app/core-ui/labels/components/configure-labels/configure-labels.component.ts
new file mode 100644
index 0000000..b07c3f3
--- /dev/null
+++ b/ui/src/app/core-ui/labels/components/configure-labels/configure-labels.component.ts
@@ -0,0 +1,15 @@
+import { Component, OnInit } from '@angular/core';
+
+@Component({
+ selector: 'configure-labels',
+ templateUrl: './configure-labels.component.html',
+ styleUrls: ['./configure-labels.component.css']
+})
+export class ConfigureLabelsComponent implements OnInit {
+
+ constructor() { }
+
+ ngOnInit(): void {
+ }
+
+}
diff --git a/ui/src/app/core-ui/image/components/image-labels/image-labels.component.css b/ui/src/app/core-ui/labels/components/select-label/select-label.component.css
similarity index 100%
rename from ui/src/app/core-ui/image/components/image-labels/image-labels.component.css
rename to ui/src/app/core-ui/labels/components/select-label/select-label.component.css
diff --git a/ui/src/app/core-ui/image/components/image-labels/image-labels.component.html b/ui/src/app/core-ui/labels/components/select-label/select-label.component.html
similarity index 100%
rename from ui/src/app/core-ui/image/components/image-labels/image-labels.component.html
rename to ui/src/app/core-ui/labels/components/select-label/select-label.component.html
diff --git a/ui/src/app/core-ui/image/components/image-labels/image-labels.component.ts b/ui/src/app/core-ui/labels/components/select-label/select-label.component.ts
similarity index 89%
rename from ui/src/app/core-ui/image/components/image-labels/image-labels.component.ts
rename to ui/src/app/core-ui/labels/components/select-label/select-label.component.ts
index 928c646..43b3144 100644
--- a/ui/src/app/core-ui/image/components/image-labels/image-labels.component.ts
+++ b/ui/src/app/core-ui/labels/components/select-label/select-label.component.ts
@@ -17,14 +17,14 @@
*/
import { Component, EventEmitter, HostListener, Input, OnInit, Output } from '@angular/core';
-import { ColorService } from '../../services/color.service';
+import { ColorService } from '../../../image/services/color.service';
@Component({
- selector: 'sp-image-labels',
- templateUrl: './image-labels.component.html',
- styleUrls: ['./image-labels.component.css']
+ selector: 'sp-select-label',
+ templateUrl: './select-label.component.html',
+ styleUrls: ['./select-label.component.css']
})
-export class ImageLabelsComponent implements OnInit {
+export class SelectLabelComponent implements OnInit {
@Input()
set labels(labels) {
diff --git a/ui/src/app/data-explorer/components/widgets/line-chart/line-chart-widget.component.html b/ui/src/app/data-explorer/components/widgets/line-chart/line-chart-widget.component.html
index 5153f61..5decf46 100644
--- a/ui/src/app/data-explorer/components/widgets/line-chart/line-chart-widget.component.html
+++ b/ui/src/app/data-explorer/components/widgets/line-chart/line-chart-widget.component.html
@@ -70,11 +70,11 @@
<sp-no-data-in-date-range *ngIf="showNoDataInDateRange" [viewDateRange]="viewDateRange"></sp-no-data-in-date-range>
- <sp-image-labels *ngIf="labelingModeOn"
+ <sp-select-label *ngIf="labelingModeOn"
[labels]="possibleLabels"
[enableShortCuts]="true"
(labelChange)="handleLabelChange($event)">
- </sp-image-labels>
+ </sp-select-label>
<plotly-plot *ngIf="data !== undefined && !showNoDataInDateRange && !showIsLoadingData"
class="plotly-container"