Skip to content

Commit

Permalink
INtegrated timeline
Browse files Browse the repository at this point in the history
  • Loading branch information
benbrandt committed Oct 27, 2023
1 parent 21dffce commit 01289c1
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 3 deletions.
4 changes: 2 additions & 2 deletions log-viewer/src/lib/components/timeline/SpanDuration.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@
This is a recursive component that builds itself up by creating the same component for sub-spans.
-->
<div class="w-full py-0.5 hover:bg-gray-50">
<div class="h-8 w-full border-t py-0.5 last:border-b hover:bg-gray-50">
<button
class="h-8 bg-accent-400 py-1 text-right text-xs font-extrabold text-gray-950 shadow outline-none ring-1 ring-gray-950/20 hover:bg-accent-500"
class="bg-accent-400 py-1 text-right text-xs font-extrabold text-gray-950 shadow outline-none ring-1 ring-gray-950/20 hover:bg-accent-500"
style="margin-left: {Math.round((spanOffset / runLength) * 100)}%; width:{Math.round(
(spanLength / runLength) * 100
)}%;"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
<script context="module" lang="ts">
import type { MetaProps } from '@storybook/addon-svelte-csf';
import { randomLogger } from '../../log.test_utils';
import Timeline from './Timeline.svelte';
export const meta: MetaProps = {
title: 'Timeline/Organisms/Timeline',
component: Timeline,
tags: ['autodocs']
tags: ['autodocs'],
args: {
log: randomLogger()
}
};
</script>

Expand Down
22 changes: 22 additions & 0 deletions log-viewer/src/lib/components/timeline/Timeline.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<script lang="ts">
import type { DebugLog } from '../../log';
import LogDurations from './LogDurations.svelte';
import SpanTree from './SpanTree.svelte';
/**
* The Debug Log you want to render
*/
export let log: DebugLog;
</script>

<!--
@component
Timeline and Tree view of the given DebugLog
-->

<div class="grid grid-cols-3 grid-rows-1">
<div class="col-span-1">
<SpanTree logs={log.logs} />
</div>
<div class="col-span-2"><LogDurations logs={log.logs} /></div>
</div>
File renamed without changes.

0 comments on commit 01289c1

Please sign in to comment.