Skip to content

Commit 71ee6ee

Browse files
Merge pull request #197 from CivicDataLab/196-revamp-and-update-charts-creation-as-per-the-new-features
Revamp and update charts creation as per the new features
2 parents a734d72 + 5b4de4f commit 71ee6ee

File tree

6 files changed

+1025
-418
lines changed

6 files changed

+1025
-418
lines changed

app/[locale]/(user)/datasets/[datasetIdentifier]/components/Details/index.tsx

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1+
import { useRef } from 'react';
2+
import Image from 'next/image';
3+
import Link from 'next/link';
4+
import { useParams } from 'next/navigation';
15
import { renderGeoJSON } from '@/geo_json/render_geojson';
26
import { graphql } from '@/gql';
37
import { useQuery } from '@tanstack/react-query';
48
import ReactECharts from 'echarts-for-react';
59
import * as echarts from 'echarts/core';
6-
import Image from 'next/image';
7-
import Link from 'next/link';
8-
import { useParams } from 'next/navigation';
910
import {
1011
Button,
1112
Carousel,
@@ -17,24 +18,19 @@ import {
1718
Spinner,
1819
Text,
1920
} from 'opub-ui';
20-
import { useRef } from 'react';
2121

22-
import { Icons } from '@/components/icons';
2322
import { GraphQL } from '@/lib/api';
23+
import { Icons } from '@/components/icons';
2424

2525
const DetailsQuery: any = graphql(`
2626
query ChartDetailsQuery($datasetId: UUID!) {
2727
getChartData(datasetId: $datasetId) {
2828
__typename
2929
... on TypeResourceChart {
30-
aggregateType
3130
chartType
3231
description
3332
id
3433
name
35-
showLegend
36-
xAxisLabel
37-
yAxisLabel
3834
chart
3935
}
4036
... on TypeResourceChartImage {
@@ -60,7 +56,6 @@ const Details = () => {
6056
() => GraphQL(DetailsQuery, {}, { datasetId: params.datasetIdentifier })
6157
);
6258

63-
6459
const renderChart = (item: any) => {
6560
if (item.chartType === 'ASSAM_DISTRICT' || item.chartType === 'ASSAM_RC') {
6661
// Register the map

0 commit comments

Comments
 (0)