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

feat(SmilesDrawer): add SmilesDrawer component #5073

Merged
merged 7 commits into from
Jan 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/BootstrapBlazor.Server/BootstrapBlazor.Server.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
<PackageReference Include="BootstrapBlazor.Player" Version="9.0.0" />
<PackageReference Include="BootstrapBlazor.RDKit" Version="9.0.2" />
<PackageReference Include="BootstrapBlazor.SignaturePad" Version="9.0.0" />
<PackageReference Include="BootstrapBlazor.SmilesDrawer" Version="9.0.0" />
<PackageReference Include="BootstrapBlazor.Sortable" Version="9.0.1" />
<PackageReference Include="BootstrapBlazor.Splitting" Version="9.0.1" />
<PackageReference Include="BootstrapBlazor.SvgEditor" Version="9.0.2" />
Expand Down
23 changes: 23 additions & 0 deletions src/BootstrapBlazor.Server/Components/Samples/SmilesDrawers.razor
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
@page "/smiles-drawer"
@inject IStringLocalizer<SmilesDrawers> Localizer

<h3>@Localizer["SmilesDrawerTitle"]</h3>

<h4>@Localizer["SmilesDrawerDescription"]</h4>

<PackageTips Name="BootstrapBlazor.SmilesDrawer" />

<DemoBlock Title="@Localizer["SmilesDrawerNormalTitle"]"
Introduction="@Localizer["SmilesDrawerNormalIntro"]"
Name="Normal">
<SmilesDrawer Smiles="CC(=O)Oc1ccccc1C(=O)O"></SmilesDrawer>
</DemoBlock>

<DemoBlock Title="@Localizer["SmilesDrawerSizeTitle"]"
Introduction="@Localizer["SmilesDrawerSizeIntro"]"
Name="Size">
<section ignore>
<Button Text="Update Size" OnClick="OnClickUpdateSize"></Button>
</section>
<SmilesDrawer Smiles="CC(=O)Oc1ccccc1C(=O)O" Options="_options"></SmilesDrawer>
</DemoBlock>
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the Apache 2.0 License
// See the LICENSE file in the project root for more information.
// Maintainer: Argo Zhang(argo@live.ca) Website: https://www.blazor.zone

namespace BootstrapBlazor.Server.Components.Samples;

/// <summary>
/// SmileDrawer 组件示例
/// </summary>
public partial class SmilesDrawers
{
private SmilesDrawerOptions _options = new() { Theme = "light", Width = 120, Height = 120 };

private void OnClickUpdateSize()
{
_options = new SmilesDrawerOptions { Theme = "light", Width = 200, Height = 200 };
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -708,6 +708,11 @@ void AddData(DemoMenuItem item)
Url = "segmented"
},
new()
{
Text = Localizer["SmilesDrawer"],
Url = "smiles-drawer"
},
new()
{
Text = Localizer["SignaturePad"],
Url = "signature-pad",
Expand Down
11 changes: 10 additions & 1 deletion src/BootstrapBlazor.Server/Locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -4779,7 +4779,8 @@
"SortableList": "SortableList",
"WinBox": "WinBox",
"Player": "Player",
"RDKit": "RDKit"
"RDKit": "RDKit",
"SmilesDrawer": "SmilesDrawer"
},
"BootstrapBlazor.Server.Components.Samples.Table.TablesHeader": {
"TablesHeaderTitle": "Header grouping function",
Expand Down Expand Up @@ -6849,5 +6850,13 @@
"RDKitSmartsLabel": "Show Smarts",
"RDKitSizeTitle": "Size",
"RDKitSizeIntro": "Set the width and height of the molecular formula by setting the <code>Width</code> and <code>Height</code> values"
},
"BootstrapBlazor.Server.Components.Samples.SmilesDrawers": {
"SmilesDrawerTitle": "SmilesDrawer",
"SmilesDrawerDescription": "A small, highly performant JavaScript component for parsing and drawing SMILES strings",
"SmilesDrawerNormalTitle": "Basic usage",
"SmilesDrawerNormalIntro": "Set the molecular formula through <code>Smiles</code> and draw the component",
"SmilesDrawerSizeTitle": "Size",
"SmilesDrawerSizeIntro": "Set the width and height of the molecular formula by setting the <code>Width</code> and <code>Height</code> values"
}
}
13 changes: 11 additions & 2 deletions src/BootstrapBlazor.Server/Locales/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -4779,7 +4779,8 @@
"SortableList": "拖拽组件 SortableList",
"WinBox": "窗口 WinBox",
"Player": "播放器 Player",
"RDKit": "分子图组件 RDKit"
"RDKit": "分子式组件 RDKit",
"SmilesDrawer": "分子式组件 SmilesDrawer"
},
"BootstrapBlazor.Server.Components.Samples.Table.TablesHeader": {
"TablesHeaderTitle": "表头分组功能",
Expand Down Expand Up @@ -6840,7 +6841,7 @@
"AttributeOnPostDataAsync": "Frame 加载页面传递过来的数据"
},
"BootstrapBlazor.Server.Components.Samples.RDKits": {
"RDKitTitle": "RDKit 分子式组件",
"RDKitTitle": "RDKit.js 分子图组件",
"RDKitDescription": "RDKit 是一个开源的化学信息学工具包,用于分子建模和化学信息学",
"RDKitNormalTitle": "基础用法",
"RDKitNormalIntro": "通过 <code>Smiles</code> 设置分子式,组件画图",
Expand All @@ -6849,5 +6850,13 @@
"RDKitSmartsLabel": "显示 Smarts",
"RDKitSizeTitle": "尺寸",
"RDKitSizeIntro": "通过设置 <code>Width</code> <code>Height</code> 值设置分子式宽高"
},
"BootstrapBlazor.Server.Components.Samples.SmilesDrawers": {
"SmilesDrawerTitle": "SmilesDrawer 分子图组件",
"SmilesDrawerDescription": "SmilesDrawer 是一个开源的化学信息学工具包,用于分子建模和化学信息学",
"SmilesDrawerNormalTitle": "基础用法",
"SmilesDrawerNormalIntro": "通过 <code>Smiles</code> 设置分子式,组件画图",
"SmilesDrawerSizeTitle": "尺寸",
"SmilesDrawerSizeIntro": "通过设置 <code>Width</code> <code>Height</code> 值设置分子式宽高"
}
}
3 changes: 2 additions & 1 deletion src/BootstrapBlazor.Server/docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,8 @@
"sortable-list": "SortableLists",
"win-box": "WinBoxes",
"player": "Players",
"rdkit": "Rdkits"
"rdkit": "Rdkits",
"smiles-drawer": "SmilesDrawers"
},
"video": {
"table": "BV1ap4y1x7Qn?p=1",
Expand Down
Loading