search
HomeWeb Front-endJS TutorialJumping Into The Deep End

For my third contribution to open source, I worked on the project ghostfolio, which is an investment portfolio management suite.

Jumping Into The Deep End ghostfolio / ghostfolio

Open Source Wealth Management Software. Angular NestJS Prisma Nx TypeScript ?

Jumping Into The Deep End

Ghostfolio

Open Source Wealth Management Software

Ghostfol.io | Live Demo | Ghostfolio Premium | FAQ | Blog | Slack | X

Jumping Into The Deep End Jumping Into The Deep End Jumping Into The Deep End Jumping Into The Deep End

Ghostfolio is an open source wealth management software built with web technology. The application empowers busy people to keep track of stocks, ETFs or cryptocurrencies and make solid, data-driven investment decisions. The software is designed for personal use in continuous operation.

Jumping Into The Deep End

Ghostfolio Premium

Our official Ghostfolio Premium cloud offering is the easiest way to get started. Due to the time it saves, this will be the best option for most people. Revenue is used to cover the costs of the hosting infrastructure and to fund ongoing development.

If you prefer to run Ghostfolio on your own infrastructure, please find further instructions in the Self-hosting section.

Why Ghostfolio?

Ghostfolio is for you if you are...

  • ? trading stocks, ETFs or cryptocurrencies on multiple platforms
  • ? pursuing a buy & hold…
View on GitHub

[Feature] Set up tooltip in treemap chart component #3808

Jumping Into The Deep End
dtslvr posted on

The goal of this issue is to set up a tooltip in the treemap chart component which is based on chart.js.

  • Pass [baseCurrency]="user?.settings?.baseCurrency" to in home-holdings.html
  • The tooltip should display valueInBaseCurrency from holdings if available along with the user's currency (baseCurrency)
  • Try to use getTooltipOptions() for the style
View on GitHub

While looking for open issues to work on on GitHub, I came across this one. I'd been wanting to step my game up and work on a feature this time, so I decided this would be a good issue to try and work on. I signed up for it without looking into it too much. I later saw it was an Angular issue, which further piqued my interest because I was curious about learning Angular.

Although I signed up for it, I wasn't able to work on it for a while - school assignments and life got in the way. A week passed, and I decided I should get to work, so I started with reading the contributing docs, and saw they used Docker. I thought "perfect, my other course teaches Docker this week, so I'm set". I forked and cloned the repo and tried installing the dependencies and instantly ran into issues - something to do with peer dependency conflicts. The app wouldn't even start even though I'd followed the instructions. This scared me off of working on it for another week.

When I tried again, I cloned my fork again, and got the app to build this time, but some tests were failing before I'd even begun. I thought to reach out in the project's Slack to ask if it was just on my end, and the maintainer responded saying the build in CI was passing. Once again, I was scared away from working on the project.

Eventually, the maintainer commented on the issue asking for an update. I decided I couldn't put it off any longer and got ready to spend a good while trying to work this out.

I pulled in changes from upstream and cloned my fork again, but the tests were still failing. When starting the app, the server would log a warning saying some imports were failing, so I decided to look into it. The project used a technology for managing the monorepo called Nx, and the issue seemed related, so I spent a while looking into what it did. They also used something called Storybook, which they mentioned how to start in the contributing doc, but didn't bother explaining what it was. I decided to check it out and found out it was for developing components by rendering them in isolation. When I started Storybook up, it wouldn't work either and would give me import errors. I spent a little while trying to debug the import issues, but then realized I could just work on my issue without dealing with them, so I decided to just ignore them and got to work.

It took me a while to figure out what I was even supposed to do and what the scope of the issue was. The original issue was fairly cryptic in hindsight despite being labelled "good first issue". I suppose different projects have different ideas for what makes a good first issue. I started by looking through the files to find the component I was supposed to work on.

I tried looking for the chart component I was supposed to work on in the UI, but it wasn't visible in it's parent component. I left a comment asking the maintainer, but then figured it out right away. I saw some initialization functions in the chart component and it's parent component, so I wrote console.log(this) inside them to see what I was working with, and that's when I realized the chart component wasn't even being rendered. I went digging through the settings in the client and found an experimental features toggle, which I figured out by looking at the HTML template for the component and seeing that it was hidden behind a conditional statement.

After I could actually see the thing I was working on, things became a bit easier. The project used chart.js for their charts, so I went to it's documentation to see how tooltips work. Since they had a helper function specifically for tooltips I thought to myself "Okay, let's see how they use tooltips in other charts in the app". I started looking at some other components that used tooltips and looking at what they had in common with the component I was working on, i.e. how they passed configuration options to the tooltip and such. I noted how they set up the tooltip in the other components and tried to replicate it, and it worked! I had a working tooltip! After two weeks! ...Which still didn't show the right data! But it was progress nevertheless! Suddenly, the issue seemed a lot more doable. Instead of being scared by the massive monorepo I was able to zero in on the exact things I needed to work on, and that was all I needed to worry about.

I struggled a bit more with trying to find out how to pass data to the tooltip. After looking closer at how the component I was copying passed data to the tooltip, I realized it wouldn't work for the one I was working on. It received and processed data in a different way than mine, which I realized when I noticed it was in apps/client/src/app/components/, while my component was in libs/ui/src/lib. I figured a component in a completely different part of the monorepo is probably designed to work differently, so I searched for other components that used tooltips, and luckily, I found one in the same directory as my component.

I initially had to turn off type safety for the parameters of the function I added to configure the tooltip, because the object I was getting the options from had properties I needed to access which weren't defined for it's type. I was going to ask the maintainer about this, but when I found a component that worked closer to mine, I realized I didn't need any parameters at all. Instead of defining parameters, they used the context object automatically passed to the label callback function on the tooltip object, so I did the same thing. Even though I didn't need a parameter anymore, I ran into a problem where other configuration options would become undefined when I tried removing the parameter. At first I wasn't sure what was going on, but it started working after a while, so I guess the compiler was just lagging behind my changes (maybe I forgot to save the file?)

So I was able to get the necessary data into the tooltip, but I still had to format it. I once again looked to the other component to see how they did it. They passed values from the context object to Number.toLocaleString() and the result was rendered in the tooltip, so I did the same thing and it came out looking nice and clean, so my PR was ready.

Feature/Set up tooltip in treemap chart component #3897

Jumping Into The Deep End
uday-rana posted on

Fixes #3808.

I based my implementation off of the tooltip in portfolio-proportion-chart.component.ts. Please let me know if you'd like any changes.

Jumping Into The Deep End

View on GitHub

I marked my PR ready for review and got feedback on some formatting changes. Turns out I should use a lot more line breaks in my code because everything was smooshed together, which I only noticed after the maintainer pointed it out.

I made the requested changes but didn't hear back for a couple days which made me nervous. Fortunately the maintainer eventually got back to me and merged the changes.

Even better, the maintainer commented saying there was a follow-up issue I could work on for adding more data to the tooltip. Since I now knew how the project was set up, knew a little bit more about Angular, and tooltips in Chart.js, this issue looked a lot easier compared to when the first one. Sure enough, this issue only took me an hour or so, and after a review that one was merged too.

[FEATURE] Extend tooltip in treemap chart component by name #3904

Jumping Into The Deep End
dtslvr posted on

The goal of this issue is to extend the tooltip in the treemap chart component by adding the name (or symbol as a fallback):

return [
  // `${name ?? symbol}`,
  // value or percentage as before
];

Get inspired by the GfPortfolioProportionChartComponent.

View on GitHub

Feature/Extend tooltip in treemap chart component by name #3907

Jumping Into The Deep End
uday-rana posted on

Fixes #3904.

This PR adds the name (and symbol as a fallback) to the label for the tooltip in GfTreemapChartComponent.

It should also be possible to display the name/symbol as the tooltip title instead if preferred, but GfPortfolioProportionChartComponent puts them in the label so I decided to keep it consistent.

Jumping Into The Deep End

View on GitHub

Working on this issue massively boosted my confidence in jumping into unknown code. Although it was incredibly stressful at first, once I focused on what I actually needed to do, I was able to accomplish my task, even though I went in with zero knowledge of Angular, or Nx, or Chart.js.

That's all for this post. I have one more pull request to work on for Hacktoberfest so expect to see another blog post soon!

The above is the detailed content of Jumping Into The Deep End. For more information, please follow other related articles on the PHP Chinese website!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Python vs. JavaScript: A Comparative Analysis for DevelopersPython vs. JavaScript: A Comparative Analysis for DevelopersMay 09, 2025 am 12:22 AM

The main difference between Python and JavaScript is the type system and application scenarios. 1. Python uses dynamic types, suitable for scientific computing and data analysis. 2. JavaScript adopts weak types and is widely used in front-end and full-stack development. The two have their own advantages in asynchronous programming and performance optimization, and should be decided according to project requirements when choosing.

Python vs. JavaScript: Choosing the Right Tool for the JobPython vs. JavaScript: Choosing the Right Tool for the JobMay 08, 2025 am 12:10 AM

Whether to choose Python or JavaScript depends on the project type: 1) Choose Python for data science and automation tasks; 2) Choose JavaScript for front-end and full-stack development. Python is favored for its powerful library in data processing and automation, while JavaScript is indispensable for its advantages in web interaction and full-stack development.

Python and JavaScript: Understanding the Strengths of EachPython and JavaScript: Understanding the Strengths of EachMay 06, 2025 am 12:15 AM

Python and JavaScript each have their own advantages, and the choice depends on project needs and personal preferences. 1. Python is easy to learn, with concise syntax, suitable for data science and back-end development, but has a slow execution speed. 2. JavaScript is everywhere in front-end development and has strong asynchronous programming capabilities. Node.js makes it suitable for full-stack development, but the syntax may be complex and error-prone.

JavaScript's Core: Is It Built on C or C  ?JavaScript's Core: Is It Built on C or C ?May 05, 2025 am 12:07 AM

JavaScriptisnotbuiltonCorC ;it'saninterpretedlanguagethatrunsonenginesoftenwritteninC .1)JavaScriptwasdesignedasalightweight,interpretedlanguageforwebbrowsers.2)EnginesevolvedfromsimpleinterpreterstoJITcompilers,typicallyinC ,improvingperformance.

JavaScript Applications: From Front-End to Back-EndJavaScript Applications: From Front-End to Back-EndMay 04, 2025 am 12:12 AM

JavaScript can be used for front-end and back-end development. The front-end enhances the user experience through DOM operations, and the back-end handles server tasks through Node.js. 1. Front-end example: Change the content of the web page text. 2. Backend example: Create a Node.js server.

Python vs. JavaScript: Which Language Should You Learn?Python vs. JavaScript: Which Language Should You Learn?May 03, 2025 am 12:10 AM

Choosing Python or JavaScript should be based on career development, learning curve and ecosystem: 1) Career development: Python is suitable for data science and back-end development, while JavaScript is suitable for front-end and full-stack development. 2) Learning curve: Python syntax is concise and suitable for beginners; JavaScript syntax is flexible. 3) Ecosystem: Python has rich scientific computing libraries, and JavaScript has a powerful front-end framework.

JavaScript Frameworks: Powering Modern Web DevelopmentJavaScript Frameworks: Powering Modern Web DevelopmentMay 02, 2025 am 12:04 AM

The power of the JavaScript framework lies in simplifying development, improving user experience and application performance. When choosing a framework, consider: 1. Project size and complexity, 2. Team experience, 3. Ecosystem and community support.

The Relationship Between JavaScript, C  , and BrowsersThe Relationship Between JavaScript, C , and BrowsersMay 01, 2025 am 12:06 AM

Introduction I know you may find it strange, what exactly does JavaScript, C and browser have to do? They seem to be unrelated, but in fact, they play a very important role in modern web development. Today we will discuss the close connection between these three. Through this article, you will learn how JavaScript runs in the browser, the role of C in the browser engine, and how they work together to drive rendering and interaction of web pages. We all know the relationship between JavaScript and browser. JavaScript is the core language of front-end development. It runs directly in the browser, making web pages vivid and interesting. Have you ever wondered why JavaScr

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),