Skip to content

Commit

Permalink
test graph
Browse files Browse the repository at this point in the history
  • Loading branch information
samfairbairn committed May 6, 2024
1 parent d2b3f21 commit d780d7b
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/storykit/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@storyprotocol/storykit",
"author": "storyprotocol engineering <eng@storyprotocol.xyz>",
"version": "0.1.6-mrtest.8",
"version": "0.1.6-mrtest.9",
"type": "module",
"exports": {
".": {
Expand Down
9 changes: 9 additions & 0 deletions packages/storykit/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,23 @@ const config = [
file: packageJson.exports["."].default,
format: "cjs",
sourcemap: true,
// globals: {
// react: "React",
// "react-dom": "ReactDOM",
// "react-apexcharts": "ApexCharts",
// },
},
{
file: packageJson.exports["."].module,
format: "esm",
sourcemap: true,
// globals: {
// "react-apexcharts": "ApexCharts",
// },
},
],
plugins: [peerDepsExternal(), resolve(), commonjs(), typescript(), terser(), postcss()],
// external: ["react/jsx-runtime", "react-apexcharts"],
external: ["react/jsx-runtime"],
},
{
Expand Down
3 changes: 0 additions & 3 deletions packages/storykit/src/components/IPAGraph/forceGraph2d.ts

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,22 +1,32 @@
import { shortenAddress } from "@/lib/utils"
import { useIPAssetContext } from "@/providers"
import { useEffect, useState } from "react"
// import Chart from "react-apexcharts"
import { Address } from "viem"

import "../../global.css"

function IPARoyaltyChart() {
// const Chart = dynamic(() => import("react-apexcharts"), { ssr: false })

const { royaltyData } = useIPAssetContext()

// console.log("Chart", Chart)

// eslint-disable-next-line @typescript-eslint/no-explicit-any
const [Chart, setChart] = useState<any>(null)
useEffect(() => {
import("react-apexcharts").then((Component) => setChart(Component))
}, [])

console.log("Chart", Chart)
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// let ApexChart = Chart ? (Chart as unknown as any)?.default || Chart : null
let ApexChart = Chart
console.log("ApexChart 1", ApexChart)
if (ApexChart?.default) ApexChart = ApexChart.default
console.log("ApexChart 2", ApexChart)
if (ApexChart?.default) ApexChart = ApexChart.default
console.log("ApexChart 3", ApexChart)

if (royaltyData?.targetAncestors) {
const chart = {
Expand Down
2 changes: 1 addition & 1 deletion packages/storykit/src/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ export * from "./Button"
// export * from "./IPAssetWidget"
export * from "./IPAGraph"
export * from "./IPAPolicies"
export * from "./IPARoyaltyChart"
// export * from "./IPARoyaltyChart"

0 comments on commit d780d7b

Please sign in to comment.