:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
import { keyForInsightLogicProps } from 'lib/insights/sharedUtils'
import { InsightLogicProps } from '~/types'
/**
* Kept apart from InsightViz.tsx so logics can build dataNodeLogic keys without
* statically importing the InsightViz component graph into their chunk.
*/
/** The key for the dataNodeLogic mounted by an InsightViz for insight of insightProps */
export const insightVizDataNodeKey = (insightProps: InsightLogicProps<any>): string => {
return `InsightViz.${keyForInsightLogicProps('new')(insightProps)}`
}
export const insightVizDataCollectionId = (props: InsightLogicProps<any> | undefined, fallback: string): string => {
return props?.dataNodeCollectionId ?? props?.dashboardId?.toString() ?? props?.dashboardItemId ?? fallback
}