Skip to content

Commit

Permalink
Merge pull request #1672 from eijawerner/no-limit-graph-to-be-selecta…
Browse files Browse the repository at this point in the history
…ble-choice

Remove viz limit of 1000
  • Loading branch information
OskarDamkjaer committed Feb 11, 2022
2 parents ade57ea + 5535829 commit 77f8855
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 13 deletions.
5 changes: 1 addition & 4 deletions src/browser/modules/Stream/CypherFrame/CypherFrame.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ import {
VisualizationIcon
} from 'browser-components/icons/Icons'
import { StyledFrameBody } from 'browser/modules/Frame/styled'
import { requestExceedsVisLimits } from 'browser/modules/Stream/CypherFrame/helpers'
import RelatableView, {
RelatableStatusbar
} from 'browser/modules/Stream/CypherFrame/relatable-view'
Expand Down Expand Up @@ -201,9 +200,7 @@ export class CypherFrame extends Component<CypherFrameProps, CypherFrameState> {
}

canShowViz = (): boolean =>
!requestExceedsVisLimits(this.props.request) &&
resultHasNodes(this.props.request) &&
!this.state.errors
resultHasNodes(this.props.request) && !this.state.errors

sidebar = (): JSX.Element => (
<FrameSidebar>
Expand Down
10 changes: 1 addition & 9 deletions src/browser/modules/Stream/CypherFrame/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import {
some,
take
} from 'lodash-es'
import { Duration } from 'luxon'
import neo4j from 'neo4j-driver'

import bolt from 'services/bolt/bolt'
Expand Down Expand Up @@ -135,12 +134,6 @@ export const flattenArrayDeep = (arr: any) => {
return result
}

const VIS_MAX_SAFE_LIMIT = 1000

export const requestExceedsVisLimits = ({ result }: any = {}) => {
return resultHasTruncatedFields(result, VIS_MAX_SAFE_LIMIT)
}

export const resultHasNodes = (request: any, types = neo4j.types) => {
if (!request) return false
const { result = {} } = request
Expand Down Expand Up @@ -222,8 +215,7 @@ export const initialView = (props: any, state: any = {}) => {
}
// No we don't care about the recentView
// If the response have viz elements, we show the viz
if (!requestExceedsVisLimits(props.request) && resultHasNodes(props.request))
return viewTypes.VISUALIZATION
if (resultHasNodes(props.request)) return viewTypes.VISUALIZATION
return viewTypes.TABLE
}

Expand Down

0 comments on commit 77f8855

Please sign in to comment.