Skip to content
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

V.0.2.0 dev branch #9

Merged
merged 50 commits into from
Dec 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
99eaf83
Fixed roadmap colour in DEFAULT theme
csgoh Dec 10, 2022
71224e9
Replace "Now" with down arrow
csgoh Dec 10, 2022
d02784c
Fix parallel tasks alignment and milestone display issues
csgoh Dec 10, 2022
ee2bb8c
added new demo roadmap
csgoh Dec 10, 2022
a0ad440
Added SubTitle
csgoh Dec 10, 2022
25f9f25
Fixed ORANGEPEEL colour settings
csgoh Dec 11, 2022
a24c3d7
Added grey vertical lines
csgoh Dec 11, 2022
1bfc223
Auto resize surface
csgoh Dec 11, 2022
adc4a08
Updated to demo auto_height feature
csgoh Dec 11, 2022
fa254ac
change default font size from 12 to 13
csgoh Dec 11, 2022
8913387
fixed font size not set correctly
csgoh Dec 11, 2022
a317852
test updated
csgoh Dec 11, 2022
915ccfc
test text distortion issue
csgoh Dec 11, 2022
17033a9
In the process of migrating to Pillow library
csgoh Dec 13, 2022
5e0c5c7
Replace PyCairo with Pillow
chengsoongoh Dec 16, 2022
ba8f455
Add 1 px to the vertical line starting y pos
csgoh Dec 16, 2022
f7a3414
renamed PyCairo text to Pillow in the comments
csgoh Dec 16, 2022
1756762
set vertical lines y pos to same as timeline y pos
csgoh Dec 16, 2022
b18d598
added VSCounter to exclusion list
csgoh Dec 16, 2022
1d79755
remove commented code
csgoh Dec 17, 2022
d6a706c
removed commented code
csgoh Dec 17, 2022
4184b64
Initial version
csgoh Dec 17, 2022
460ad64
Added "Year" group to the timeline
csgoh Dec 17, 2022
1a040e4
Initial Version
csgoh Dec 18, 2022
840d697
Fixed tasks alignment issue
csgoh Dec 18, 2022
9a268ba
Fixed task alignment issue
csgoh Dec 18, 2022
3e7b969
Implemented timelineitem group function
csgoh Dec 18, 2022
c979ca2
Added elapsed time function
csgoh Dec 18, 2022
ac3fb3e
added gap constant variables
csgoh Dec 18, 2022
3997b85
Updated to test roadmapper
csgoh Dec 18, 2022
6fd29a2
Arial Unicode true type font
csgoh Dec 18, 2022
b61e406
Add "Arialuni.ttf"
csgoh Dec 18, 2022
e9daaf8
Add chinese roadmap
csgoh Dec 18, 2022
f8f7d25
Updates
chengsoongoh Dec 19, 2022
a19353d
set right_margin back to 30
chengsoongoh Dec 19, 2022
c0804e3
Fixed timeline alignment problem
chengsoongoh Dec 19, 2022
6a83a7f
Updated to test roadmapper
chengsoongoh Dec 19, 2022
76432d2
Fixed marker show incorrectly
chengsoongoh Dec 19, 2022
dd55db3
Updated to test marker
chengsoongoh Dec 19, 2022
5b2a9bb
added exclusion list
chengsoongoh Dec 21, 2022
a8fe35f
changed to use pytest
chengsoongoh Dec 21, 2022
859476c
gallery output
chengsoongoh Dec 21, 2022
c2cdf53
Fixed weekly index issue
chengsoongoh Dec 21, 2022
ff822d6
renamed to test_*
chengsoongoh Dec 21, 2022
69e949d
Fixed DEFAULT theme marker font colour issue
chengsoongoh Dec 21, 2022
1728884
Complete initial version
chengsoongoh Dec 21, 2022
39e2949
Generated roadmap images for gallery
chengsoongoh Dec 21, 2022
4538ee6
Clean up code and remove comments
chengsoongoh Dec 21, 2022
cb46613
Updated deploy config files
chengsoongoh Dec 21, 2022
5820737
Renamed
chengsoongoh Dec 21, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ reference/
pwk.py
pwk_roadmap.png
temp/
*.png
src/*.png
src/test/*.png
.VSCodeCounter/

# C extensions
*.so
Expand Down
Binary file added ARIALUNI.TTF
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/gallery/gallery-DEFAULT-halfyearly.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/gallery/gallery-DEFAULT-monthly.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/gallery/gallery-DEFAULT-quarterly.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/gallery/gallery-DEFAULT-weekly.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/gallery/gallery-DEFAULT-yearly.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/gallery/gallery-GREENTURTLE-monthly.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/gallery/gallery-GREYWOOF-monthly.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/gallery/gallery-ORANGEPEEL-monthly.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/gallery/gallery-marker-monthly.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/gallery/gallery-sample-01.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"

8 changes: 4 additions & 4 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
[metadata]
name = roadmapper
version = 0.1.1
version = 0.2.0
authors = CS Goh
description = Roadmapper. A Roadmap-as-Code (RaC) tool for generating a roadmap by using python code
long_description = file: README.md
long_description_content_type = text/markdown
readme = README.md
requires-python = ">=3.10"
classifiers =
Programming Language :: Python :: 3
Programming Language :: Python :: 3.10
License :: OSI Approved :: MIT License
Operating System :: OS Independent
Development Status :: 5 - Production/Stable


[options]
install_requires =
pycairo >= 1.21.0
colour >= 0.1.5
Pillow >= 9.3.0
python-dateutil >= 2.8.2
package_dir =
=src
Expand Down
216 changes: 157 additions & 59 deletions src/demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,16 +110,22 @@ def demo03(

def colour_theme_demo(
mode: TimelineMode = TimelineMode.MONTHLY,
start_date: str = "2022-11-01",
start_date: str = "2022-12-01",
number_of_items: int = 12,
show_generic_dates: bool = False,
file_name: str = "demo01.png",
colour_theme: str = "DEFAULT",
) -> None:
roadmap = Roadmap(1200, 512, colour_theme=colour_theme, show_marker=True)
roadmap.set_title("My Demo Roadmap!!!")
roadmap.set_timeline(mode, start_date, number_of_items)
roadmap = Roadmap(
1200, 1000, auto_height=True, colour_theme=colour_theme, show_marker=True
)
roadmap.set_title("SAMPLE ROADMAP 2022/2023")
roadmap.set_subtitle("ABC Corporation")
roadmap.set_timeline(
mode, start_date, number_of_items, show_generic_dates=show_generic_dates
)

group = roadmap.add_group("Core Product Work Stream")
group = roadmap.add_group("Core Product Work Stream", text_alignment="left")
task = group.add_task("Base Functionality", "2022-11-01", "2023-10-31")
task.add_milestone("v.1.0", "2023-02-15")
task.add_milestone("v.1.1", "2023-08-01")
Expand All @@ -129,11 +135,12 @@ def colour_theme_demo(
task = group.add_task("Showcase #1", "2023-03-01", "2023-05-07")
task.add_parallel_task("Showcase #2", "2023-06-01", "2023-08-07")

group = roadmap.add_group("Mobility Work Stream")
group = roadmap.add_group("Mobility Work Stream", text_alignment="left")
group.add_task("Mobile App Development", "2023-02-01", "2024-12-07")

roadmap.set_footer("Generated by Roadmapper")
roadmap.set_footer("Updated on " + datetime.now().strftime("%Y-%m-%d"))
roadmap.draw()

roadmap.save(file_name)


Expand All @@ -145,7 +152,7 @@ def generic_date_test(
file_name: str = "demo01.png",
colour_theme: str = "DEFAULT",
) -> None:
roadmap = Roadmap(4400, 512, colour_theme=colour_theme, show_marker=True)
roadmap = Roadmap(4400, 2000, colour_theme=colour_theme, show_marker=True)
roadmap.set_title("My Demo Roadmap!!!")
roadmap.set_timeline(
mode, start_date, number_of_items, show_generic_dates=show_generic_dates
Expand All @@ -169,62 +176,153 @@ def generic_date_test(
roadmap.save(file_name)


# demo01(file_name="demo01.png")
# demo01(TimelineMode.WEEKLY, "2023-02-01", 16, "demo02.png")
# demo01(TimelineMode.QUARTERLY, "2023-02-01", 4, "demo03.png")
# demo01(TimelineMode.HALF_YEARLY, "2023-02-01", 3, "demo04.png")
# demo01(TimelineMode.YEARLY, "2023-02-01", 2, "demo05.png")
def parallel_task_demo(
mode: TimelineMode = TimelineMode.MONTHLY,
start_date: str = "2022-12-01",
number_of_items: int = 14,
file_name: str = "demo01.png",
colour_theme: str = "DEFAULT",
) -> None:
roadmap = Roadmap(
1200,
612,
auto_height=False,
colour_theme=colour_theme,
show_marker=True,
)
roadmap.set_title("ROADMAP EXAMPLE 2022/2023")
roadmap.set_subtitle("This is a subtitle")
roadmap.set_timeline(
mode,
start_date,
number_of_items,
show_generic_dates=False,
)

group = roadmap.add_group("TBCore Product Work Stream")

task = group.add_task("Base Functionality", "2022-11-01", "2023-01-31")
parellel_task = task.add_parallel_task("Enhancements", "2023-02-15", "2024-03-31")
parellel_task.add_milestone("v.2.0", "2023-04-30")

task = group.add_task("Showcase #1", "2023-01-01", "2023-01-31")
parellel_task = task.add_parallel_task("Showcase #2", "2023-02-02", "2023-03-15")
parellel_task.add_milestone("v.2.0", "2023-04-15")

roadmap.set_footer("Author: CS Goh " + datetime.now().strftime("%Y-%m-%d"))
roadmap.draw()
roadmap.save(file_name)


# # demo01(file_name="demo01.png")
# # demo01(TimelineMode.WEEKLY, "2023-02-01", 16, "demo02.png")
# # demo01(TimelineMode.QUARTERLY, "2023-02-01", 4, "demo03.png")
# # demo01(TimelineMode.HALF_YEARLY, "2023-02-01", 3, "demo04.png")
# # demo01(TimelineMode.YEARLY, "2023-02-01", 2, "demo05.png")

# demo02_barestyle(file_name="demo01.png")
# demo02_barestyle(TimelineMode.WEEKLY, "2023-02-01", 16, "demo02.png")
# demo02_barestyle(TimelineMode.QUARTERLY, "2023-02-01", 4, "demo03.png")
# demo02_barestyle(TimelineMode.HALF_YEARLY, "2023-02-01", 3, "demo04.png")
# demo02_barestyle(TimelineMode.YEARLY, "2023-02-01", 2, "demo05.png")
# # demo02_barestyle(file_name="demo01.png")
# # demo02_barestyle(TimelineMode.WEEKLY, "2023-02-01", 16, "demo02.png")
# # demo02_barestyle(TimelineMode.QUARTERLY, "2023-02-01", 4, "demo03.png")
# # demo02_barestyle(TimelineMode.HALF_YEARLY, "2023-02-01", 3, "demo04.png")
# # demo02_barestyle(TimelineMode.YEARLY, "2023-02-01", 2, "demo05.png")

# colour_theme_demo(file_name="demo-colour-default.png", colour_theme="DEFAULT")
# colour_theme_demo(file_name="demo-colour-GREYWOOF.png", colour_theme="GREYWOOF")
# colour_theme_demo(file_name="demo-colour-BLUEMOUNTAIN.png", colour_theme="BLUEMOUNTAIN")
# colour_theme_demo(file_name="demo-colour-ORANGEPEEL.png", colour_theme="ORANGEPEEL")
# colour_theme_demo(file_name="demo-colour-GREENTURTLE.png", colour_theme="GREENTURTLE")

show_generic_dates = False

generic_date_test(
file_name="demo-weekly.png",
mode=TimelineMode.WEEKLY,
start_date="2022-11-01",
number_of_items=55,
show_generic_dates=show_generic_dates,
)

generic_date_test(
file_name="demo-monthly.png",
mode=TimelineMode.MONTHLY,
start_date="2022-11-01",
number_of_items=55,
show_generic_dates=show_generic_dates,
)

generic_date_test(
file_name="demo-quarterly.png",
mode=TimelineMode.QUARTERLY,
start_date="2022-11-01",
number_of_items=55,
show_generic_dates=show_generic_dates,
)

generic_date_test(
file_name="demo-half-yearly.png",
mode=TimelineMode.HALF_YEARLY,
start_date="2022-11-01",
number_of_items=12,
show_generic_dates=show_generic_dates,
)

generic_date_test(
file_name="demo-yearly.png",
mode=TimelineMode.YEARLY,
start_date="2022-11-01",
number_of_items=12,
show_generic_dates=show_generic_dates,
)
show_generic_dates = True

### Problematic test case - To check
# colour_theme_demo(
# file_name="demo-colour-GREENTURTLE-weekly.png",
# colour_theme="GREENTURTLE",
# mode=TimelineMode.WEEKLY,
# number_of_items=53,
# show_generic_dates=show_generic_dates,
# )

# colour_theme_demo(
# file_name="demo-colour-GREENTURTLE-monthly-gen.png",
# colour_theme="GREENTURTLE",
# mode=TimelineMode.MONTHLY,
# number_of_items=14,
# show_generic_dates=show_generic_dates,
# )
# show_generic_dates = False
# colour_theme_demo(
# file_name="demo-colour-GREENTURTLE-monthly.png",
# colour_theme="GREENTURTLE",
# mode=TimelineMode.MONTHLY,
# number_of_items=14,
# show_generic_dates=show_generic_dates,
# )
# show_generic_dates = True
# colour_theme_demo(
# file_name="demo-colour-GREENTURTLE-quarter.png",
# colour_theme="GREENTURTLE",
# mode=TimelineMode.QUARTERLY,
# number_of_items=6,
# show_generic_dates=show_generic_dates,
# )

# colour_theme_demo(
# file_name="demo-colour-GREENTURTLE-halfyearly.png",
# colour_theme="GREENTURTLE",
# mode=TimelineMode.HALF_YEARLY,
# number_of_items=6,
# show_generic_dates=show_generic_dates,
# )

# colour_theme_demo(
# file_name="demo-colour-GREENTURTLE-yearly.png",
# colour_theme="GREENTURTLE",
# mode=TimelineMode.YEARLY,
# number_of_items=4,
# show_generic_dates=show_generic_dates,
# )


# generic_date_test(
# file_name="demo-weekly.png",
# mode=TimelineMode.WEEKLY,
# start_date="2022-11-01",
# number_of_items=55,
# show_generic_dates=show_generic_dates,
# )

# generic_date_test(
# file_name="demo-monthly.png",
# mode=TimelineMode.MONTHLY,
# start_date="2022-11-01",
# number_of_items=55,
# show_generic_dates=show_generic_dates,
# )

# generic_date_test(
# file_name="demo-quarterly.png",
# mode=TimelineMode.QUARTERLY,
# start_date="2022-11-01",
# number_of_items=55,
# show_generic_dates=show_generic_dates,
# )

# generic_date_test(
# file_name="demo-half-yearly.png",
# mode=TimelineMode.HALF_YEARLY,
# start_date="2022-11-01",
# number_of_items=12,
# show_generic_dates=show_generic_dates,
# )

# generic_date_test(
# file_name="demo-yearly.png",
# mode=TimelineMode.YEARLY,
# start_date="2022-11-01",
# number_of_items=12,
# show_generic_dates=show_generic_dates,
# )


parallel_task_demo(file_name="parallel-demo01.png")
Loading