Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: new Graph option nullable #4421

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
liaodalin19903 marked this conversation as resolved.
Show resolved Hide resolved
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
Loading