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

Table: corporate bonds and listed equity bold #92

Open
MonikaFu opened this issue Nov 29, 2024 · 4 comments
Open

Table: corporate bonds and listed equity bold #92

MonikaFu opened this issue Nov 29, 2024 · 4 comments
Labels
ADO Also Tracked on Azure DevOps styling

Comments

@MonikaFu
Copy link
Contributor

MonikaFu commented Nov 29, 2024

They are the only assets included in PACTA analysis so it makes sense to draw more attention to them. Maybe also bold 'Included in the analysis' column for them

image

AB#12277

@MonikaFu MonikaFu added ADO Also Tracked on Azure DevOps styling labels Nov 29, 2024
@cjyetman
Copy link
Member

cjyetman commented Dec 3, 2024

This one I think is more complicated than it may seem.

There are already column variables that are used to style columns all at once

var columnsText = typeof opts.columnsText === 'undefined' ? [1, 6] : opts.columnsText,
columnsNumeric = typeof opts.columnsNumeric === 'undefined' ? [2, 5] : opts.columnsNumeric,
columnsPercent = typeof opts.columnsPercent === 'undefined' ? [3] : opts.columnsPercent,
columnsShortText = typeof opts.columnsShortText === 'undefined' ? [4] : opts.columnsShortText,
columnValueBreakdown =
typeof opts.columnValueBreakdown === 'undefined' ? 5 : opts.columnValueBreakdown,
columnToMergeHeaderWithContent =
typeof opts.columnToMergeHeaderWithContent === 'undefined'
? 5
: opts.columnToMergeHeaderWithContent,
columnToMergeHeaderNoContent =
typeof opts.columnToMergeHeaderNoContent === 'undefined'
? 6
: opts.columnToMergeHeaderNoContent;

But in this case we're interested in rows (depending on how you interpret the intent here). I interpret the intent as parts of the Equity and Bonds rows are made bold, but not all of it, so then it's not just rows either but particular cells. In which case, an easy solution would be to take the first 2 rows by index (maybe 3? not clear to me if the Equity via funds line should be included) and apply the styling there.... but, I think it's possible (and based on my testing in workflow.pacta.dashboard, it is) that the data does not include Bonds and/or Equity, in which case you can't rely on just the index, you'd have to capture the text in one of the cells and test whether it's "Corporate Bonds" or "Listed Equity". If you want to include formatting on the "via Funds" line/s of Bonds or Equity, then you have to simultaneously test two rows, one for either "Corporate Bonds" or "Listed Equity" in the first element, and the 2nd for "Via a Fund" in the last element (so that you don't accidentally style a "Via a Fund" row from e.g. "Other Asset Classes".

If you figure that out, you want to add a D3 styling command somewhere in here that targets specifically the cells you want, something like

.style('font-weight', (d, i) => d.somthing == something.Im.looking.for ? "bold" : "normal")

var rows = tbody.selectAll('tr').data(data).enter().append('tr');
rows
.selectAll('td')
.data((row) => {
return columns.map((column) => {
return { value: row[column] };
});
})
.enter()
.append('td')
.html((d) => d.value)
.attr('border', 'none')
.style('text-align', 'left');

@jdhoffa
Copy link
Member

jdhoffa commented Dec 3, 2024

One hesitation against going the "select by row ID" approach, is that I don't think it's certain the row 1 and 2 always indicate EQ and CB.

If there is 0 CB in the portfolio for example.

@jdhoffa
Copy link
Member

jdhoffa commented Dec 3, 2024

Thanks for looking into this @cjyetman
Given the complexity of the solution (and the relatively low impact of the change in the final dashboard), I suggest we deprioritize this.

I will unassign you now.

@cjyetman
Copy link
Member

cjyetman commented Dec 3, 2024

One hesitation against going the "select by row ID" approach, is that I don't think it's certain the row 1 and 2 always indicate EQ and CB.

If there is 0 CB in the portfolio for example.

exactly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ADO Also Tracked on Azure DevOps styling
Projects
None yet
Development

No branches or pull requests

3 participants