-
Notifications
You must be signed in to change notification settings - Fork 12
Spanner graph UX flow V2 #54
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
Open
cqian23
wants to merge
17
commits into
main
Choose a base branch
from
implement/config-UI-jupyter
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
9551a3d
Use query params instead of hardcoded values in node expansion query
rusellvegh1201 8ba7596
added param type
rusellvegh1201 f8670e1
update test cases, added date and timestamp
rusellvegh1201 9dab741
Implementation of Resource UI
rusellvegh1201 acde20c
implement resource ui on jupyter
rusellvegh1201 0ec81a4
implement id based execution to avoid override cell output
rusellvegh1201 2d8810f
dev implementation using pydata, remove login with google implementation
rusellvegh1201 6f68cbd
added validation
rusellvegh1201 e7550b1
added required packages
rusellvegh1201 95a8a5a
Update setup.py google-api-python-client
rusellvegh1201 0b90993
clean magics file , update setup file
rusellvegh1201 d7f5732
update readme file
rusellvegh1201 5b8f8eb
reconfigure code, single percent sing %, make a dynamic loader
rusellvegh1201 7d55ba6
integrate api's on dev playground
rusellvegh1201 652b13d
added new test cases to test cell magic and line magic with no args
rusellvegh1201 7baad8a
Redo reconfiguration and modify graph server file
rusellvegh1201 1bbdf6f
Colab implementation
rusellvegh1201 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,6 +3,7 @@ keys/ | |
|
|
||
| # local virtual env | ||
| .venv/ | ||
| viz/ | ||
|
|
||
| # Byte-compiled / optimized / DLL files | ||
| __pycache__/ | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,141 @@ | ||
| class LoaderManager { | ||
| constructor() { | ||
| this.templateCache = null; | ||
| } | ||
|
|
||
| createLoaderElement(message) { | ||
| const loaderContainer = document.createElement('div'); | ||
|
|
||
| Object.assign(loaderContainer.style, { | ||
| position: 'absolute', | ||
| top: '0', | ||
| left: '0', | ||
| right: '0', | ||
| bottom: '0', | ||
| width: '100%', | ||
| height: '100%', | ||
| background: 'rgba(255, 255, 255, 0.9)', | ||
| display: 'flex', | ||
| alignItems: 'center', | ||
| justifyContent: 'center', | ||
| zIndex: '99999', | ||
| pointerEvents: 'all', | ||
| borderRadius: '8px' | ||
| }); | ||
|
|
||
| const wrapper = document.createElement('div'); | ||
| Object.assign(wrapper.style, { | ||
| textAlign: 'center', | ||
| padding: '20px' | ||
| }); | ||
|
|
||
| const spinner = document.createElement('div'); | ||
| Object.assign(spinner.style, { | ||
| border: '6px solid #f3f3f3', | ||
| borderTop: '6px solid #4285F4', | ||
| borderRadius: '50%', | ||
| width: '40px', | ||
| height: '40px', | ||
| margin: 'auto', | ||
| animation: 'spin 1s linear infinite' | ||
| }); | ||
|
|
||
| const messageEl = document.createElement('div'); | ||
| Object.assign(messageEl.style, { | ||
| marginTop: '10px', | ||
| fontSize: '16px', | ||
| color: '#333', | ||
| fontFamily: 'Arial, sans-serif' | ||
| }); | ||
| messageEl.textContent = message; | ||
|
|
||
| if (!document.getElementById('loader-keyframes')) { | ||
| const style = document.createElement('style'); | ||
| style.id = 'loader-keyframes'; | ||
| style.textContent = ` | ||
| @keyframes spin { | ||
| 0% { transform: rotate(0deg); } | ||
| 100% { transform: rotate(360deg); } | ||
| } | ||
| `; | ||
| document.head.appendChild(style); | ||
| } | ||
|
|
||
| // Assemble elements | ||
| wrapper.appendChild(spinner); | ||
| wrapper.appendChild(messageEl); | ||
| loaderContainer.appendChild(wrapper); | ||
|
|
||
| return loaderContainer; | ||
| } | ||
|
|
||
| async showLoader(message = "Loading...", container = null) { | ||
| const loaderId = container ? `auth-loader-${container.dataset.id || 'default'}` : 'auth-loader'; | ||
|
|
||
| // Remove existing loader first | ||
| const existingLoader = document.getElementById(loaderId); | ||
| if (existingLoader) { | ||
| existingLoader.remove(); | ||
| } | ||
|
|
||
| const loaderContainer = this.createLoaderElement(message); | ||
| loaderContainer.id = loaderId; | ||
|
|
||
| if (container) { | ||
| const originalPosition = window.getComputedStyle(container).position; | ||
|
|
||
| if (originalPosition === 'static' || originalPosition === '') { | ||
| container.style.position = 'relative'; | ||
| loaderContainer.dataset.originalPosition = ''; | ||
| } else { | ||
| loaderContainer.dataset.originalPosition = container.style.position; | ||
| } | ||
|
|
||
| if (container.offsetHeight === 0) { | ||
| container.style.minHeight = '200px'; | ||
| } | ||
|
|
||
| container.appendChild(loaderContainer); | ||
| } else { | ||
| Object.assign(loaderContainer.style, { | ||
| position: 'fixed', | ||
| top: '0', | ||
| left: '0', | ||
| width: '100vw', | ||
| height: '100vh' | ||
| }); | ||
| document.body.appendChild(loaderContainer); | ||
| } | ||
| loaderContainer.offsetHeight; | ||
|
|
||
| setTimeout(() => { | ||
| const computedStyle = window.getComputedStyle(loaderContainer); | ||
| }, 100); | ||
|
|
||
| return loaderContainer; | ||
| } | ||
|
|
||
| removeLoader(container = null) { | ||
| const loaderId = container ? `auth-loader-${container.dataset.id || 'default'}` : 'auth-loader'; | ||
| const loader = document.getElementById(loaderId); | ||
|
|
||
| if (loader) { | ||
| if (container) { | ||
| const originalPosition = loader.dataset.originalPosition; | ||
| if (originalPosition !== undefined) { | ||
| if (originalPosition === '') { | ||
| container.style.position = 'static'; | ||
| } else { | ||
| container.style.position = originalPosition; | ||
| } | ||
| } | ||
| } | ||
|
|
||
| loader.remove(); | ||
| } | ||
| } | ||
| } | ||
|
|
||
| const loader = new LoaderManager(); | ||
| window.showLoader = loader.showLoader.bind(loader); | ||
| window.removeLoader = loader.removeLoader.bind(loader); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| class Helpers { | ||
| showToast(message, duration = 3000) { | ||
| const toast = document.getElementById("toast"); | ||
| toast.textContent = message; | ||
| toast.classList.remove("hidden"); | ||
| toast.classList.add("show"); | ||
|
|
||
| setTimeout(() => { | ||
| toast.classList.remove("show"); | ||
| toast.classList.add("hidden"); | ||
| }, duration); | ||
| } | ||
| } | ||
|
|
||
| export default new Helpers(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| /** | ||
| * Copyright 2025 Google LLC | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
|
|
||
| function removeLoader() { | ||
| const loader = document.getElementById('auth-loader-container'); | ||
| if (loader) loader.remove(); | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to be very careful about the main readme, where we try to be compact and only include information for users of this package.
The new lines need not be surfaced to users I assume. For python installation, users will use
pip install spanner-graph-notebook. This package is on PyPi.For frontend development, I believe the readme is in frontend already?