Skip to content

Commit

Permalink
feat(RDKit): add Smarts parameter (#5062)
Browse files Browse the repository at this point in the history
* doc: 增加 Smarts 示例

* doc: 增加 Smarts 示例

* chore: 更新依赖包到最新
  • Loading branch information
ArgoZhang authored Jan 8, 2025
1 parent 9578758 commit e4c37db
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/BootstrapBlazor.Server/BootstrapBlazor.Server.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
<PackageReference Include="BootstrapBlazor.OnScreenKeyboard" Version="9.0.1" />
<PackageReference Include="BootstrapBlazor.PdfReader" Version="9.0.0" />
<PackageReference Include="BootstrapBlazor.Player" Version="9.0.0" />
<PackageReference Include="BootstrapBlazor.RDKit" Version="9.0.0-beta01" />
<PackageReference Include="BootstrapBlazor.RDKit" Version="9.0.0-beta03" />
<PackageReference Include="BootstrapBlazor.SignaturePad" Version="9.0.0" />
<PackageReference Include="BootstrapBlazor.Sortable" Version="9.0.1" />
<PackageReference Include="BootstrapBlazor.Splitting" Version="9.0.1" />
Expand Down
16 changes: 16 additions & 0 deletions src/BootstrapBlazor.Server/Components/Samples/RDKits.razor
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,19 @@
Name="Normal">
<RDKit Value="CC(=O)Oc1ccccc1C(=O)O"></RDKit>
</DemoBlock>

<DemoBlock Title="@Localizer["RDKitSmartsTitle"]"
Introduction="@Localizer["RDKitSmartsIntro"]"
Name="Smarts">
<section ignore>
<div class="row g-3">
<div class="col-12 col-sm-6">
<BootstrapInputGroup>
<BootstrapInputGroupLabel DisplayText="@Localizer["RDKitSmartsLabel"]" />
<Checkbox @bind-Value="_showSmarts"></Checkbox>
</BootstrapInputGroup>
</div>
</div>
</section>
<RDKit Value="CC(=O)Oc1ccccc1C(=O)O" Smarts="@Smarts"></RDKit>
</DemoBlock>
2 changes: 2 additions & 0 deletions src/BootstrapBlazor.Server/Components/Samples/RDKits.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,7 @@ namespace BootstrapBlazor.Server.Components.Samples;
/// </summary>
public partial class RDKits
{
private string? Smarts => _showSmarts ? "Oc1[c,n]cccc1" : "";

private bool _showSmarts;
}
5 changes: 4 additions & 1 deletion src/BootstrapBlazor.Server/Locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -6843,6 +6843,9 @@
"RDKitTitle": "RDKit",
"RDKitDescription": "A powerful cheminformatics and molecule rendering toolbelt for Blazor, Powered by RDKit",
"RDKitNormalTitle": "Basic usage",
"RDKitNormalIntro": "Set the molecular formula through <code>Value</code> and draw the component"
"RDKitNormalIntro": "Set the molecular formula through <code>Value</code> and draw the component",
"RDKitSmartsTitle": "Smarts",
"RDKitSmartsIntro": "By setting the <code>Smarts</code> value, parts of the molecular formula can be highlighted",
"RDKitSmartsLabel": "Show Smarts"
}
}
5 changes: 4 additions & 1 deletion src/BootstrapBlazor.Server/Locales/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -6843,6 +6843,9 @@
"RDKitTitle": "分子图组件",
"RDKitDescription": "RDKit 是一个开源的化学信息学工具包,用于分子建模和化学信息学",
"RDKitNormalTitle": "基础用法",
"RDKitNormalIntro": "通过 <code>Value</code> 设置分子式,组件画图"
"RDKitNormalIntro": "通过 <code>Value</code> 设置分子式,组件画图",
"RDKitSmartsTitle": "Smarts",
"RDKitSmartsIntro": "通过设置 <code>Smarts</code> 值,高亮显示部分分子式",
"RDKitSmartsLabel": "显示 Smarts"
}
}

0 comments on commit e4c37db

Please sign in to comment.