Request Feature: Please allow a field in the API to ignore text wrapping into the horizontal bars.
RJTabassi opened this issue · comments
I have some short roadmap dwell times, but verbose descriptions. There doesn't seem to be the ability to turn off text wrapping in the API. IS it possible? Would it be possible on a line by line basis?
Thank you!
Can you please provide your sample code
Hello!
I am a huge fan of this library. I am using this library to build a nearly
300 item org wide roadmap by group and capability. The main issue I have
is text for initiatives being too long to fit inside the time bar space and
wrapping the text into the duration bars of other initiatives.
import pandas as pd
import numpy as np
from datetime import datetime
import win32com.client
from roadmapper.roadmap import Roadmap
from roadmapper.timelinemode import TimelineMode
# Excel Application Setup
excel_app = win32com.client.DispatchEx("Excel.Application")
workbook_path = 'C:\\path\\to\\your\\file.xlsx'
workbook = excel_app.workbooks.open(workbook_path)
workbook.RefreshAll()
workbook.Save()
excel_app.Quit()
# Reading and Processing Data
df = pd.read_excel(workbook_path, sheet_name='Roadmap')
df['mission_capability'] = df['Mission'] + " " + df['Capability']
def convert_to_date(date_str):
try:
return pd.to_datetime(date_str, errors='coerce').date()
except ValueError:
return np.nan
df['Current ECD'] = df['Current ECD'].apply(convert_to_date)
df['Estimated Start Date'] = df['Estimated Start
Date'].apply(convert_to_date)
current_date = datetime.today().date()
df['Status'] = np.where(df['Current ECD'] <= current_date, 'complete',
'pending')
df_filtered = df[df[['Initiative', 'Estimated Start Date', 'Current ECD',
'Mission', 'Capability']].notnull().all(axis=1)]
base_date = datetime(2023, 10, 2)
df_filtered['days_from_base'] = (df_filtered['Current ECD'] -
base_date).dt.days
df_filtered = df_filtered[df_filtered['days_from_base'] > 0]
# Roadmap Creation
roadmap = Roadmap(2500, 20000, colour_theme="BLUEMOUNTAIN",
auto_height=True)
roadmap.set_title("2023 Roadmap")
roadmap.set_timeline(TimelineMode.QUARTERLY, start="2023-10-02",
number_of_items=3)
for mission, group_df in df_filtered.groupby('mission_capability'):
group = roadmap.add_group(mission, font_size=20, text_alignment='left')
for _, row in group_df.iterrows():
if row['Status'] == 'complete':
group.add_task(row['Initiative'].strip(), row['Estimated Start
Date'], row['Current ECD'], fill_colour="#70AD47")
else:
group.add_task(row['Initiative'].strip(), row['Estimated Start
Date'], row['Current ECD'])
roadmap.draw()
roadmap.save("Roadmap.png")
…On Fri, Nov 10, 2023 at 1:05 PM CS Goh ***@***.***> wrote:
Can you please provide your sample code
—
Reply to this email directly, view it on GitHub
<#78 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFABCUSO4VNMPMYU2XDIOULYD2JLFAVCNFSM6AAAAAA7GNVGA2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMBWGQZTINBVGM>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
Thanks! I will have a look once I am back from my holiday. 😄
Hi, sorry, I can't run your code as there are some data file dependency. Can you share your Roadmap.png output file?
Closing this as I do not get further information from @RJTabassi