-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement busy support for cell execution (#26)
* Implement busy support * Fixup api so that it works for unit tests too
- Loading branch information
Showing
16 changed files
with
452 additions
and
228 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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 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 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 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
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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 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 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,37 @@ | ||
.execution-count { | ||
font-weight: bold; | ||
color: green; | ||
} | ||
|
||
.execution-count-busy-outer { | ||
font-weight: bold; | ||
color: green; | ||
display:flex; | ||
width: 16px; | ||
height: 16px; | ||
} | ||
.execution-count-busy-svg { | ||
animation-name: spin; | ||
animation-duration: 4000ms; | ||
animation-iteration-count: infinite; | ||
animation-timing-function: linear; | ||
transform-origin: 50% 50%; | ||
width: 16px; | ||
height: 16px; | ||
} | ||
|
||
.execution-count-busy-polyline { | ||
fill: none; | ||
stroke: green; | ||
stroke-width: 5; | ||
} | ||
|
||
@keyframes spin { | ||
from { | ||
transform:rotate(0deg); | ||
} | ||
to { | ||
transform:rotate(360deg); | ||
} | ||
} | ||
|
This file contains 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,31 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
'use strict'; | ||
import * as React from 'react'; | ||
import { CellState, ICell } from '../types'; | ||
import './executionCount.css'; | ||
|
||
interface IExecutionCountProps { | ||
cell: ICell; | ||
theme: string; | ||
} | ||
|
||
export class ExecutionCount extends React.Component<IExecutionCountProps> { | ||
constructor(props) { | ||
super(props); | ||
} | ||
|
||
public render() { | ||
const isBusy = this.props.cell.state === CellState.init || this.props.cell.state === CellState.executing; | ||
|
||
return isBusy ? | ||
( | ||
<div className='execution-count-busy-outer'>[<svg className='execution-count-busy-svg' viewBox='0 0 100 100'><polyline points='50,0, 50,50, 85,15, 50,50, 100,50, 50,50, 85,85, 50,50 50,100 50,50 15,85 50,50 0,50 50,50 15,15' className='execution-count-busy-polyline'/></svg>]</div> | ||
) : | ||
( | ||
<div className='execution-count'>{`[${this.props.cell.execution_count}]`}</div> | ||
); | ||
} | ||
|
||
} |
This file contains 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
Oops, something went wrong.