Creating a Rich Text Editor in React JS

Ath Tripathi
Updated on 29-Sep-2021 08:19:57

4K+ Views

In this article, we are going to build a text editor in React JS, where users can edit their text online. Many websites offer this feature. A text editor is used to edit plain text files. Text editors differ from Word processors, such as Microsoft Word or WordPerfect, in that they do not add additional formatting information to documents.ExampleFirst create a React project: −npx create-react-app tutorialpurposeNow go to the project directory −cd tutorialpurposeDownload and install the following packages −npm install --save react-draft-wysiwyg draft-jsWe will use this package to include a "wysiwyg" editor inside our React project. draft-js will be used ... Read More

Creating a Map in React JS Without Using Third Party API

Ath Tripathi
Updated on 29-Sep-2021 08:16:48

636 Views

In this article, we are going to create a React app which will show a map without any third-party API. You can edit the map's width and height, add markers to it, and do many more amazing things. We will use the pigeon-maps package to create the map. So, let's get started.ExampleFirst create a React project −npx create-react-app tutorialpurposeNow go to the project directory −cd tutorialpurposeDownload the install the pigeon-maps package −npm install --save pigeon-mapsWe will use this package to add default maps which are downloaded with library inside the React project.Add the following lines of code in App.js −import ... Read More

Creating an Airbnb Rheostat Slider in React JS

Ath Tripathi
Updated on 29-Sep-2021 08:11:57

1K+ Views

In this article, we will see how to create an Airbnb rheostat. Rheostat is a www, mobile, and accessible slider component built with React. Rheostat is a scrollbar where you can slide the pointer to select some values or decide a range of values.ExampleFirst create a React project −npx create-react-app tutorialpurposeGo to the project directory −cd tutorialpurposeDownload and install the rheostat package −npm install rheostatWe can use this package to include premade rheostats with default functions inside a React project.Insert the following lines of code in App.js −import React from "react"; import Rheostat from "rheostat"; import "rheostat/initialize"; import "./App.css"; export ... Read More

Creating a Plane in React Using React Three Fiber

Ath Tripathi
Updated on 29-Sep-2021 08:03:09

4K+ Views

In this article, we will see how to create a plane in React using React-Three-Fiber. Planes are widely used shapes in 3D rendering. We will create a 2D plane for now, but you can add orbital controls in it to make it 3D. We will also use lighting and different colors. Let's get started.ExampleFirst install the following package −npm i --save @react-three/fiber threethreejs and react-three/fiber will be used to add webGL renderer to the website and three-fiber will be used to connect threejs and React.Add the following lines of code in App.js −import { Canvas } from "@react-three/fiber"; export ... Read More

Compute First of Group Values in a Pandas DataFrame

AmitDiwan
Updated on 29-Sep-2021 07:58:31

197 Views

To compute first of group values, use the groupby.first() method. At first, import the required library with an alias −import pandas as pd;Create a DataFrame with 3 columns −dataFrame = pd.DataFrame(    {       "Car": ['BMW', 'Lexus', 'BMW', 'Tesla', 'Lexus', 'Tesla'], "Place": ['Delhi', 'Bangalore', 'Pune', 'Punjab', 'Chandigarh', 'Mumbai'], "Units": [100, 150, 50, 80, 110, 90] } )Now, group DataFrame by a column −groupDF = dataFrame.groupby("Car") Compute first of group values and resetting index −res = groupDF.first() res = res.reset_index()ExampleFollowing is the complete code − import pandas as pd; dataFrame = pd.DataFrame(    {   ... Read More

Creating a Customizable Modal in React JS

Ath Tripathi
Updated on 29-Sep-2021 07:58:30

605 Views

In this article, we will see how to make a customizable modal in React JS with multiple buttons which can be used in many types of projects like on landing pages or travel websites. A modal is a message box that is displayed on top of the screen. We can use Modals as a subscription box; we can also add animation to a Modal using CSS.ExampleFirst create a React project −npx create-react-app tutorialpurposeGo to the project directory −cd tutorialpurposeDownload and install the react-modal package −npm i --save react-modalWe can use this package to add simple premade modals inside any React ... Read More

Creating Particle Animation in React JS

Ath Tripathi
Updated on 29-Sep-2021 07:56:41

1K+ Views

"Particle animation" is a technique in game physics, motion graphics, and computer graphics that uses many minute sprites, 3D models, or other graphic objects to simulate certain kinds of "fuzzy" phenomena.In this article, we will see how to make a popular particle animation in React JS. We will do this using a third-party package called "react-tsparticles".First create a React project −npx create-react-app tutorialpurposeGo to the project directory −cd tutorialpurposeExampleDownload and install the "react-tsparticles" package −npm install react-tsparticles reactWe will use this package to add default particle animations with different styling elements. You can also add id and different options for ... Read More

Extract Value Names and Counts from Value Counts in Pandas

AmitDiwan
Updated on 29-Sep-2021 07:43:15

427 Views

To extract the value names and counts, let us first create a DataFrame with 4 columns −dataFrame = pd.DataFrame({"Car": ['BMW', 'Mustang', 'Tesla', 'Mustang', 'Mercedes', 'Tesla', 'Audi'], "Cubic Capacity": [2000, 1800, 1500, 2500, 2200, 3000, 2000], "Reg Price": [7000, 1500, 5000, 8000, 9000, 6000, 1500], "Units Sold": [ 200, 120, 150, 120, 210, 250, 220] })Fetch the value names and count for a specific column Car −res = dataFrame['Car'].value_counts() Fetch the value names and count for a specific column Units Sold −res = dataFrame['Units Sold'].value_counts()ExampleFollowing is the complete code −import pandas as pd # creating dataframe dataFrame = pd.DataFrame({"Car": ['BMW', ... Read More

Merge DataFrame with One-to-Many Relation in Python Pandas

AmitDiwan
Updated on 29-Sep-2021 07:35:38

3K+ Views

To merge Pandas DataFrame, use the merge() function. The one-to-many relation is implemented on both the DataFrames by setting under the “validate” parameter of the merge() function i.e. −validate = “one-to-many” or validate = “1:m”The one-to-many relation checks if merge keys are unique in left dataset.At first, let us create our 1st DataFrame −dataFrame1 = pd.DataFrame(    {       "Car": ['BMW', 'Lexus', 'Audi', 'Mustang', 'Bentley', 'Jaguar'], "Units": [100, 150, 110, 80, 110, 90] } )Now, let us create our 2nd DataFrame −dataFrame2 = pd.DataFrame(    {       "Car": ['BMW', 'Lexus', 'Tesla', 'Mustang', 'Mercedes', ... Read More

Create Excel-like Data Grid in React JS

Ath Tripathi
Updated on 29-Sep-2021 07:34:58

1K+ Views

In this article, we will see how to create an Excel-like data grid in React JS frontend. We will use a third-party package for this, which is called react-data-grid. This is a useful package if you are working with data and want to make a dashboard application.First create a react project −npx create-react-app tutorialpurposeGo to the project directory −cd tutorialpurpose ExampleDownload and install the react-data-grid package −npm i --save react-data-gridWe can use this package to add default styled grid tables or you can say data grids which are premade.Add the following lines of code in App.js −import DataGrid from "react-data-grid"; ... Read More

Advertisements