Skip to content

Commit

Permalink
Merge pull request #152 from frappe/develop
Browse files Browse the repository at this point in the history
chore: merge 'develop' into 'main'
  • Loading branch information
nextchamp-saqib authored Aug 9, 2023
2 parents 18cbe4e + 78af97a commit ef6f36b
Show file tree
Hide file tree
Showing 109 changed files with 2,120 additions and 1,451 deletions.
1 change: 1 addition & 0 deletions frontend/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<link rel="icon" href="/favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Frappe Insights</title>
<script type="text/javascript" src="https://unpkg.com/default-passive-events"></script>
</head>
<body class="h-full">
<div id="app" class="h-full"></div>
Expand Down
3 changes: 2 additions & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
},
"dependencies": {
"@codemirror/lang-javascript": "^6.0.2",
"@codemirror/lang-python": "^6.1.3",
"@codemirror/lang-sql": "^6.4.0",
"@playwright/test": "^1.32.1",
"@vitejs/plugin-vue": "^4.2.3",
Expand All @@ -19,7 +20,7 @@
"dayjs": "^1.11.6",
"echarts": "^5.4.0",
"feather-icons": "^4.28.0",
"frappe-ui": "0.1.0-alpha.5",
"frappe-ui": "0.1.0-alpha.11",
"lucide-vue-next": "^0.259.0",
"pinia": "^2.0.30",
"tailwindcss": "3.2.7",
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/components/AppShell.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
</template>

<script setup>
import { computed, onMounted } from 'vue'
import auth from '@/utils/auth'
import Sidebar from '@/components/Sidebar.vue'
import { useRoute } from 'vue-router'
import auth from '@/utils/auth'
import settings from '@/utils/settings'
import systemSettings from '@/utils/systemSettings'
import { computed, onMounted } from 'vue'
import { useRoute } from 'vue-router'
const route = useRoute()
const hideSidebar = computed(() => {
Expand Down
60 changes: 60 additions & 0 deletions frontend/src/components/Charts/BaseChart.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<script setup>
import * as echarts from 'echarts'
import { onBeforeUnmount, onMounted, ref, watch } from 'vue'
const props = defineProps({
title: { type: String, required: false },
subtitle: { type: String, required: false },
options: { type: Object, required: true },
})
let eChart = null
const chartRef = ref(null)
onMounted(() => {
eChart = echarts.init(chartRef.value, 'light', { renderer: 'svg' })
props.options && eChart.setOption(props.options)
const resizeObserver = new ResizeObserver(() => eChart.resize())
setTimeout(() => chartRef.value && resizeObserver.observe(chartRef.value), 1000)
onBeforeUnmount(() => chartRef.value && resizeObserver.unobserve(chartRef.value))
})
watch(
() => props.options,
() => eChart && eChart.setOption(props.options),
{ deep: true }
)
defineExpose({ downloadChart })
function downloadChart() {
const image = new Image()
const type = 'png'
image.src = eChart.getDataURL({
type,
pixelRatio: 2,
backgroundColor: '#fff',
})
const link = document.createElement('a')
link.href = image.src
link.download = `${props.title}.${type}`
link.click()
}
</script>

<template>
<div class="h-full w-full rounded p-2">
<div class="flex h-full w-full flex-col">
<div v-if="title" class="flex-shrink-0" :class="['mx-3', subtitle ? 'h-11' : 'h-6']">
<div class="text-lg font-normal leading-6 text-gray-800">
{{ title }}
</div>
<div v-if="subtitle" class="text-base font-light">
{{ subtitle }}
</div>
</div>
<div ref="chartRef" class="w-full flex-1 overflow-hidden">
<slot></slot>
</div>
</div>
</div>
</template>
78 changes: 0 additions & 78 deletions frontend/src/components/Charts/Chart.vue

This file was deleted.

27 changes: 0 additions & 27 deletions frontend/src/components/Charts/ChartAxis.vue

This file was deleted.

18 changes: 0 additions & 18 deletions frontend/src/components/Charts/ChartGrid.vue

This file was deleted.

21 changes: 0 additions & 21 deletions frontend/src/components/Charts/ChartLegend.vue

This file was deleted.

22 changes: 0 additions & 22 deletions frontend/src/components/Charts/ChartSeries.vue

This file was deleted.

17 changes: 0 additions & 17 deletions frontend/src/components/Charts/ChartTooltip.vue

This file was deleted.

Loading

0 comments on commit ef6f36b

Please sign in to comment.