Photo by Markus Spiske on Unsplash

The other day I was trying to understand potential security issues with exposing secrets or tokens in the url, and how OAuth implementations protect against that. Turns out, there are a few legitimate concerns, and a few patterns in OAuth that specify how to send tokens securely.

When the browser (or any other client) makes a request to a server, there are some intermediate servers which your request goes through, and they can see the URL, unless you use https. These can be any intermediate routers, CDNs, reverse proxies, etc. Some of these might be malicious and if they can…


Photo by Markus Winkler on Unsplash
<button
...
onClick={() => this.props.handleClick()}
/>

Usually when I see code like this in a PR, I suggest the dev to change it to:

<button
...
onClick={this.props.handleClick}
/>

because of unnecessary anonymous function being created in every render, which although isn’t as big a deal, but why not fix it if you easily can?

Though I have been doing this for quite some time now, it was only recently that I realized that my understanding about both these snippets being functionally similar, is a bit flawed, though it works as expected in most of the cases. …


Most charts usually require some kind of reference line to compare the current plotted data against. For example, a budget chart can have a reference line for 70% of the budget, to display when the expenses went over the prescribed limit and another reference line for 100% of the budget, Or , a chart showing the monthly rainfall in cm can have a reference line for average rainfall in cm to show in which months the rainfall was more than average. …


As we have already seen here, Recharts allows you to render any svg element as a child element of a chart container and only accepts a svg element when customizing Labels or ticks and other customizable elements (with the exception of Tooltip, as Tooltip is rendered outside the svg chart, so it can accept regular html), but there are a lot of things that are just way easier to render with html. svg allows this using the foreignObject svg element and since Recharts can render any svg elements, Recharts allows this as well. …


The top level charts in Recharts act as a container for other elements which can be rendered inside it. Some examples are LineChart, BarChart. These charts act as top level containers for other elements like Line, Bar, Tooltip, ReferenceLine, ReferenceDot, XAxis, etc. …


In Recharts, you provide data to the top level container, and on appropriate children you specify the key from which that particular child should get its data, using the prop named dataKey. This is only applicable for components that actually make use of this data, like Line or XAxis, YAxis, but does not make sense for components that do not need this whole data. For example, ReferenceArea, ReferenceLine etc only need some slice of this data, which does not require the same mechanism as dataKey. For these components that data is passed on or handled by Recharts internally.

Accessing data using dataKey:

Passing…


An animated circle, or another animated shape, is generally used in charts to attract user attention, to entice user to click or hover on something. Some shapes and animations are much easier to achieve in css, and other complex animations and shapes can be easier to achieve in svg. But when working with a charting library, it is much more important to understand which of these css or svg animations can be integrated well with the library api, or whether the library provides another in-built way to achieve the required functionality.

Let’s try to create a pulsating circle with Recharts…


Like any other charting library, Recharts allows you to work with line series data. A line chart has a lot of varied use cases. A very basic example is using a line series chart to show progress of something over time, like, how sales of smartphones has increased over the years. It is very easy to create a simple line chart out of the box in Recharts.

A simple static line chart is usually never enough for our data visualization needs. You would probably need to show some extra information like reference lines on the chart to mark important…


A reference area or highlighted area in a chart, as the name suggests, can be used to highlight some important information in the chart. This can, for example, be used to mark a period of decline in sales of a commodity, and provide extra context on hover or other interactions.

Recharts provides an implementation of ReferenceArea which has a fairly easy API and also a fairly convenient customization API using the shape prop.

A basic example:

Also note that:

  • if you only specify x1; x2 would be extrapolated to the end of domain
  • if you only specify x2; x1…


Since a long time, like any mature team, we have wanted to setup a performance measurement pipeline for our project. Some of the existing tooling that we explored related to this were webpagetest, lighthouse-ci, pagespeed insights API.

We figured out that webpagetest has an api, and provides cloud provider specific virtual machine images to setup your own private instances for server and client, where the server can orchestrate clients’ lifecycle and run tests on them. …

Gaurav Gupta

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store