Skip to content

Commit

Permalink
Run prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
jlfwong committed Nov 12, 2020
1 parent b7af76b commit 7639bc4
Show file tree
Hide file tree
Showing 19 changed files with 573 additions and 540 deletions.
2 changes: 1 addition & 1 deletion src/speedscope.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {h, render} from 'preact'
import {createAppStore} from './store'
import {ApplicationContainer} from './views/application-container'
import {Provider} from './lib/preact-redux'
import { ThemeProvider } from './views/themes/theme'
import {ThemeProvider} from './views/themes/theme'

console.log(`speedscope v${require('../package.json').version}`)

Expand Down
2 changes: 1 addition & 1 deletion src/views/application-container.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {useActionCreator} from '../lib/preact-redux'
import {memo} from 'preact/compat'
import {useAppSelector, useActiveProfileState} from '../store'
import {ProfileSearchContextProvider} from './search-view'
import { useTheme } from './themes/theme'
import {useTheme} from './themes/theme'

const {
setLoading,
Expand Down
220 changes: 113 additions & 107 deletions src/views/application.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {LeftHeavyFlamechartView, ChronoFlamechartView} from './flamechart-view-c
import {CanvasContext} from '../gl/canvas-context'
import {Toolbar} from './toolbar'
import {importJavaScriptSourceMapSymbolRemapper} from '../lib/js-source-map'
import { Theme, withTheme } from './themes/theme'
import {Theme, withTheme} from './themes/theme'

const importModule = import('../import')

Expand Down Expand Up @@ -564,7 +564,11 @@ export class Application extends StatelessComponent<ApplicationProps> {
onDragLeave={this.onDragLeave}
className={css(style.root, this.props.dragActive && style.dragTargetRoot)}
>
<GLCanvas setGLCanvas={this.props.setGLCanvas} canvasContext={this.props.canvasContext} theme={this.props.theme} />
<GLCanvas
setGLCanvas={this.props.setGLCanvas}
canvasContext={this.props.canvasContext}
theme={this.props.theme}
/>
<Toolbar
saveFile={this.saveFile}
browseForFile={this.browseForFile}
Expand All @@ -577,112 +581,114 @@ export class Application extends StatelessComponent<ApplicationProps> {
}
}

const getStyle = withTheme((theme) => StyleSheet.create({
glCanvasView: {
position: 'absolute',
width: '100vw',
height: '100vh',
zIndex: -1,
pointerEvents: 'none',
},
error: {
display: 'flex',
flexDirection: 'column',
alignItems: 'center',
justifyContent: 'center',
height: '100%',
},
loading: {
height: 3,
marginBottom: -3,
background: theme.selectionPrimaryColor,
transformOrigin: '0% 50%',
animationName: [
{
from: {
transform: `scaleX(0)`,
},
to: {
transform: `scaleX(1)`,
const getStyle = withTheme(theme =>
StyleSheet.create({
glCanvasView: {
position: 'absolute',
width: '100vw',
height: '100vh',
zIndex: -1,
pointerEvents: 'none',
},
error: {
display: 'flex',
flexDirection: 'column',
alignItems: 'center',
justifyContent: 'center',
height: '100%',
},
loading: {
height: 3,
marginBottom: -3,
background: theme.selectionPrimaryColor,
transformOrigin: '0% 50%',
animationName: [
{
from: {
transform: `scaleX(0)`,
},
to: {
transform: `scaleX(1)`,
},
},
],
animationTimingFunction: 'cubic-bezier(0, 1, 0, 1)',
animationDuration: '30s',
},
root: {
width: '100vw',
height: '100vh',
overflow: 'hidden',
display: 'flex',
flexDirection: 'column',
position: 'relative',
fontFamily: FontFamily.MONOSPACE,
lineHeight: '20px',
color: theme.fgPrimaryColor,
},
dragTargetRoot: {
cursor: 'copy',
},
dragTarget: {
boxSizing: 'border-box',
position: 'absolute',
top: 0,
left: 0,
width: '100%',
height: '100%',
border: `5px dashed ${theme.selectionPrimaryColor}`,
pointerEvents: 'none',
},
contentContainer: {
position: 'relative',
display: 'flex',
overflow: 'hidden',
flexDirection: 'column',
flex: 1,
},
landingContainer: {
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
flex: 1,
},
landingMessage: {
maxWidth: 600,
},
landingP: {
marginBottom: 16,
},
hide: {
display: 'none',
},
browseButtonContainer: {
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
},
browseButton: {
marginBottom: 16,
height: 72,
flex: 1,
maxWidth: 256,
textAlign: 'center',
fontSize: FontSize.BIG_BUTTON,
lineHeight: '72px',
background: theme.selectionPrimaryColor,
color: theme.altFgPrimaryColor,
transition: `all ${Duration.HOVER_CHANGE} ease-in`,
':hover': {
background: theme.selectionSecondaryColor,
},
],
animationTimingFunction: 'cubic-bezier(0, 1, 0, 1)',
animationDuration: '30s',
},
root: {
width: '100vw',
height: '100vh',
overflow: 'hidden',
display: 'flex',
flexDirection: 'column',
position: 'relative',
fontFamily: FontFamily.MONOSPACE,
lineHeight: '20px',
color: theme.fgPrimaryColor
},
dragTargetRoot: {
cursor: 'copy',
},
dragTarget: {
boxSizing: 'border-box',
position: 'absolute',
top: 0,
left: 0,
width: '100%',
height: '100%',
border: `5px dashed ${theme.selectionPrimaryColor}`,
pointerEvents: 'none',
},
contentContainer: {
position: 'relative',
display: 'flex',
overflow: 'hidden',
flexDirection: 'column',
flex: 1,
},
landingContainer: {
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
flex: 1,
},
landingMessage: {
maxWidth: 600,
},
landingP: {
marginBottom: 16,
},
hide: {
display: 'none',
},
browseButtonContainer: {
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
},
browseButton: {
marginBottom: 16,
height: 72,
flex: 1,
maxWidth: 256,
textAlign: 'center',
fontSize: FontSize.BIG_BUTTON,
lineHeight: '72px',
background: theme.selectionPrimaryColor,
color: theme.altFgPrimaryColor,
transition: `all ${Duration.HOVER_CHANGE} ease-in`,
':hover': {
background: theme.selectionSecondaryColor,
},
},
link: {
color: theme.selectionPrimaryColor,
cursor: 'pointer',
textDecoration: 'none',
transition: `all ${Duration.HOVER_CHANGE} ease-in`,
':hover': {
color: theme.selectionSecondaryColor,
link: {
color: theme.selectionPrimaryColor,
cursor: 'pointer',
textDecoration: 'none',
transition: `all ${Duration.HOVER_CHANGE} ease-in`,
':hover': {
color: theme.selectionSecondaryColor,
},
},
},
}))
}),
)
2 changes: 1 addition & 1 deletion src/views/callee-flamegraph-view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {FlamechartWrapper} from './flamechart-wrapper'
import {useAppSelector} from '../store'
import {h} from 'preact'
import {memo} from 'preact/compat'
import { useTheme } from './themes/theme'
import {useTheme} from './themes/theme'

const getCalleeProfile = memoizeByShallowEquality<
{
Expand Down
28 changes: 15 additions & 13 deletions src/views/color-chit.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {h} from 'preact'
import {StyleSheet, css} from 'aphrodite'
import {FontSize} from './style'
import { useTheme, withTheme } from './themes/theme'
import {useTheme, withTheme} from './themes/theme'

interface ColorChitProps {
color: string
Expand All @@ -12,15 +12,17 @@ export function ColorChit(props: ColorChitProps) {
return <span className={css(style.stackChit)} style={{backgroundColor: props.color}} />
}

const getStyle = withTheme(theme => StyleSheet.create({
stackChit: {
position: 'relative',
top: -1,
display: 'inline-block',
verticalAlign: 'middle',
marginRight: '0.5em',
border: `1px solid ${theme.fgSecondaryColor}`,
width: FontSize.LABEL - 2,
height: FontSize.LABEL - 2,
},
}))
const getStyle = withTheme(theme =>
StyleSheet.create({
stackChit: {
position: 'relative',
top: -1,
display: 'inline-block',
verticalAlign: 'middle',
marginRight: '0.5em',
border: `1px solid ${theme.fgSecondaryColor}`,
width: FontSize.LABEL - 2,
height: FontSize.LABEL - 2,
},
}),
)
2 changes: 1 addition & 1 deletion src/views/flamechart-detail-view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {formatPercent} from '../lib/utils'
import {Frame, CallTreeNode} from '../lib/profile'
import {ColorChit} from './color-chit'
import {Flamechart} from '../lib/flamechart'
import { useTheme } from './themes/theme'
import {useTheme} from './themes/theme'

interface StatisticsTableProps {
title: string
Expand Down
4 changes: 2 additions & 2 deletions src/views/flamechart-minimap-view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import {getFlamechartStyle} from './flamechart-style'
import {FontFamily, FontSize, Sizes, commonStyle} from './style'
import {CanvasContext} from '../gl/canvas-context'
import {cachedMeasureTextWidth} from '../lib/text-utils'
import { Color } from '../lib/color'
import { Theme } from './themes/theme'
import {Color} from '../lib/color'
import {Theme} from './themes/theme'

interface FlamechartMinimapViewProps {
theme: Theme
Expand Down
9 changes: 6 additions & 3 deletions src/views/flamechart-pan-zoom-view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import {h, Component} from 'preact'
import {css} from 'aphrodite'
import {ProfileSearchResults} from '../lib/profile-search'
import {BatchCanvasTextRenderer, BatchCanvasRectRenderer} from '../lib/canvas-2d-batch-renderers'
import { Color } from '../lib/color'
import { Theme } from './themes/theme'
import {Color} from '../lib/color'
import {Theme} from './themes/theme'

interface FlamechartFrameLabel {
configSpaceBounds: Rect
Expand Down Expand Up @@ -350,7 +350,10 @@ export class FlamechartPanZoomView extends Component<FlamechartPanZoomViewProps,
matchedFrameBatch.fill(ctx, theme.searchMatchPrimaryColor)
matchedTextHighlightBatch.fill(ctx, theme.searchMatchSecondaryColor)
fadedLabelBatch.fill(ctx, theme.fgSecondaryColor)
labelBatch.fill(ctx, this.props.searchResults != null ? theme.searchMatchTextColor : theme.fgPrimaryColor)
labelBatch.fill(
ctx,
this.props.searchResults != null ? theme.searchMatchTextColor : theme.fgPrimaryColor,
)
indirectlySelectedOutlineBatch.stroke(ctx, theme.selectionSecondaryColor, frameOutlineWidth)
directlySelectedOutlineBatch.stroke(ctx, theme.selectionPrimaryColor, frameOutlineWidth)

Expand Down
2 changes: 1 addition & 1 deletion src/views/flamechart-view-container.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {actions} from '../store/actions'
import {memo} from 'preact/compat'
import {ActiveProfileState} from '../store'
import {FlamechartSearchContextProvider} from './flamechart-search-view'
import { Theme, useTheme } from './themes/theme'
import {Theme, useTheme} from './themes/theme'

interface FlamechartSetters {
setLogicalSpaceViewportSize: (logicalSpaceViewportSize: Vec2) => void
Expand Down
2 changes: 1 addition & 1 deletion src/views/flamechart-view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {FlamechartViewProps} from './flamechart-view-container'
import {StatelessComponent} from '../lib/typed-redux'
import {ProfileSearchContext} from './search-view'
import {FlamechartSearchView} from './flamechart-search-view'
import { getFlamechartStyle } from './flamechart-style'
import {getFlamechartStyle} from './flamechart-style'

export class FlamechartView extends StatelessComponent<FlamechartViewProps> {
private getStyle() {
Expand Down
14 changes: 8 additions & 6 deletions src/views/flamechart-wrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {noop, formatPercent} from '../lib/utils'
import {Hovertip} from './hovertip'
import {FlamechartViewProps} from './flamechart-view-container'
import {StatelessComponent} from '../lib/typed-redux'
import { withTheme } from './themes/theme'
import {withTheme} from './themes/theme'

export class FlamechartWrapper extends StatelessComponent<FlamechartViewProps> {
private clampViewportToFlamegraph(viewportRect: Rect) {
Expand Down Expand Up @@ -91,8 +91,10 @@ export class FlamechartWrapper extends StatelessComponent<FlamechartViewProps> {
}
}

export const getStyle = withTheme(theme => StyleSheet.create({
hoverCount: {
color: theme.weightColor,
},
}))
export const getStyle = withTheme(theme =>
StyleSheet.create({
hoverCount: {
color: theme.weightColor,
},
}),
)
Loading

0 comments on commit 7639bc4

Please sign in to comment.