Skip to content

Commit

Permalink
fix: new Graph option nullable
Browse files Browse the repository at this point in the history
  • Loading branch information
liaodalin19903 committed Aug 30, 2024
1 parent 003491b commit 18d234a
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 119 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ test/coverage
packages/**/src/style/raw.ts
.eslintcache
.stylelintcache
pnpm-lock.yaml
16 changes: 16 additions & 0 deletions packages/x6/src/__tests__/graph/index.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { Graph } from '../../graph'

describe('Graph', () => {
it('should return graph', () => {
const graph = new Graph({
container: document.getElementById('container'),
width: 800,
height: 600,
background: {
color: '#F2F7FA',
},
})

return graph
})
})
6 changes: 5 additions & 1 deletion packages/x6/src/graph/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,11 @@ export namespace Options {
embedding: boolean | Partial<Embedding>
}

export interface Manual extends Partial<Common>, Partial<ManualBooleans> {
type NullablePartial<T> = { [P in keyof T]?: T[P] | undefined | null }

export interface Manual
extends NullablePartial<Common>,
Partial<ManualBooleans> {
grid?:
| boolean
| number
Expand Down
Loading

0 comments on commit 18d234a

Please sign in to comment.