diff --git a/src/app/base/services/project/project-apollo.service.ts b/src/app/base/services/project/project-apollo.service.ts index 76890779..022d5092 100644 --- a/src/app/base/services/project/project-apollo.service.ts +++ b/src/app/base/services/project/project-apollo.service.ts @@ -199,6 +199,24 @@ export class ProjectApolloService { ); } + getConfidenceDistributions(projectId: string, labelingTaskId: string = null, sliceId: string = null) { + return this.apollo + .query({ + query: queries.GET_CONFIDENCE_DISTRIBUTION, + variables: { + projectId: projectId, + labelingTaskId: labelingTaskId, + sliceId: sliceId, + }, + fetchPolicy: 'no-cache', + }) + .pipe( + map((result) => { + return JSON.parse(result['data']['confidenceDistribution']); + }) + ); + } + getProjectByIdQuery( projectId: string ) { diff --git a/src/app/base/services/project/project-queries.ts b/src/app/base/services/project/project-queries.ts index c82fff2d..330dd5e9 100644 --- a/src/app/base/services/project/project-queries.ts +++ b/src/app/base/services/project/project-queries.ts @@ -119,6 +119,12 @@ export const queries = { } `, + GET_CONFIDENCE_DISTRIBUTION: gql` + query ($projectId: ID!, $labelingTaskId: ID, $sliceId: ID) { + confidenceDistribution(projectId: $projectId, labelingTaskId: $labelingTaskId, sliceId: $sliceId) + } + `, + GET_ATTRIBUTES_BY_PROJECT_ID: gql` query($projectId: ID!){ attributesByProjectId(projectId: $projectId) { diff --git a/src/app/charts/charts.module.ts b/src/app/charts/charts.module.ts index 7fa0d4a2..9e68224f 100644 --- a/src/app/charts/charts.module.ts +++ b/src/app/charts/charts.module.ts @@ -6,21 +6,23 @@ import { BarChartComponent } from './components/bar-chart/bar-chart.component'; import { HorizontalGroupedBarChartComponent } from './components/horizontal-grouped-bar-chart/horizontal-grouped-bar-chart.component'; import { BoxplotComponent } from './components/boxplot/boxplot.component'; import { ConfusionMatrixComponent } from './components/confusion-matrix/confusion-matrix.component'; +import { LineChartComponent } from './components/line-chart/line-chart.component'; @NgModule({ - declarations: [GroupedBarChartComponent, BarChartComponent, HorizontalGroupedBarChartComponent, BoxplotComponent, ConfusionMatrixComponent], + declarations: [LineChartComponent, GroupedBarChartComponent, BarChartComponent, HorizontalGroupedBarChartComponent, BoxplotComponent, ConfusionMatrixComponent], imports: [ CommonModule, AppRoutingModule ], exports: [ + LineChartComponent, GroupedBarChartComponent, BarChartComponent, HorizontalGroupedBarChartComponent, BoxplotComponent, - ConfusionMatrixComponent + ConfusionMatrixComponent, ] }) export class ChartsModule { } diff --git a/src/app/charts/components/line-chart/line-chart.component.html b/src/app/charts/components/line-chart/line-chart.component.html new file mode 100644 index 00000000..330dbb47 --- /dev/null +++ b/src/app/charts/components/line-chart/line-chart.component.html @@ -0,0 +1,2 @@ +
+ \ No newline at end of file diff --git a/src/app/charts/components/line-chart/line-chart.component.scss b/src/app/charts/components/line-chart/line-chart.component.scss new file mode 100644 index 00000000..0befd653 --- /dev/null +++ b/src/app/charts/components/line-chart/line-chart.component.scss @@ -0,0 +1,13 @@ +.lineChartTooltip { + position: absolute; + display: none; + width: auto; + height: auto; + background: #F3F4F6; + border: 0 none; + border-radius: 4px; + color: #0C052E; + font: 14px sans-serif; + padding: 5px; + text-align: center; +} \ No newline at end of file diff --git a/src/app/charts/components/line-chart/line-chart.component.spec.ts b/src/app/charts/components/line-chart/line-chart.component.spec.ts new file mode 100644 index 00000000..400ba17b --- /dev/null +++ b/src/app/charts/components/line-chart/line-chart.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { LineChartComponent } from './line-chart.component'; + +describe('LineChartComponent', () => { + let component: LineChartComponent; + let fixture: ComponentFixture