Skip to content

Commit 835fd6d

Browse files
committed
WIP: view.Timeline
1 parent 9a83c75 commit 835fd6d

File tree

9 files changed

+1816
-0
lines changed

9 files changed

+1816
-0
lines changed

notebooks/dev-timeline.ipynb

Lines changed: 202 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,202 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"id": "47580c59-9759-4180-8c44-4ec88f02acf7",
6+
"metadata": {},
7+
"source": [
8+
"# Dev: Timeline"
9+
]
10+
},
11+
{
12+
"cell_type": "markdown",
13+
"id": "77bd4342-a5ab-438f-8384-f5c08720ef3e",
14+
"metadata": {},
15+
"source": [
16+
"## Preamble"
17+
]
18+
},
19+
{
20+
"cell_type": "code",
21+
"execution_count": 1,
22+
"id": "1c990564-b8aa-4a21-8165-50d5cceed817",
23+
"metadata": {},
24+
"outputs": [
25+
{
26+
"name": "stdout",
27+
"output_type": "stream",
28+
"text": [
29+
"2022-02-07 18:47:41,953 INFO sqlalchemy.engine.Engine BEGIN (implicit)\n",
30+
"2022-02-07 18:47:41,954 INFO sqlalchemy.engine.Engine PRAGMA main.table_info(\"address\")\n",
31+
"2022-02-07 18:47:41,954 INFO sqlalchemy.engine.Engine [raw sql] ()\n",
32+
"2022-02-07 18:47:41,955 INFO sqlalchemy.engine.Engine PRAGMA main.table_info(\"user\")\n",
33+
"2022-02-07 18:47:41,955 INFO sqlalchemy.engine.Engine [raw sql] ()\n",
34+
"2022-02-07 18:47:41,955 INFO sqlalchemy.engine.Engine PRAGMA main.table_info(\"icloudaccount\")\n",
35+
"2022-02-07 18:47:41,955 INFO sqlalchemy.engine.Engine [raw sql] ()\n",
36+
"2022-02-07 18:47:41,956 INFO sqlalchemy.engine.Engine PRAGMA main.table_info(\"googleaccount\")\n",
37+
"2022-02-07 18:47:41,956 INFO sqlalchemy.engine.Engine [raw sql] ()\n",
38+
"2022-02-07 18:47:41,956 INFO sqlalchemy.engine.Engine PRAGMA main.table_info(\"bank\")\n",
39+
"2022-02-07 18:47:41,956 INFO sqlalchemy.engine.Engine [raw sql] ()\n",
40+
"2022-02-07 18:47:41,957 INFO sqlalchemy.engine.Engine PRAGMA main.table_info(\"bankaccount\")\n",
41+
"2022-02-07 18:47:41,957 INFO sqlalchemy.engine.Engine [raw sql] ()\n",
42+
"2022-02-07 18:47:41,957 INFO sqlalchemy.engine.Engine PRAGMA main.table_info(\"contact\")\n",
43+
"2022-02-07 18:47:41,957 INFO sqlalchemy.engine.Engine [raw sql] ()\n",
44+
"2022-02-07 18:47:41,957 INFO sqlalchemy.engine.Engine PRAGMA main.table_info(\"client\")\n",
45+
"2022-02-07 18:47:41,958 INFO sqlalchemy.engine.Engine [raw sql] ()\n",
46+
"2022-02-07 18:47:41,958 INFO sqlalchemy.engine.Engine PRAGMA main.table_info(\"contract\")\n",
47+
"2022-02-07 18:47:41,958 INFO sqlalchemy.engine.Engine [raw sql] ()\n",
48+
"2022-02-07 18:47:41,958 INFO sqlalchemy.engine.Engine PRAGMA main.table_info(\"project\")\n",
49+
"2022-02-07 18:47:41,959 INFO sqlalchemy.engine.Engine [raw sql] ()\n",
50+
"2022-02-07 18:47:41,959 INFO sqlalchemy.engine.Engine PRAGMA main.table_info(\"timetrackingitem\")\n",
51+
"2022-02-07 18:47:41,959 INFO sqlalchemy.engine.Engine [raw sql] ()\n",
52+
"2022-02-07 18:47:41,959 INFO sqlalchemy.engine.Engine PRAGMA main.table_info(\"timesheet\")\n",
53+
"2022-02-07 18:47:41,959 INFO sqlalchemy.engine.Engine [raw sql] ()\n",
54+
"2022-02-07 18:47:41,960 INFO sqlalchemy.engine.Engine PRAGMA main.table_info(\"invoice\")\n",
55+
"2022-02-07 18:47:41,960 INFO sqlalchemy.engine.Engine [raw sql] ()\n",
56+
"2022-02-07 18:47:41,960 INFO sqlalchemy.engine.Engine PRAGMA main.table_info(\"invoiceitem\")\n",
57+
"2022-02-07 18:47:41,960 INFO sqlalchemy.engine.Engine [raw sql] ()\n",
58+
"2022-02-07 18:47:41,961 INFO sqlalchemy.engine.Engine PRAGMA main.table_info(\"timelineitem\")\n",
59+
"2022-02-07 18:47:41,961 INFO sqlalchemy.engine.Engine [raw sql] ()\n",
60+
"2022-02-07 18:47:41,961 INFO sqlalchemy.engine.Engine COMMIT\n"
61+
]
62+
}
63+
],
64+
"source": [
65+
"from tuttle.view import Timeline, Event\n"
66+
]
67+
},
68+
{
69+
"cell_type": "code",
70+
"execution_count": 2,
71+
"id": "6371a18e-9000-4aec-9127-ca1a2fa9b984",
72+
"metadata": {},
73+
"outputs": [],
74+
"source": [
75+
"import datetime"
76+
]
77+
},
78+
{
79+
"cell_type": "markdown",
80+
"id": "a86338fb-f962-460e-9498-dea9e122e26c",
81+
"metadata": {},
82+
"source": [
83+
"## Test"
84+
]
85+
},
86+
{
87+
"cell_type": "code",
88+
"execution_count": 3,
89+
"id": "2fa3df44-6bbb-40ba-ac60-69aeff3de9e2",
90+
"metadata": {},
91+
"outputs": [],
92+
"source": [
93+
"my_timeline = Timeline(\n",
94+
" events=[\n",
95+
" Event(\n",
96+
" title=\"Invoice 1 due\",\n",
97+
" date=datetime.date(2022, 2, 28),\n",
98+
" description=\"invoice is due\"\n",
99+
" ),\n",
100+
" Event(\n",
101+
" title=\"Invoice 2 due\",\n",
102+
" date=datetime.date(2022, 1, 15),\n",
103+
" description=\"invoice is due\"\n",
104+
" ),\n",
105+
" ]\n",
106+
")"
107+
]
108+
},
109+
{
110+
"cell_type": "code",
111+
"execution_count": 4,
112+
"id": "e632ff64-414a-47ba-bf63-fe75194de4f7",
113+
"metadata": {},
114+
"outputs": [
115+
{
116+
"data": {
117+
"text/plain": [
118+
"Timeline(events=[Event(title='Invoice 1 due', date=datetime.date(2022, 2, 28), description='invoice is due'), Event(title='Invoice 2 due', date=datetime.date(2022, 1, 15), description='invoice is due')])"
119+
]
120+
},
121+
"execution_count": 4,
122+
"metadata": {},
123+
"output_type": "execute_result"
124+
}
125+
],
126+
"source": [
127+
"my_timeline"
128+
]
129+
},
130+
{
131+
"cell_type": "markdown",
132+
"id": "3be33a47-a13a-4aef-935a-159a41f70f29",
133+
"metadata": {},
134+
"source": [
135+
"### Rendering"
136+
]
137+
},
138+
{
139+
"cell_type": "code",
140+
"execution_count": 5,
141+
"id": "45eb4c7a-6a69-4c94-ac9e-e930bb858564",
142+
"metadata": {},
143+
"outputs": [],
144+
"source": [
145+
"from tuttle.rendering import render_timeline"
146+
]
147+
},
148+
{
149+
"cell_type": "code",
150+
"execution_count": 6,
151+
"id": "be8ae7bf-8aab-4345-b15b-a5b4f9cbcb1b",
152+
"metadata": {},
153+
"outputs": [],
154+
"source": [
155+
"from IPython.display import display, HTML, IFrame"
156+
]
157+
},
158+
{
159+
"cell_type": "code",
160+
"execution_count": 9,
161+
"id": "8f9febce-3469-4f55-b9ff-ca422391e16a",
162+
"metadata": {},
163+
"outputs": [],
164+
"source": [
165+
"\n",
166+
"render_timeline(\n",
167+
" my_timeline,\n",
168+
" out_dir=\"/Users/cls/Stack/\"\n",
169+
")\n"
170+
]
171+
},
172+
{
173+
"cell_type": "code",
174+
"execution_count": null,
175+
"id": "3004efe1-ae8b-407b-a3d3-32802ef5ed12",
176+
"metadata": {},
177+
"outputs": [],
178+
"source": []
179+
}
180+
],
181+
"metadata": {
182+
"kernelspec": {
183+
"display_name": "tuttle",
184+
"language": "python",
185+
"name": "ex"
186+
},
187+
"language_info": {
188+
"codemirror_mode": {
189+
"name": "ipython",
190+
"version": 3
191+
},
192+
"file_extension": ".py",
193+
"mimetype": "text/x-python",
194+
"name": "python",
195+
"nbconvert_exporter": "python",
196+
"pygments_lexer": "ipython3",
197+
"version": "3.9.7"
198+
}
199+
},
200+
"nbformat": 4,
201+
"nbformat_minor": 5
202+
}

templates/timeline/license.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Copyright (c) 2022 by Amy Carter (https://codepen.io/carrrter/pen/ELLmyX)
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4+
5+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6+
7+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

0 commit comments

Comments
 (0)